Ask Your Question
0

subscribe laserscan

asked 2014-04-06 13:09:30 -0600

flightgong gravatar image

Hi, I wander known how I can subscribe a known laserscan

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
0

answered 2014-04-06 13:43:10 -0600

Sentinal_Bias gravatar image

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/Wri...

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/h... 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.

edit flag offensive delete link more

Comments

Hi, I have found the laser_node, and its published laser topic, for example named base_scan. When I try to use this data in my subscriber, it returns that this global name doesn't exist. I don't know how to deal with it. Thx

flightgong gravatar imageflightgong ( 2014-04-06 19:44:27 -0600 )edit

do you mean the data in your subscriber function? It should be a struct as defined by the msg file

Sentinal_Bias gravatar imageSentinal_Bias ( 2014-04-08 16:47:27 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2014-04-06 13:09:30 -0600

Seen: 2,186 times

Last updated: Apr 06 '14