[ROS2, Nav2] Segmentation fault when trying to save global costmap

asked 2021-06-11 10:14:40 -0500

levers gravatar image

Hey everyone,

I am running a Husarion ROSBot 2.0 with ROS2 and want to create a map of the environment and save it in order to load it at a later point again.

I can see the created costmap in rviz and when I want to save it with:

ros2 run nav2_map_server map_saver_cli -t /map -f ~/map --ros-args -p save_map_timeout:=20000

I receive the following error message:

[INFO] [1622568319.641766321] [map_saver]: 
    map_saver lifecycle node launched. 
    Waiting on external lifecycle transitions to activate
    See https://design.ros2.org/articles/node_lifecycle.html for more information.
[INFO] [1622568319.641924269] [map_saver]: Creating
[INFO] [1622568319.642361713] [map_saver]: Saving map from 'map' topic to '/home/levers/map' file
[WARN] [1622568319.642400183] [map_saver]: Free threshold unspecified. Setting it to default value: 0.250000
[WARN] [1622568319.642426144] [map_saver]: Occupied threshold unspecified. Setting it to default value: 0.650000
[WARN] [map_io]: Image format unspecified. Setting it to: pgm
[INFO] [map_io]: Received a 2072 X 1476 map @ 0.01 m/pix
Magick: abort due to signal 11 (SIGSEGV) "Segmentation Fault"...

Things I did so far:

  • Found out that the crash occurs in function tryWriteMapToFile from navigation2/nav2_map_server/src/map_io.cpp. There are two nested for-loops, we crash after ~400 loops of the outer for-loop
  • Reinstalled graphicsmagick a few times
  • Reinstalled slam_toolbox and also built it from source
  • Rebuilt the whole workspace
  • apt Update / Upgrade
  • Ran the node with GDB and valgrind, no more insights
    • I am able to save a local costmap because of its size (60x60px), so in theory it works

Does anyone know why I keep getting this Segfault?

Kind Regards :)

edit retag flag offensive close merge delete