Ask Your Question

how to use a saved map file on slam_toolbox

asked 2020-09-09 03:12:54 -0500 gravatar image

i'm newbie on slam,

i follow the doc:

it's ok, when i move the robo via keyboard, and the map created, and saved.

but how to use a saved map file when i reopen the simulator?

Thank you!

my ROS2 version is foxy

edit retag flag offensive close merge delete


any help? thanks! gravatar image  ( 2020-09-10 04:51:45 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2021-05-18 09:20:05 -0500

pablocesar gravatar image

updated 2021-05-18 09:55:20 -0500

Hi chopin1998@gmail.

I created together with a colleague a package for having the launch files and config files regarding the navigation stack, please have a look (

Now, if you want to just navigate I highly recommend you to use the navigation core and not slam_toolbox. But, if you want to continue mapping with slam_toolbox (yeah, it is cool and convenient to be able to map and navigate at the same time), then do the following:

  • If resume, you need the posegraph/slam data file instead of the simple yaml/pgm file, program crashes if you feed the wrong data
  • For saving the map: ros2 service call /serialize_map slam_toolbox/srv/SerializePoseGraph "{filename : 'give_any_name'}"

  • For opening the map to continue mapping: ros2 launch turtlecrab use_map_file:='True' map_file:='<path_to_the_map_location>' map_pose:="[<x, y, z>]"

    • Where map_pose is relative to what /odom is publishing.

Now, if you saved your map as a .yaml file, then use the core navigation (slam) instead:

  • ros2 launch turtlecrab map:='<map_location.yaml>'
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools



Asked: 2020-09-09 03:12:54 -0500

Seen: 490 times

Last updated: May 18 '21