From 853a434fe9fe3f6de4788d78234d04fe3764c106 Mon Sep 17 00:00:00 2001 From: Matthew Kotara Date: Wed, 23 Sep 2026 01:50:04 +0100 Subject: [PATCH] fix(rtabmap_slam): release scan mutex on conversion failure (#1459) * fix(rtabmap_slam): release scan mutex on conversion failure * test(rtabmap_slam): cover scan transform recovery in native tests Replace the standalone reproducer with registered C++ GoogleTests for 2D and 3D scan recovery. Use real ROS inputs, separate DDS domains and bounded timeouts, and include rtabmap_slam in supported CI and coverage jobs. Validated on Jazzy with RTAB-Map core 9ed83a7: both negative controls fail map recovery without the unlocks; both pass with the fix, followed by five repeated runs per case (10/10 passed). Broader distro CI has not been run locally. * chore(rtabmap_slam): keep upstream submission focused on mutex fix Remove the regression test and CI integration from the proposed diff. Retain the reproducer in commit 254ca3b so it can be offered separately with the validation evidence. --------- Co-authored-by: Matthew Kotara Co-authored-by: matlabbe --- rtabmap_slam/src/CoreWrapper.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/rtabmap_slam/src/CoreWrapper.cpp b/rtabmap_slam/src/CoreWrapper.cpp index e36b40aa..efa27be9 100644 --- a/rtabmap_slam/src/CoreWrapper.cpp +++ b/rtabmap_slam/src/CoreWrapper.cpp @@ -1801,6 +1801,7 @@ void CoreWrapper::commonLaserScanCallback( rtabmap_.getMemory() && uStrNumCmp(rtabmap_.getMemory()->getDatabaseVersion(), "0.11.10") < 0)) { RCLCPP_ERROR(this->get_logger(), "Could not convert laser scan msg! Aborting rtabmap update..."); + syncDataMutex_.unlock(); return; } } @@ -1819,6 +1820,7 @@ void CoreWrapper::commonLaserScanCallback( scanCloudIs2d_)) { RCLCPP_ERROR(this->get_logger(), "Could not convert 3d laser scan msg! Aborting rtabmap update..."); + syncDataMutex_.unlock(); return; } }