From a244f2655ece68a9f061694ffc57d9effa05915a Mon Sep 17 00:00:00 2001 From: slz Date: Thu, 3 Sep 2026 20:16:33 +0800 Subject: [PATCH] fix: correct AE strategy configuration --- orbbec_camera/include/orbbec_camera/utils.h | 8 ++++---- orbbec_camera/src/ob_camera_node.cpp | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/orbbec_camera/include/orbbec_camera/utils.h b/orbbec_camera/include/orbbec_camera/utils.h index b74ef056..a65484a9 100644 --- a/orbbec_camera/include/orbbec_camera/utils.h +++ b/orbbec_camera/include/orbbec_camera/utils.h @@ -78,18 +78,18 @@ inline std::string formatObErrorWithStatus(const ob::Error& e) { #define TRY_TO_SET_PROPERTY(func, property, value) \ try { \ - device_->func(property, value); \ + device_->func((property), (value)); \ } catch (const ob::Error& e) { \ - RCLCPP_ERROR_STREAM(logger_, "Failed to set " << property << " to " << value << " in " \ + RCLCPP_ERROR_STREAM(logger_, "Failed to set " << (property) << " to " << (value) << " in " \ << __FUNCTION__ << " at line " << __LINE__ \ << ": " \ << orbbec_camera::formatObErrorWithStatus(e)); \ } catch (const std::exception& e) { \ - RCLCPP_ERROR_STREAM(logger_, "Failed to set " << property << " to " << value << " in " \ + RCLCPP_ERROR_STREAM(logger_, "Failed to set " << (property) << " to " << (value) << " in " \ << __FUNCTION__ << " at line " << __LINE__ \ << ": " << e.what()); \ } catch (...) { \ - RCLCPP_ERROR_STREAM(logger_, "Failed to set " << property << " to " << value << " in " \ + RCLCPP_ERROR_STREAM(logger_, "Failed to set " << (property) << " to " << (value) << " in " \ << __FUNCTION__ << " at line " << __LINE__); \ } diff --git a/orbbec_camera/src/ob_camera_node.cpp b/orbbec_camera/src/ob_camera_node.cpp index 9ead182f..2b4e9405 100644 --- a/orbbec_camera/src/ob_camera_node.cpp +++ b/orbbec_camera/src/ob_camera_node.cpp @@ -1958,10 +1958,10 @@ void OBCameraNode::setupDevices() { if (should_apply_launch_config("ae_strategy") && device_->isPropertySupported(OB_PROP_DEVICE_AE_STRATEGY_INT, OB_PERMISSION_WRITE)) { TRY_TO_SET_PROPERTY(setIntProperty, OB_PROP_DEVICE_AE_STRATEGY_INT, - (ae_strategy_ == "motion" ? 0 : 1)); + (ae_strategy_ == "motion" ? 1 : 0)); TRY_EXECUTE_BLOCK(RCLCPP_INFO_STREAM( logger_, "Current Sports Mode: " - << (device_->getIntProperty(OB_PROP_DEVICE_AE_STRATEGY_INT) == 0 ? "ON" + << (device_->getIntProperty(OB_PROP_DEVICE_AE_STRATEGY_INT) == 1 ? "ON" : "OFF"))); }