Even though this question is quite old: You have to run the map_saver while the bag is still playing. If you start it after the bag has finished, there are no messages on the /map topic for the map_saver to capture and save.
If you want to make sure, that you only get the latest map messages out of the bag, use the following procedure:
- Use
rosbag info
to determine the length of your bag in seconds - Start a
roscore
and run the map_saver
with the appropriate topic set - Play your bag file with
rosbag play -s x bagfile.bag
where x
is the duration of your bag minus 3-5 seconds. (Depends on the rate at which the map is published. If it does not get a map, try to subtract longer timespans)
This way you dont have to manually start the saver at the latest possible moment. :)