From 61bd84bcd6062abef1f2c0596ecc564704ceae16 Mon Sep 17 00:00:00 2001 From: matlabbe Date: Sat, 14 Oct 2023 12:59:32 -0700 Subject: [PATCH] Fixed rgbd_cameras=0 when rtabmap is not built with multi rgbd callbacks #1046 --- rtabmap_sync/src/CommonDataSubscriber.cpp | 30 +++++++++++------------ 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/rtabmap_sync/src/CommonDataSubscriber.cpp b/rtabmap_sync/src/CommonDataSubscriber.cpp index 5715abf52..5ecbc610a 100644 --- a/rtabmap_sync/src/CommonDataSubscriber.cpp +++ b/rtabmap_sync/src/CommonDataSubscriber.cpp @@ -518,22 +518,8 @@ void CommonDataSubscriber::setupCallbacks( } else if(subscribedToRGBD_) { - if(rgbdCameras == 0) - { - setupRGBDXCallbacks( - nh, - pnh, - subscribedToOdom_, - subscribeUserData, - subscribeScan2d, - subscribeScan3d, - subscribeScanDesc, - subscribeOdomInfo, - queueSize_, - approxSync_); - } #ifdef RTABMAP_SYNC_MULTI_RGBD - else if(rgbdCameras >= 6) + if(rgbdCameras >= 6) { if(rgbdCameras > 6) { @@ -619,6 +605,20 @@ void CommonDataSubscriber::setupCallbacks( "but you will have to synchronize RGBDImage topics yourself."); } #endif + else if(rgbdCameras == 0) + { + setupRGBDXCallbacks( + nh, + pnh, + subscribedToOdom_, + subscribeUserData, + subscribeScan2d, + subscribeScan3d, + subscribeScanDesc, + subscribeOdomInfo, + queueSize_, + approxSync_); + } else { setupRGBDCallbacks(