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

how to use a saved map file on slam_toolbox

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

chopin1998@gmail.com gravatar image

i'm newbie on slam,

i follow the doc: https://navigation.ros.org/tutorials/...

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

Comments

any help? thanks!

chopin1998@gmail.com gravatar image chopin1998@gmail.com  ( 2020-09-10 04:51:45 -0500 )edit

1 Answer

Sort by » oldest newest most voted
0

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 (https://github.com/fontysrobotics/tur...)

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 slam_toolbox.launch.py 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 nav_core.launch.py map:='<map_location.yaml>'
edit flag offensive delete link more

Question Tools

2 followers

Stats

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

Seen: 1,951 times

Last updated: May 18 '21