ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

how to attach a 3D map to a 2D map using gmapping and octomap

asked 2012-09-09 19:08:27 -0500

Chong gravatar image

updated 2012-09-09 19:34:50 -0500

Hi I have used amcl to build a 2D map and rgbdslam+octomap to build a 3D map. These two maps are for the same room. Now I want to attach the 3D map onto the 2D map, like the picture below, is there a way of doing this? I tried change the parameters in .yaml file but it does not work.Thanks for any suggestions !!!

image description

by the way, the image is from here

edit retag flag offensive close merge delete


You built a 2D map with AMCL? Do you mean you built it with gmapping?

Eric Perko gravatar image Eric Perko  ( 2012-09-09 19:27:15 -0500 )edit

opps sorry. yes I built the map using gmapping but i use amcl to do the localization on this 2D map. i mixed these two, my bad

Chong gravatar image Chong  ( 2012-09-09 19:34:05 -0500 )edit

did you solve the problem? it would be greate if you could tell us your result, because I am having the same problem!

Gazer gravatar image Gazer  ( 2013-07-02 14:56:58 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2012-09-10 00:21:15 -0500

dornhege gravatar image

As far as I know the octomap can produce a 2d map from itself by projecting it. This would then also fit.

Nevertheless, you should be able to use both independently by just suppling the 2d map via the map server as normal. If they are build together/based on the same data, they should then also match each other.

If they are build using different localization data, you'll need to align them. I don't know anything automatic, so the easiest might be to modify the 2d map origin.

edit flag offensive delete link more


I got the 2D map from laser scan and 3D map from RGBDSlam + Octomap,but for the same room, does it count as "based on the same data"? And I tried modifying the 2D origin in .yaml file but it cannot solve the problem that the 3D map is tilted comparing to the 2D map. Any ideas?

Chong gravatar image Chong  ( 2012-09-10 05:45:24 -0500 )edit

If they don't fit together easily, then you have a problem. Is using the 2D map generated by the octomap an option?

dornhege gravatar image dornhege  ( 2012-09-11 00:29:12 -0500 )edit

yes but the one using laser scan is much more clear and has less noise. is there a way to change the orientation of a 2d map in rviz?

Chong gravatar image Chong  ( 2012-09-12 10:49:24 -0500 )edit

No, rviz only displays. To change the 2D map, you can do two things: 1. Change the origin in the yaml, 2. Just edit/rotate the image - essentially the map is just an image.

dornhege gravatar image dornhege  ( 2012-09-12 23:03:59 -0500 )edit

Question Tools

1 follower


Asked: 2012-09-09 19:08:27 -0500

Seen: 2,656 times

Last updated: Sep 10 '12