Skip to content

feat: add save map ROS2 service#70

Open
gnathoi wants to merge 5 commits intokoide3:masterfrom
hest-hq:feat/save-map-service
Open

feat: add save map ROS2 service#70
gnathoi wants to merge 5 commits intokoide3:masterfrom
hest-hq:feat/save-map-service

Conversation

@gnathoi
Copy link
Copy Markdown

@gnathoi gnathoi commented Mar 27, 2026

Adds a simple ROS2 save map service (SaveMap.srv) that allows saving the ROS node's results without shutting down the node. This is something I needed, as I wanted to save intermediate steps between sequential bags during large mobile mapping runs (processing happens offline).

To use the service:
ros2 service call /glim_ros/save_map glim_ros/srv/SaveMap "{path: '/example/path'}"

The save blocks the ROS2 executor thread while writing. Sensor data queued during a long save may be dropped by DDS. This is expected behaviour and is logged as a warning. This is because I only need to run it at the end of a bag after playing, and making this asynchronous would have been a significantly more complex undertaking.

I have tested this service running this on one of the example bags on my computer using a jazzy build, and the behaviour is as expected.

gnathoi added 5 commits March 27, 2026 14:21
save() acquires global_mapping_mutex and calls optimize() internally.
This blocks the ROS2 executor thread for the duration (potentially
30-60s for large maps). Sensor callbacks cannot fire during this window
— DDS/RMW subscriber queues have bounded depth and incoming LiDAR/IMU
data may be dropped. This is intentional: save_map is an operator
action; a brief data gap is acceptable. Do not call from automated
controllers.
@gnathoi gnathoi marked this pull request as ready for review March 30, 2026 12:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant