feat: add intra_camera_sync_reference argument for camera synchronization

This commit is contained in:
obyalian
2025-10-13 21:02:30 +08:00
parent ce31e3a6ce
commit 2aa927e664
3 changed files with 22 additions and 0 deletions
@@ -830,5 +830,7 @@ class OBCameraNode {
std::unique_ptr<FpsDelayStatus> fps_delay_status_color_{nullptr};
std::unique_ptr<FpsDelayStatus> fps_delay_status_depth_{nullptr};
std::string intra_camera_sync_reference_;
};
} // namespace orbbec_camera
@@ -306,6 +306,8 @@ def generate_launch_description():
DeclareLaunchArgument("force_ip_subnet_mask", default_value="255.255.255.0"), # Subnet mask used for static IP
DeclareLaunchArgument("force_ip_gateway", default_value="192.168.1.1"), # Gateway address used for static IP
DeclareLaunchArgument('intra_camera_sync_reference', default_value='Middle'),#Start, Middle or End
]
def get_params(context, args):
+18
View File
@@ -834,6 +834,22 @@ void OBCameraNode::setupDevices() {
TRY_TO_SET_PROPERTY(setBoolProperty, OB_PROP_SDK_GYRO_FRAME_TRANSFORMED_BOOL,
enable_gyro_data_correction_);
}
if (isGemini335PID(pid) &&
(sync_mode_ == OB_MULTI_DEVICE_SYNC_MODE_SOFTWARE_TRIGGERING ||
sync_mode_ == OB_MULTI_DEVICE_SYNC_MODE_HARDWARE_TRIGGERING) &&
device_->isPropertySupported(OB_PROP_INTRA_CAMERA_SYNC_REFERENCE_INT, OB_PERMISSION_WRITE)) {
RCLCPP_INFO_STREAM(logger_,
"Setting intra camera sync reference to " << intra_camera_sync_reference_);
if (intra_camera_sync_reference_ == "Start") {
TRY_TO_SET_PROPERTY(setIntProperty, OB_PROP_INTRA_CAMERA_SYNC_REFERENCE_INT, 0);
} else if (intra_camera_sync_reference_ == "Middle") {
TRY_TO_SET_PROPERTY(setIntProperty, OB_PROP_INTRA_CAMERA_SYNC_REFERENCE_INT, 1);
} else if (intra_camera_sync_reference_ == "End") {
TRY_TO_SET_PROPERTY(setIntProperty, OB_PROP_INTRA_CAMERA_SYNC_REFERENCE_INT, 2);
} else {
RCLCPP_ERROR(logger_, "intra camera sync reference does not support this setting");
}
}
}
void OBCameraNode::setupColorPostProcessFilter() {
auto color_sensor = device_->getSensor(OB_SENSOR_COLOR);
@@ -1953,6 +1969,8 @@ void OBCameraNode::getParameters() {
setAndGetNodeParameter<bool>(show_fps_enable_, "show_fps_enable", false);
setAndGetNodeParameter<bool>(enable_publish_extrinsic_, "enable_publish_extrinsic", false);
setAndGetNodeParameter<std::string>(intra_camera_sync_reference_, "intra_camera_sync_reference",
"Middle");
RCLCPP_INFO_STREAM(logger_, "current time domain: " << time_domain_);
RCLCPP_INFO_STREAM(logger_, "hdr_index1_laser_control_ "