Quantcast
Channel: ROS Answers: Open Source Q&A Forum - RSS feed
Viewing all articles
Browse latest Browse all 417

c++ and python accessing topics

$
0
0
Hi, I have two ros packages, one written in c++ and another in python. Each package generates its own custom ros msg of type Float64MultiArray and the two are meant to subscribe to each other. From the c++ package, I can subscribe to the python topic and access its custom msg without having to add any additional libraries. However, when I try to subscribe to the c++ topic and therefore access its custom message by using rospy.Subscriber("cpp_pkg", Float64MultiArray, myfun, queue_size = 10) it is never executed. I do believe that in the python code I need to include the c++ package using from cpp_msg.msg import cpp_msg However, compiling the c++ ros package using roscd cpp_pkg make or rosmake I can see the .h file generated by genmsg_cpp. I have no idea why the genmsg_py does not generate .py file. Is there something that I need to add to the line rosbuild_genmsg() in CMakeLists.txt to generate the .py file that I can incorporate into the python code to get it to subscribe to the c++ package? If it should make a difference, I am using ros indigo and I have preferred to not move on to using catkin_make. Furthermore, I can see the topic as /cpp_topic when I run the command rostopic list Cheers, Moses.

Viewing all articles
Browse latest Browse all 417

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>