Re: Improving a lidar-only setup

Posted by matlabbe on
URL: http://official-rtab-map-forum.206.s1.nabble.com/Improving-a-lidar-only-setup-tp11071p11177.html

I checked on my computer, and the closing logs should look like this:
ros2 run rtabmap_slam rtabmap -d --ros-args --log-level debug

<ctrl-c>

^C[INFO] [1747519798.830341876] [rclcpp]: signal_handler(signum=2)
[DEBUG] [1747519798.830414897] [rclcpp]: signal_handler(): notifying deferred signal handler
[DEBUG] [1747519798.830538703] [rclcpp]: deferred_signal_handler(): woken up due to SIGINT/SIGTERM or uninstall
[DEBUG] [1747519798.830590741] [rclcpp]: deferred_signal_handler(): shutting down
[DEBUG] [1747519798.830734759] [rclcpp]: deferred_signal_handler(): shutting down rclcpp::Context @ 0x639e109b76f0, because it had shutdown_on_signal == true
[DEBUG] [1747519798.830764990] [rcl]: Shutting down ROS client library, for context at address: 0x639e109bafe0
[DEBUG] [1747519798.830840216] [rcl]: Finalizing publisher
[DEBUG] [1747519798.832016428] [rcl]: Publisher finalized
[DEBUG] [1747519798.832059038] [rcl]: Finalizing publisher
[DEBUG] [1747519798.832335566] [rcl]: Publisher finalized
[DEBUG] [1747519798.832475203] [rclcpp]: deferred_signal_handler(): waiting for SIGINT/SIGTERM or uninstall
[DEBUG] [1747519798.832495209] [rclcpp]: SignalHandler::uninstall(): notifying deferred signal handler
[DEBUG] [1747519798.832540555] [rclcpp]: deferred_signal_handler(): woken up due to SIGINT/SIGTERM or uninstall
[DEBUG] [1747519798.832551930] [rclcpp]: deferred_signal_handler(): signal handling uninstalled
[DEBUG] [1747519798.832680552] [rclcpp]: signal handler uninstalled
[INFO] [1747519798.881312456] [rtabmap]: Parameters are not saved (No configuration file provided...)
rtabmap: Saving database/long-term memory... (located at /home/mathieu/.ros/rtabmap.db)
rtabmap: Saving database/long-term memory...done! (located at /home/mathieu/.ros/rtabmap.db, 0 MB)

Based on your log, maybe that error is happening if an external node is subscribed to one specific publisher (which one? not sure how to know that) from rtabmap node:
[rtabmap-7] [DEBUG] [2025-05-12 09:53:11.716] [rcl]: Finalizing publisher
[rtabmap-7] terminate called after throwing an instance of 'std::runtime_error'
[rtabmap-7]   what():  context cannot be slept with because it's invalid
The only similar post I've found: https://github.com/ros2/ros2/issues/1659, which seems also related to a publisher. Can you try to run only the rtabmap node like I did to see if the error still happen on your side?