Ask Your Question
1

How to build a map on rviz from laser scan

asked 2016-05-16 12:21:25 -0500

Marcus Barnet gravatar image

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.

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
1

answered 2016-05-16 12:33:01 -0500

billy gravatar image

You will need to use the Hector SLAM node. Tutorial: http://wiki.ros.org/hector_slam/Tutor...

edit flag offensive delete link more

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?

Marcus Barnet gravatar image Marcus Barnet  ( 2016-05-16 12:51:58 -0500 )edit
1

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.

billy gravatar image billy  ( 2016-05-16 21:24:09 -0500 )edit

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.

Marcus Barnet gravatar image Marcus Barnet  ( 2016-05-17 12:48:00 -0500 )edit

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]

Marcus Barnet gravatar image Marcus Barnet  ( 2016-05-17 12:50:37 -0500 )edit
0

answered 2016-05-24 01:51:16 -0500

gp gravatar image

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.

edit flag offensive delete link more

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

ligang gravatar image ligang  ( 2016-05-30 03:51:03 -0500 )edit

if node "hector_trajectory_server" is running, you can use this command to save tiff map

rostopic pub syscommand std_msgs/String "savegeotiff"

for more details follow this tutorial last step is for saving map.

gp gravatar image gp  ( 2016-05-30 04:17:56 -0500 )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

1 follower

Stats

Asked: 2016-05-16 12:21:25 -0500

Seen: 3,263 times

Last updated: May 24 '16