0

With ROS2 Jazzy, when I trying to run SLAM in locationzation mode, I'm getting:

serialization::Read: Failed to open requested file: /home/<user>/map/map.yaml. 
 DeserializePoseGraph: Failed to read file: /home/<user>/map/map.yaml.

My SLAM config:

slam_toolbox:
 ros__parameters:
 # Plugin params
 solver_plugin: solver_plugins::CeresSolver
 ceres_linear_solver: SPARSE_NORMAL_CHOLESKY
 ceres_preconditioner: SCHUR_JACOBI
 ceres_trust_strategy: LEVENBERG_MARQUARDT
 ceres_dogleg_type: TRADITIONAL_DOGLEG
 ceres_loss_function: None
 # ROS Parameters
 odom_frame: odom
 map_frame: map
 base_frame: body_link
 scan_topic: /scan
 use_map_saver: true
 mode: localization
 map_file_name: /home/<user>/map/map.yaml
 map_start_pose: [0.0, 0.0, 0.0]

But the file exist and having the right mode

 drwxrwxr-x 2 <user> <usergroup> 4096 Jul 4 16:39 ./
 drwxrwxr-x 15 <user> <usergroup> 4096 Jul 11 01:26 ../
 -rw-rw-rw- 1 <user> <usergroup> 87752 Jul 2 02:37 map.pgm
 -rw-rw-rw- 1 <user> <usergroup> 159 Jul 4 16:36 map.yaml

The content of the map.yaml file:

 image: "/home/<user>/map/map.pgm"
 mode: trinary
 resolution: 0.1
 origin: [-19.2, -11.2, 0]
 negate: 0
 occupied_thresh: 0.65
 free_thresh: 0.25

I spent multiple hours trying to figure it out, without any success.

Does someone have any idea?

asked Jul 11, 2025 at 2:10
1
  • If you want to do localization with slam toolbox itself you need to serialize the map instead of saving it (saving is for external plugins/programs) This should generate a .data file and a .posegraph file Like this: ros2 service call /slam_toolbox/serialize_map slam_toolbox/srv/SerializePoseGraph "{filename: 'test_mapi'}" Commented Jul 24, 2025 at 10:23

1 Answer 1

0

First of all, as in the comment above, you need to serialize the map. You can do it this way:

  1. Open RViz2 with launched slam_toolbox.
  2. Select above "Panels > Add New Panel" and add SlamToolboxPlugin.
  3. In the opened plugin window, to the right of the "Serialize card" button, write the filename. You can leave the name "map".
  4. Click "Serialize Map". As a result, files with extensions ".data" and ".posegraph" will be saved in your working directory.

After that you need to specify the path to these files without the file extension, only the file name.

In your case:

map_file_name: /home/<user>/map/map
answered Aug 16, 2025 at 14:08
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.