From e0a766ed4bf37a83fc504682329253950a79e257 Mon Sep 17 00:00:00 2001 From: slz Date: Tue, 26 May 2026 20:09:57 +0800 Subject: [PATCH 1/2] fix: avoid host time sync on unsupported devices --- orbbec_camera/include/orbbec_camera/utils.h | 2 ++ orbbec_camera/src/ob_camera_node_driver.cpp | 2 +- orbbec_camera/src/utils.cpp | 10 ++++++++++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/orbbec_camera/include/orbbec_camera/utils.h b/orbbec_camera/include/orbbec_camera/utils.h index cf69e6ef..d9c216bf 100644 --- a/orbbec_camera/include/orbbec_camera/utils.h +++ b/orbbec_camera/include/orbbec_camera/utils.h @@ -151,6 +151,8 @@ rmw_qos_profile_t getRMWQosProfileFromString(const std::string& str_qos); bool isOpenNIDevice(int pid); +bool isHostTimeSyncSupported(int pid); + OB_DEPTH_PRECISION_LEVEL depthPrecisionLevelFromString( const std::string& depth_precision_level_str); diff --git a/orbbec_camera/src/ob_camera_node_driver.cpp b/orbbec_camera/src/ob_camera_node_driver.cpp index 402b4f9b..fbf29e0e 100644 --- a/orbbec_camera/src/ob_camera_node_driver.cpp +++ b/orbbec_camera/src/ob_camera_node_driver.cpp @@ -435,7 +435,7 @@ void OBCameraNodeDriver::initializeDevice(const std::shared_ptr &dev serial_number_ = device_info_->serialNumber(); CHECK_NOTNULL(device_info_.get()); device_unique_id_ = device_info_->uid(); - if (enable_sync_host_time_ && !isOpenNIDevice(device_info_->pid())) { + if (enable_sync_host_time_ && isHostTimeSyncSupported(device_info_->pid())) { TRY_EXECUTE_BLOCK(device_->timerSyncWithHost()); sync_host_time_timer_ = this->create_wall_timer(std::chrono::milliseconds(30000), [this]() { if (device_) { diff --git a/orbbec_camera/src/utils.cpp b/orbbec_camera/src/utils.cpp index d7fcd137..7f5ef2d7 100644 --- a/orbbec_camera/src/utils.cpp +++ b/orbbec_camera/src/utils.cpp @@ -471,6 +471,16 @@ bool isOpenNIDevice(int pid) { [pid](int pid_openni) { return pid == pid_openni; }); } +bool isHostTimeSyncSupported(int pid) { + static const std::vector UNSUPPORTED_DEVICE_PIDS = {0x069d}; + + if (isOpenNIDevice(pid)) { + return false; + } + return std::none_of(UNSUPPORTED_DEVICE_PIDS.begin(), UNSUPPORTED_DEVICE_PIDS.end(), + [pid](int unsupported_pid) { return pid == unsupported_pid; }); +} + OB_DEPTH_PRECISION_LEVEL depthPrecisionLevelFromString( const std::string &depth_precision_level_str) { if (depth_precision_level_str == "1mm") { From 99a4a337d8b3024a6cdad64f75284698a4360eab Mon Sep 17 00:00:00 2001 From: slz Date: Tue, 26 May 2026 20:22:15 +0800 Subject: [PATCH 2/2] fix: disable astra pro2 IR by default --- orbbec_camera/launch/astra_pro2.launch.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/orbbec_camera/launch/astra_pro2.launch.py b/orbbec_camera/launch/astra_pro2.launch.py index d147bb3b..0af9e89e 100644 --- a/orbbec_camera/launch/astra_pro2.launch.py +++ b/orbbec_camera/launch/astra_pro2.launch.py @@ -49,7 +49,7 @@ def generate_launch_description(): DeclareLaunchArgument('ir_height', default_value='480'), DeclareLaunchArgument('ir_fps', default_value='10'), DeclareLaunchArgument('ir_format', default_value='Y10'), - DeclareLaunchArgument('enable_ir', default_value='true'), + DeclareLaunchArgument('enable_ir', default_value='false'), DeclareLaunchArgument('flip_ir', default_value='false'), DeclareLaunchArgument('ir_qos', default_value='default'), DeclareLaunchArgument('ir_camera_info_qos', default_value='default'),