Re: How to mark location in occupancy grid map?

Posted by matlabbe on
URL: http://official-rtab-map-forum.206.s1.nabble.com/How-to-mark-location-in-occupancy-grid-map-tp79p82.html

The referential of the map is from where the robot is started, at (0,0,0) on the map frame. The relation between the /map referential and the /world referential is up to you.

/world -> /map -> /odom -> /base_link

The map_server is not really useful if you use already the grid_map_assembler node. If you still want to save the map using map_server, you can do that (example with the robot demo):
$ roslaunch rtabmap_ros demo_robot_mapping_rviz.launch
$ rosbag play --clock demo_mapping.bag
$ rosrun map_server map_saver map:=rtabmap/grid_map

[ INFO] [1418918495.308835788]: Waiting for the map
[ INFO] [1418918513.666870631, 1368730049.014493602]: Received a 531 X 245 map @ 0.050 m/pix
[ INFO] [1418918513.666947571, 1368730049.014493602]: Writing map occupancy data to map.pgm
[ INFO] [1418918513.670619867, 1368730049.014493602]: Writing map occupancy data to map.yaml
[ INFO] [1418918513.670841755, 1368730049.014493602]: Done

When restarting the robot in localization mode, you can regenerate the grid map from the database by calling /publish_map service:
$ rosservice call /rtabmap/publish_map 1 1 0
If there is a grid_map_assembler subscribed to rtabmap_ros/MapData topic from rtabmap node, it will regenerate the grid map.