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

RTAB-map 2d occupancy grid

asked 2016-03-22 22:24:15 -0600

Jack000 gravatar image

I'm trying to get /rtabmap/grid_map working. I'm using the kinect + fake 2d laserscan method in the tutorial, and there is data being published to /scan

When I rostopic echo /rtabmap/grid_map, nothing is displayed.

I expected that if the subscribe_laserScan argument is on, rtabmap will output a 2d occupancy grid map under /rtabmap/grid_map. Is that incorrect? What other settings could affect grid_map?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2016-03-23 12:05:21 -0600

matlabbe gravatar image

updated 2016-03-23 13:57:23 -0600


If inputs of rtabmap node are correctly connected, you should see a log info printed each second (and the grid_map topic should be published each second, empty or not). If not, it is because there is one of the input topic which is not published. You can know to which topics rtabmap is connected when rtabmap is launched or looking in your launch file, example:

/rtabmap/rtabmap subscribed to:

In that case you can verify if they are published like this:

$ rostopic hz /camera/rgb/image_rect_color
$ rostopic hz /camera/depth_registered/image_raw
$ rostopic hz /camera/rgb/camera_info
$ rostopic hz /odom
$ rostopic hz /scan


edit flag offensive delete link more


how do I know which topics are necessary for grid_map? I thought only /scan is required for the grid map

Jack000 gravatar image Jack000  ( 2016-03-23 12:41:32 -0600 )edit

rtabmap node requires at least RGB-D images + odom. If you add /scan, then a 2D map can be also created. If you have only a laser scanner, you may better use packages like hector_mapping.

matlabbe gravatar image matlabbe  ( 2016-03-23 14:00:49 -0600 )edit

I have RGB-D images and /scan working, but my expectation was that RGB-D + /scan = grid_map. rtabmap node creates the topic /rtabmap/grid_map but nothing is published to it.

I guess it's a bit confusing because there's no tutorial or demo showing how grid_map works, or even how to enable it.

Jack000 gravatar image Jack000  ( 2016-03-24 01:01:03 -0600 )edit

I'm running this launch file for the kinect2_bridge:

but I don't see any configs that should conflict with generating a 2d map

Jack000 gravatar image Jack000  ( 2016-03-24 01:09:18 -0600 )edit

This launch file doesn't have subscribe_scan argument like rgbd_mapping.launch. The robot mapping with RVIZ demo generates a grid_map.

matlabbe gravatar image matlabbe  ( 2016-03-24 08:54:44 -0600 )edit

Is /rtabmap/mapData published? If not, add the rqt_graph to your question. If yes, can you visualize the scan on RVIZ (to make sure the scan is not empty)?

matlabbe gravatar image matlabbe  ( 2016-03-24 08:57:02 -0600 )edit

ah, did not know about rqt_graph. I had put the kinect bridge and rtabmap stuff in one launch file, which apparently produced some kind of conflict. I've got grid_map working now. thanks for the help

Jack000 gravatar image Jack000  ( 2016-04-01 20:52:48 -0600 )edit

Question Tools

1 follower


Asked: 2016-03-22 22:24:15 -0600

Seen: 2,424 times

Last updated: Mar 23 '16