Ask Your Question
1

ROS2 slam toolbox localization mode config example

asked 2020-05-19 06:19:13 -0600

RodBelaFarin gravatar image

I could not find an example .yaml config file on how to run slam toolbox in localization mode with a pre-generated map.

I tried a lot of different ways. I ended up with the following file:

# ROS Parameters
odom_frame: odom
map_frame: map
base_frame: base_footprint
scan_topic: /scan
mode: localization #mapping 

# if you'd like to start localizing on bringup in a map and pose
map_file_name: map_1589815244.yaml
#map_start_pose: [5.0, 1.0, 0.0]

I put the .yaml and the .pgm file in a folder named _maps_ inside my slam toolbox package. I also added this folder as install directory in my CMakeLists.txt

Nevertheless, if I am starting Slam Toolbox with this configuration, it creates a new map instead of loading the "old" map.

I am using ROS2 Eloquent in Ubuntu 18.04

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2020-05-19 12:44:05 -0600

Those aren't valid serialized maps. A valid serialized map files will be .posegraph and .data. This localization mode is exclusive to maps that have been serialized to retain the entire state of the slam session (data, graph constraints, laser properties, etc).

Your issue appears to be try to load a yaml file of a map saved through a map server. This isn't a localization mode built to operate on map _images_, rather than map sesssions themselves. Please review this ROSCon talk where I try to make it very clear that a map is not an image, its a globally consistent representation of the environment and we work with that data for our method.

edit flag offensive delete link more

Comments

Just to add on, after getting .posegraph and .data. Rename them to test.posegraph and test.data and then in the map_file_name add the file to just 'test'. eg. /path/file/test

root-robot gravatar image root-robot  ( 2021-09-13 03:32:04 -0600 )edit

Your Answer

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

Add Answer

Question Tools

2 followers

Stats

Asked: 2020-05-19 06:19:13 -0600

Seen: 596 times

Last updated: May 19 '20