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

Revision history [back]

click to hide/show revision 1
initial version

Hello,

I assume that you want to use the map generated by RTAB-Map for simulation experiments using Stage. It is possible to create a .world for Stage referencing an image (e.g. black pixels are walls). Here is an example to generate such images from an already built database. Using IROS14-kinect-challenge.db from this RTAB-Map's tutorial:

$ roscore
$ rosrun rtabmap_ros rtabmap _database_path:=IROS14-kinect-challenge.db
$ rosrun map_server map_saver map:=proj_map
$ rosservice call /publish_map 1 1 0

This takes some time for rtabmap node to build the projection map, but you should see this in the terminal of the map_saver:

[ INFO] [1441403556.668234515]: Waiting for the map
[ INFO] [1441403565.477020944]: Received a 508 X 420 map @ 0.050 m/pix
[ INFO] [1441403565.477108000]: Writing map occupancy data to map.pgm
[ INFO] [1441403565.482476945]: Writing map occupancy data to map.yaml
[ INFO] [1441403565.482683795]: Done

You may need to convert the PGM to a BMP for stage and change all the grey pixels to white. The map.pgm:

image description

map.yaml:

image: map.pgm
resolution: 0.050000
origin: [-9.033475, -11.844757, 0.000000]
negate: 0
occupied_thresh: 0.65
free_thresh: 0.196

cheers