How to build a map on rviz from laser scan
I'm using a SICK laser scan under ROS. When i run the node, I can see the /scan topic from rostopic and I can also display the scan data under RVIZ by selecting /laser as fixed frame.
Now, I would like to build a 2-D map of my room under Gazebo. I would like to move the laser sensor around my room and to build a map.
I tried to find some tutorial on google, but I wasn't able to find any good document. Can you help me, please?
I think should specify the room frame as fixed and the laser frame as non-static, but I don't know how to do this.
Asked by Marcus Barnet on 2016-05-16 12:21:25 UTC
Answers
You will need to use the Hector SLAM node. Tutorial: http://wiki.ros.org/hector_slam/Tutorials/SettingUpForYourRobot
Asked by billy on 2016-05-16 12:33:01 UTC
Comments
thank you for the tip! So, should I use the "use without odom frame" option as specified in the tutorial? How do I have to manage the laser tf and frame?
Asked by Marcus Barnet on 2016-05-16 12:51:58 UTC
That is the cool part about Hector mapping, no odom required. As to managing the laser tf: http://wiki.ros.org/laser_drivers. You're going to have to sit down and do some reading.
Asked by billy on 2016-05-16 21:24:09 UTC
I tried to follow the tutorial, I launched roslaunch hector_slam_launch tutorial.launch and in RVIZ, I select /laser as fixed frame in order to see laser data on the map but all points are referred to laser frame and so I cant build the map if I move the laser.
Asked by Marcus Barnet on 2016-05-17 12:48:00 UTC
I get this error: No tf data. Actual error: Fixed Frame [laser] does not exist. If I specify /map as static frame, then the laser values disappear from the grid. Can you help me to solve this problem? In map it says: No transform from [map] to [laser]
Asked by Marcus Barnet on 2016-05-17 12:50:37 UTC
The hector_slam_launch tutorial.launch works with prerecorded rosbag files. In your case some modifications are required. have a look at this project hector_slam_example. In launch folder you will find hector_hokuyo.launch file, modify the hokuyo part with SICK sensor initialization.
Asked by gp on 2016-05-24 01:51:16 UTC
Comments
I test the code is very excellent. but as a fresh ,I am not know that how to save the image ? I use the command rosrun map_server map_saver -f my_map but I only get the wait without end, I use Ctrl+Alt + c to shut down the terminal, but I can not get anyting. I need help to solve the quenstion
Asked by ligang on 2016-05-30 03:51:03 UTC
Comments