0
$\begingroup$

Rosanswers logo

Hi, I would like to know how I could subscribe to a topic which has multiple data variables in python using rosbuild not catkin, such as the velocity.msg on the turtlesim program which has both, angular and linear data sets on one topic.

I am just simply wanting to subscribe to the topic, and print out on terminal both variables.

so far all the tutorials I have seen such as the writing a simple publisher and subscriber tutorial and the publisher and subscriber one on rospy tutorials have just shown examples for subscribing to topics which only have one data variable, because string one has one...

any help is appreciated


Originally posted by Nathan Wong on ROS Answers with karma: 3 on 2013-04-05

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

This [tutorial](http://www.ros.org/wiki/roscpp_tutorials/Tutorials/Publisher and Subscriber with Parameters and Dynamic Reconfigure) shows how to do that. In particular, you could look at the Python node which prints out multiple variables from a custom message.


Originally posted by Thomas D with karma: 4347 on 2013-04-05

This answer was ACCEPTED on the original site

Post score: 1


Original comments

Comment by Nathan Wong on 2013-04-07:
Thank you this was very useful! :)

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.