0
$\begingroup$

Rosanswers logo

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?


Originally posted by KennyHimawan on ROS Answers with karma: 15 on 2014-07-21

Post score: 0


Original comments

Comment by KennyHimawan on 2014-07-21:
@jc2016 thanks for your answer, for the '$rostopic echo laser_scan_topic', should I put the complete topic name or just the last part??

Comment by jc2016 on 2014-07-21:
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.

Comment by jc2016 on 2014-07-21:
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.

Comment by KennyHimawan on 2014-07-21:
@jc2016 it is working, thanks!! :)

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

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: http://wiki.ros.org/rosbag/Tutorials/Recording%20and%20playing%20back%20data

 $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 :)).


Originally posted by jc2016 with karma: 150 on 2014-07-21

This answer was ACCEPTED on the original site

Post score: 1

$\endgroup$

Your Answer

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