Ask Your Question

Open and Save Laser Scan Reading from Hokuyo on Gazebo [closed]

asked 2014-07-21 00:55:57 -0500

KennyHimawan gravatar image

Hi, I am new with Gazebo and ROS, I have found out on how to spawn Hokuyo on Gazebo and open Topic Visualization so that I can see what the Laser Scanner is detecting. But, how to retrieve and save the reading data in polar form to be analyzed?

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by KennyHimawan
close date 2014-07-21 22:28:49.424293


@jc2016 thanks for your answer, for the '$rostopic echo laser_scan_topic', should I put the complete topic name or just the last part??

KennyHimawan gravatar image KennyHimawan  ( 2014-07-21 20:29:44 -0500 )edit

I'm not really sure what you mean by the last part. If you use the command $rostopic list you can find the list of all of the topics that are currently being published. Look through that list to find the name you should use. I think it should just be the last part, but check the list to be sure.

jc2016 gravatar image jc2016  ( 2014-07-21 21:16:38 -0500 )edit

Also, I want to emphasize, echoing is not saving. You have to use the rosbag tool to save any of the data. Hope this helps.

jc2016 gravatar image jc2016  ( 2014-07-21 21:17:26 -0500 )edit

@jc2016 it is working, thanks!! :)

KennyHimawan gravatar image KennyHimawan  ( 2014-07-21 22:25:29 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2014-07-21 16:24:33 -0500

jc2016 gravatar image

If you would like to echo (i.e. see the data in the terminal), you want to use: $rostopic echo laser_scan_topic Where you replace laser_scan_topic with the name of the topic that your laser is publishing to. To record, you want to use the rosbag tool, as described in this tutorial: $rosbag record laser_scan_topic $rosbag play <bagfile-name> The tutorials also have alot of other, helpful tools to understanding topics, nodes, etc. Most lasers publish in polar coordinates, but if you want to sense objects you will need to install and run another package that uses the laser scan info (or write your own :)).

edit flag offensive delete link more

Question Tools

1 follower


Asked: 2014-07-21 00:55:57 -0500

Seen: 1,291 times

Last updated: Jul 21 '14