mirror of
https://github.com/orbbec/OrbbecSDK_ROS2.git
synced 2026-09-12 11:10:19 +08:00
Add color_rotation ,depth_rotation ,left_ir_rotation and right_ir_rotation parameters
This commit is contained in:
@@ -462,6 +462,10 @@ class OBCameraNode {
|
||||
bool enable_ir_auto_exposure_ = true;
|
||||
bool enable_ir_long_exposure_ = false;
|
||||
bool enable_ldp_ = true;
|
||||
int color_rotation_ = -1;
|
||||
int depth_rotation_ = -1;
|
||||
int left_ir_rotation_ = -1;
|
||||
int right_ir_rotation_ = -1;
|
||||
int color_exposure_ = -1;
|
||||
int color_gain_ = -1;
|
||||
int color_white_balance_ = -1;
|
||||
|
||||
@@ -68,6 +68,7 @@ def generate_launch_description():
|
||||
DeclareLaunchArgument('enable_color', default_value='true'),
|
||||
DeclareLaunchArgument('color_qos', default_value='default'),
|
||||
DeclareLaunchArgument('color_camera_info_qos', default_value='default'),
|
||||
DeclareLaunchArgument('color_rotation', default_value='0'),#color rotation degree : 0, 90, 180, 270
|
||||
DeclareLaunchArgument('enable_color_auto_exposure', default_value='true'),
|
||||
DeclareLaunchArgument('color_exposure', default_value='-1'),
|
||||
DeclareLaunchArgument('color_gain', default_value='-1'),
|
||||
@@ -93,6 +94,7 @@ def generate_launch_description():
|
||||
DeclareLaunchArgument('enable_depth', default_value='true'),
|
||||
DeclareLaunchArgument('depth_qos', default_value='default'),
|
||||
DeclareLaunchArgument('depth_camera_info_qos', default_value='default'),
|
||||
DeclareLaunchArgument('depth_rotation', default_value='0'),#depth rotation degree : 0, 90, 180, 270
|
||||
DeclareLaunchArgument('depth_ae_roi_left', default_value='-1'),
|
||||
DeclareLaunchArgument('depth_ae_roi_top', default_value='-1'),
|
||||
DeclareLaunchArgument('depth_ae_roi_right', default_value='-1'),
|
||||
@@ -104,6 +106,7 @@ def generate_launch_description():
|
||||
DeclareLaunchArgument('enable_left_ir', default_value='false'),
|
||||
DeclareLaunchArgument('left_ir_qos', default_value='default'),
|
||||
DeclareLaunchArgument('left_ir_camera_info_qos', default_value='default'),
|
||||
DeclareLaunchArgument('left_ir_rotation', default_value='0'),#left ir rotation degree : 0, 90, 180, 270
|
||||
DeclareLaunchArgument('right_ir_width', default_value='0'),
|
||||
DeclareLaunchArgument('right_ir_height', default_value='0'),
|
||||
DeclareLaunchArgument('right_ir_fps', default_value='0'),
|
||||
@@ -111,6 +114,7 @@ def generate_launch_description():
|
||||
DeclareLaunchArgument('enable_right_ir', default_value='false'),
|
||||
DeclareLaunchArgument('right_ir_qos', default_value='default'),
|
||||
DeclareLaunchArgument('right_ir_camera_info_qos', default_value='default'),
|
||||
DeclareLaunchArgument('right_ir_rotation', default_value='0'),#right ir rotation degree : 0, 90, 180, 270
|
||||
DeclareLaunchArgument('enable_ir_auto_exposure', default_value='true'),
|
||||
DeclareLaunchArgument('ir_exposure', default_value='-1'),
|
||||
DeclareLaunchArgument('ir_gain', default_value='-1'),
|
||||
|
||||
@@ -320,7 +320,30 @@ void OBCameraNode::setupDevices() {
|
||||
roi.y1_bottom = depth_ae_roi_bottom_;
|
||||
device_->setStructuredData(OB_STRUCT_DEPTH_AE_ROI, &roi, sizeof(AE_ROI));
|
||||
}
|
||||
|
||||
if (color_rotation_ != -1 &&
|
||||
device_->isPropertySupported(OB_PROP_COLOR_ROTATE_INT, OB_PERMISSION_READ_WRITE)) {
|
||||
device_->setIntProperty(OB_PROP_COLOR_ROTATE_INT, color_rotation_);
|
||||
RCLCPP_INFO_STREAM(
|
||||
logger_, "set color rotation to " << device_->getIntProperty(OB_PROP_COLOR_ROTATE_INT));
|
||||
}
|
||||
if (depth_rotation_ != -1 &&
|
||||
device_->isPropertySupported(OB_PROP_DEPTH_ROTATE_INT, OB_PERMISSION_READ_WRITE)) {
|
||||
device_->setIntProperty(OB_PROP_DEPTH_ROTATE_INT, depth_rotation_);
|
||||
RCLCPP_INFO_STREAM(
|
||||
logger_, "set depth rotation to " << device_->getIntProperty(OB_PROP_DEPTH_ROTATE_INT));
|
||||
}
|
||||
if (left_ir_rotation_ != -1 &&
|
||||
device_->isPropertySupported(OB_PROP_IR_ROTATE_INT, OB_PERMISSION_READ_WRITE)) {
|
||||
device_->setIntProperty(OB_PROP_IR_ROTATE_INT, left_ir_rotation_);
|
||||
RCLCPP_INFO_STREAM(
|
||||
logger_, "set left ir rotation to " << device_->getIntProperty(OB_PROP_IR_ROTATE_INT));
|
||||
}
|
||||
if (right_ir_rotation_ != -1 &&
|
||||
device_->isPropertySupported(OB_PROP_IR_RIGHT_ROTATE_INT, OB_PERMISSION_READ_WRITE)) {
|
||||
device_->setIntProperty(OB_PROP_IR_RIGHT_ROTATE_INT, right_ir_rotation_);
|
||||
RCLCPP_INFO_STREAM(logger_, "set right ir rotation to "
|
||||
<< device_->getIntProperty(OB_PROP_IR_RIGHT_ROTATE_INT));
|
||||
}
|
||||
if (device_->isPropertySupported(OB_PROP_DEPTH_PRECISION_LEVEL_INT, OB_PERMISSION_READ_WRITE) &&
|
||||
!depth_precision_str_.empty()) {
|
||||
auto default_precision_level = device_->getIntProperty(OB_PROP_DEPTH_PRECISION_LEVEL_INT);
|
||||
@@ -1096,6 +1119,7 @@ void OBCameraNode::getParameters() {
|
||||
setAndGetNodeParameter(enable_frame_sync_, "enable_frame_sync", false);
|
||||
setAndGetNodeParameter(enable_color_auto_exposure_, "enable_color_auto_exposure", true);
|
||||
setAndGetNodeParameter(enable_color_auto_white_balance_, "enable_color_auto_white_balance", true);
|
||||
setAndGetNodeParameter<int>(color_rotation_, "color_rotation", -1);
|
||||
setAndGetNodeParameter<int>(color_exposure_, "color_exposure", -1);
|
||||
setAndGetNodeParameter<int>(color_gain_, "color_gain", -1);
|
||||
setAndGetNodeParameter<int>(color_white_balance_, "color_white_balance", -1);
|
||||
@@ -1106,6 +1130,9 @@ void OBCameraNode::getParameters() {
|
||||
setAndGetNodeParameter<int>(color_contrast_, "color_contrast", -1);
|
||||
setAndGetNodeParameter<int>(color_gamma_, "color_gamma", -1);
|
||||
setAndGetNodeParameter<int>(color_hue_, "color_hue", -1);
|
||||
setAndGetNodeParameter<int>(depth_rotation_, "depth_rotation", -1);
|
||||
setAndGetNodeParameter<int>(left_ir_rotation_, "left_ir_rotation", -1);
|
||||
setAndGetNodeParameter<int>(right_ir_rotation_, "right_ir_rotation", -1);
|
||||
setAndGetNodeParameter(enable_ir_auto_exposure_, "enable_ir_auto_exposure", true);
|
||||
setAndGetNodeParameter<int>(ir_exposure_, "ir_exposure", -1);
|
||||
setAndGetNodeParameter<int>(ir_gain_, "ir_gain", -1);
|
||||
|
||||
Reference in New Issue
Block a user