ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Hi

I am assuming you have done all the beginner tutorials, because they explain subscribers, topics and publishers really well see here http://wiki.ros.org/ROS/Tutorials/WritingPublisherSubscriber%28python%29

If you want to know the name of the laser scan topic run the laser_node or the node that publishes the laser scan use rostopic list to figure out the name of the topic. eg "chatter" in the beginner tutorials

In order to write your subscriber you need to import the msg http://docs.ros.org/api/sensor_msgs/html/msg/LaserScan.html eg

from sensor_msgs.msg import LaserScan

Once your callback function is triggered you will get back a struct that is defined by the .msg file

you can also use the rosmsg XXX command to figure out the types of msgs packages publish from the terminal and their format.