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

how to get a 2D map using octomap

asked 2012-06-18 10:05:51 -0600

Chong gravatar image

I am using ubuntu 11.10 and electric ROS.

I've already got 3D map using rgbdslam pkg and now I want to downproject the 3D map to 2D in order for localization. However I cannot find a tutorial on how to do this using octomap though I know it has such a function. Can someone give me any advice? Thanks !

edit retag flag offensive close merge delete



Hello, I am currently facing the same problem! How did you solve it? Sorry about opening a closed thread. i am unable to get much info on this online. Thank you!

Chithra gravatar image Chithra  ( 2013-02-07 13:43:38 -0600 )edit

4 Answers

Sort by » oldest newest most voted

answered 2012-06-18 10:18:39 -0600

updated 2012-06-18 10:26:01 -0600

octomap_server publishes a 2D map on the topic /map.

edit flag offensive delete link more


I am new in ROS, so I am confused at how to get this 2D map from the topic and use this map for later use. Can you give me some more specific instructions? Thanks a lot !

Chong gravatar image Chong  ( 2012-06-18 10:29:02 -0600 )edit

try this command
rosrun map_server map_saver -f map , this command will save the map in your current directory

cagatay gravatar image cagatay  ( 2012-06-18 10:46:27 -0600 )edit

do I have to run some command before that?

Chong gravatar image Chong  ( 2012-06-18 16:46:58 -0600 )edit

answered 2012-06-18 12:07:37 -0600

Chong gravatar image

Thanks all for answering. One more question: can I use an exiting 3D map (.pcd or .bt) to "load" into octomap_server and then produce a 2D map, or i can only produce a 2D map the same time when I create a 3D map?

edit flag offensive delete link more


@Chong, Hi ,Have you solved the issue? I also have the same requirement, convert an exiting map to 2d map

maxj_ros gravatar image maxj_ros  ( 2019-03-24 21:47:39 -0600 )edit

answered 2012-06-18 17:53:19 -0600

prince gravatar image

updated 2012-06-18 17:57:42 -0600

You can also have a look at answer here

edit flag offensive delete link more

answered 2012-06-18 10:48:53 -0600

Bill Smart gravatar image

You can save the map published by octomap_server using rosrun map_server map_saver.

edit flag offensive delete link more

Question Tools

1 follower


Asked: 2012-06-18 10:05:51 -0600

Seen: 3,782 times

Last updated: Jun 18 '12