ROS Resources: Documentation | Support | Discussion Forum | Service Status | Q&A
Ask Your Question

How to create OccupancyGrid from Laser scan data and Pose (odometry)?

asked 2013-11-18 00:49:38 -0600

updated 2014-01-28 17:18:33 -0600

ngrennan gravatar image

I am working on a laser scan matching algorithm and I have got the pose of the robot during laser scans. How do I generate a map with this data? I do not want to use gmapping. I just want to use laser and pose data and create map_server topic to visualize in rviz.I figured out that occupancy grid has to be generated and it would be published as /map but there is no tutorial as to how to generate a occupancy grid.

edit retag flag offensive close merge delete


Do you want any algorithm in between or use the pose + scans you get to build the map?

dornhege gravatar imagedornhege ( 2013-11-18 02:59:36 -0600 )edit

I want to use pose+scans to build the map. simply put I have odometry and laser scan topics I want map_server from these two.

balakumar-s gravatar imagebalakumar-s ( 2013-11-18 03:06:47 -0600 )edit

Hello, I also want to know how to use /scan and /robot_pose_ekf to create /map. I want to know the principle. Thank you.

Nick Hoo gravatar imageNick Hoo ( 2016-10-08 22:31:39 -0600 )edit

1 Answer

Sort by » oldest newest most voted

answered 2013-11-18 21:19:01 -0600

updated 2013-11-18 21:20:44 -0600

I´m not 100% sure it works out of the box (and I definitely have not time to test it), but by using hector_mapping and a launch file setup similar to this one, it should be possible to perform mapping with known poses. The example launch file was used to map a 1.7m-2.1m height slice of an environment. The most important parts are the "map_with_known_poses" and "use_tf_pose_start_estimate" parameters, which both have to be set to "true".

edit flag offensive delete link more


Thanks! but I have my own algorithm for scan matching and generating poses for each laser scan. I want to just use the poses and laser scans and map to simulate the effectiveness of my algorithm. Using the launch file would just use hector mapping to map or use only my algorithm to map?

balakumar-s gravatar imagebalakumar-s ( 2013-11-18 21:46:48 -0600 )edit

It would completely use your algorithm to map and just use tf and laser data to produce an occupancy grid map.

Stefan Kohlbrecher gravatar imageStefan Kohlbrecher ( 2013-11-19 19:50:26 -0600 )edit

It is using hector_mapping. I tested by having odom as static(made everything 0) and yet i get a proper map. I am attaching the launch file. this is the link.

balakumar-s gravatar imagebalakumar-s ( 2013-11-19 20:14:01 -0600 )edit

It´s using tf for mapping, so as long as there is a transform between map and the laser scan´s frame_id, it should map with known poses. It really should not perform any localization.

Stefan Kohlbrecher gravatar imageStefan Kohlbrecher ( 2013-11-20 01:35:16 -0600 )edit

It is not working, there is some problem in my tf so I am building my own code for this as I am interested in SLAM and learning about occupancyGrid and Mapping will be helpful. Thank you.

balakumar-s gravatar imagebalakumar-s ( 2013-11-22 06:20:07 -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

1 follower


Asked: 2013-11-18 00:49:38 -0600

Seen: 1,984 times

Last updated: Nov 19 '13