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

Get only the current map from GMapping

asked 2015-03-23 05:59:35 -0500

sadek gravatar image

Hi, I'm new in ROS and I want to do a DATMO application with laser scan. For the first step of this application, I only need to get the current map created by GMapping. Is that possible?

Could you please tell me what should I do in details? or show me some references?

Thank you.

edit retag flag offensive close merge delete

2 Answers

Sort by ┬╗ oldest newest most voted

answered 2015-03-23 09:46:10 -0500

Dear Sadek,

gmapping is designed to work with odometry and laser scan data and you cannot use it if one of them is missing. If I understand you need to transform laser data in an occupancy grid (that is the same topic type of map published by gmapping): in that case some kind of Costmap2D is what you need. You should set up static_map to false, so no external map is required and only laser data will be used, and rolling_window to true, so the robot will be every posed at centre of costmap. Costmap2D will publish /grid that should be exactly what you need.

Unfortunately (for you) the Costmap2D is not provided as node since it is embedded in move_base node so you should get the sources and write your own node. Furthermore it do something more than transform laser data to occupancy grid: it define costs used for path planning: maybe you can find a setup that works fine for your goal.

edit flag offensive delete link more


Thank you for your response. It's exactly what I need. However, is there any other package (more simpler) which converts laser data in an occupancy grid?

sadek gravatar image sadek  ( 2015-03-23 13:47:17 -0500 )edit

Not in my knowledge, sorry!

afranceson gravatar image afranceson  ( 2015-03-23 14:05:53 -0500 )edit

Thanks afranceson. I'll try Costmap2D then.

sadek gravatar image sadek  ( 2015-03-23 17:43:07 -0500 )edit

answered 2015-03-23 06:14:27 -0500

dornhege gravatar image provides a topic and service that give you the current map. The basic ROS tutorials explain how to call these.

edit flag offensive delete link more


Hi again, I think that there is a miseard. I mean by "current map" the map related to the robot (the local map). In fact, my robot doesn't provide odometry data so I just want to see the current map provided with laser scan in fixed location (x = 0, y = 0, theta = 0).

sadek gravatar image sadek  ( 2015-03-23 07:29:11 -0500 )edit

I'm not sure what you mean, but gmapping only provides a global map. You can transform that to robot coordinates if need be.

dornhege gravatar image dornhege  ( 2015-03-23 08:08:05 -0500 )edit

Yes, you understand me well. the topic "/map" provides a global map but I need the local one. Is there any modification that I can make on the source scde of GMapping to extract only the local map?

sadek gravatar image sadek  ( 2015-03-23 08:14:52 -0500 )edit

Question Tools

1 follower


Asked: 2015-03-23 05:59:35 -0500

Seen: 1,038 times

Last updated: Mar 23 '15