feat: add auto exposure mode and sports mode support to OBCameraNode

This commit is contained in:
ob-yalian
2026-01-13 17:23:08 +08:00
parent b9be5184a4
commit 31a34e2cc2
3 changed files with 22 additions and 0 deletions
@@ -878,5 +878,7 @@ class OBCameraNode {
std::unique_ptr<FpsDelayStatus> fps_delay_status_depth_{nullptr};
std::string intra_camera_sync_reference_ = "";
std::string ae_mode_;
bool enable_sports_mode_;
};
} // namespace orbbec_camera
+2
View File
@@ -86,6 +86,8 @@ def generate_launch_description():
DeclareLaunchArgument('enable_colored_point_cloud', default_value='false'),
DeclareLaunchArgument('cloud_frame_id', default_value=''),
DeclareLaunchArgument('connection_delay', default_value='10'),
DeclareLaunchArgument('ae_mode', default_value='depthbased'), # depthbased or colorbased
DeclareLaunchArgument('enable_sports_mode', default_value='false'),
DeclareLaunchArgument('color_width', default_value='0'),
DeclareLaunchArgument('color_height', default_value='0'),
DeclareLaunchArgument('color_fps', default_value='0'),
+18
View File
@@ -955,6 +955,22 @@ void OBCameraNode::setupDevices() {
RCLCPP_ERROR(logger_, "intra camera sync reference does not support this setting");
}
}
if (pid == 0x0840) {
if (enable_sports_mode_) {
if (device_->isPropertySupported(OB_PROP_COLOR_AE_MODE_INT, OB_PERMISSION_WRITE)) {
device_->setIntProperty(OB_PROP_COLOR_AE_MODE_INT, enable_sports_mode_);
RCLCPP_INFO_STREAM(logger_,
"Setting Sports Mode to " << (enable_sports_mode_ ? "ON" : "OFF"));
}
}
if (!ae_mode_.empty()) {
if (device_->isPropertySupported(OB_PROP_COLOR_AE_MODE_INT, OB_PERMISSION_WRITE)) {
auto ae_mode = ae_mode_ == "depthbased" ? 0 : 1;
device_->setIntProperty(OB_PROP_COLOR_AE_MODE_INT, ae_mode);
RCLCPP_INFO_STREAM(logger_, "Setting AE Mode to " << ae_mode_);
}
}
}
}
void OBCameraNode::setupColorPostProcessFilter() {
try {
@@ -2153,6 +2169,8 @@ void OBCameraNode::getParameters() {
setAndGetNodeParameter<bool>(enable_publish_extrinsic_, "enable_publish_extrinsic", false);
setAndGetNodeParameter<std::string>(intra_camera_sync_reference_, "intra_camera_sync_reference",
"Middle");
setAndGetNodeParameter<std::string>(ae_mode_, "ae_mode", "depthbased");
setAndGetNodeParameter<bool>(enable_sports_mode_, "enable_sports_mode", false);
RCLCPP_INFO_STREAM(logger_, "current time domain: " << time_domain_);
RCLCPP_INFO_STREAM(logger_, "hdr_index1_laser_control_ "