mirror of
https://github.com/orbbec/OrbbecSDK_ROS2.git
synced 2026-09-12 19:20:20 +08:00
feat: add intra_camera_sync_reference argument for camera synchronization
This commit is contained in:
@@ -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):
|
||||
|
||||
@@ -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_ "
|
||||
|
||||
Reference in New Issue
Block a user