mirror of
https://github.com/orbbec/OrbbecSDK_ROS2.git
synced 2026-09-12 11:10:19 +08:00
Rename 'mean_intensity_set_point' to 'depth_brightness' in launch parameters and update related documentation
This commit is contained in:
@@ -382,10 +382,9 @@ ros2 launch orbbec_camera gemini_330_series.launch.py enable_color:=true color_w
|
||||
* **enable_depth_auto_exposure_priority**
|
||||
* Enable the Depth auto exposure priority
|
||||
* For example:`enable_depth_auto_exposure_priority:=true`
|
||||
* **mean_intensity_set_point**
|
||||
* Set the target mean intensity of the Depth image
|
||||
* For example: `mean_intensity_set_point:=100`
|
||||
* **Note:** This parameter replaces the deprecated `depth_brightness`.
|
||||
* **depth_brightness**
|
||||
* Set the target mean intensity of the Depth image
|
||||
* For example: `depth_brightness:=100`
|
||||
|
||||
[......](./docs/launch_parameters.md)
|
||||
|
||||
|
||||
@@ -78,9 +78,8 @@ The following are the launch parameters available:
|
||||
* Set the Color decimation filter scale
|
||||
* **enable_depth_auto_exposure_priority**
|
||||
* Enable the Depth auto exposure priority
|
||||
* **mean_intensity_set_point**
|
||||
* Set the target mean intensity of the Depth image
|
||||
* **Note:** This parameter replaces the deprecated `depth_brightness`.
|
||||
* **depth_brightness**
|
||||
* Set the target mean intensity of the Depth image
|
||||
* **enable_ir_auto_exposure**
|
||||
* Enable the IR auto exposure
|
||||
* **ir_exposure**
|
||||
|
||||
@@ -115,7 +115,7 @@ def generate_launch_description():
|
||||
DeclareLaunchArgument('depth_ae_roi_right', default_value='-1'),
|
||||
DeclareLaunchArgument('depth_ae_roi_top', default_value='-1'),
|
||||
DeclareLaunchArgument('depth_ae_roi_bottom', default_value='-1'),
|
||||
DeclareLaunchArgument('mean_intensity_set_point', default_value='-1'),
|
||||
DeclareLaunchArgument('depth_brightness', default_value='-1'),
|
||||
DeclareLaunchArgument('left_ir_width', default_value='0'),
|
||||
DeclareLaunchArgument('left_ir_height', default_value='0'),
|
||||
DeclareLaunchArgument('left_ir_fps', default_value='0'),
|
||||
|
||||
@@ -115,7 +115,7 @@ def generate_launch_description():
|
||||
DeclareLaunchArgument('depth_ae_roi_right', default_value='-1'),
|
||||
DeclareLaunchArgument('depth_ae_roi_top', default_value='-1'),
|
||||
DeclareLaunchArgument('depth_ae_roi_bottom', default_value='-1'),
|
||||
DeclareLaunchArgument('mean_intensity_set_point', default_value='-1'),
|
||||
DeclareLaunchArgument('depth_brightness', default_value='-1'),
|
||||
DeclareLaunchArgument('left_ir_width', default_value='0'),
|
||||
DeclareLaunchArgument('left_ir_height', default_value='0'),
|
||||
DeclareLaunchArgument('left_ir_fps', default_value='0'),
|
||||
|
||||
+1
-1
@@ -115,7 +115,7 @@ def generate_launch_description():
|
||||
DeclareLaunchArgument('depth_ae_roi_right', default_value='-1'),
|
||||
DeclareLaunchArgument('depth_ae_roi_top', default_value='-1'),
|
||||
DeclareLaunchArgument('depth_ae_roi_bottom', default_value='-1'),
|
||||
DeclareLaunchArgument('mean_intensity_set_point', default_value='-1'),
|
||||
DeclareLaunchArgument('depth_brightness', default_value='-1'),
|
||||
DeclareLaunchArgument('left_ir_width', default_value='0'),
|
||||
DeclareLaunchArgument('left_ir_height', default_value='0'),
|
||||
DeclareLaunchArgument('left_ir_fps', default_value='0'),
|
||||
|
||||
@@ -275,6 +275,10 @@ class OBCameraNode {
|
||||
const std::shared_ptr<std_srvs::srv::SetBool::Request>& request,
|
||||
std::shared_ptr<std_srvs::srv::SetBool::Response>& response);
|
||||
|
||||
void setPtpConfigCallback(const std::shared_ptr<rmw_request_id_t>& request_header,
|
||||
const std::shared_ptr<std_srvs::srv::SetBool::Request>& request,
|
||||
std::shared_ptr<std_srvs::srv::SetBool::Response>& response);
|
||||
|
||||
void setFanWorkModeCallback(const std::shared_ptr<SetInt32::Request>& request,
|
||||
std::shared_ptr<SetInt32::Response>& response);
|
||||
|
||||
@@ -302,7 +306,8 @@ class OBCameraNode {
|
||||
|
||||
void getLdpStatusCallback(const std::shared_ptr<GetBool::Request>& request,
|
||||
std::shared_ptr<GetBool::Response>& response);
|
||||
|
||||
void getPtpConfigCallback(const std::shared_ptr<GetBool::Request>& request,
|
||||
std::shared_ptr<GetBool::Response>& response);
|
||||
void getLrmMeasureDistanceCallback(const std::shared_ptr<GetInt32::Request>& request,
|
||||
std::shared_ptr<GetInt32::Response>& response);
|
||||
|
||||
@@ -489,6 +494,8 @@ class OBCameraNode {
|
||||
rclcpp::Service<std_srvs::srv::SetBool>::SharedPtr set_laser_enable_srv_;
|
||||
rclcpp::Service<std_srvs::srv::SetBool>::SharedPtr set_ldp_enable_srv_;
|
||||
rclcpp::Service<orbbec_camera_msgs::srv::GetBool>::SharedPtr get_ldp_status_srv_;
|
||||
rclcpp::Service<std_srvs::srv::SetBool>::SharedPtr set_ptp_config_srv_;
|
||||
rclcpp::Service<orbbec_camera_msgs::srv::GetBool>::SharedPtr get_ptp_config_srv_;
|
||||
rclcpp::Service<std_srvs::srv::SetBool>::SharedPtr set_floor_enable_srv_;
|
||||
rclcpp::Service<SetInt32>::SharedPtr set_fan_work_mode_srv_;
|
||||
rclcpp::Service<std_srvs::srv::SetBool>::SharedPtr toggle_sensors_srv_;
|
||||
@@ -566,7 +573,7 @@ class OBCameraNode {
|
||||
int depth_ae_roi_top_ = -1;
|
||||
int depth_ae_roi_right_ = -1;
|
||||
int depth_ae_roi_bottom_ = -1;
|
||||
int mean_intensity_set_point_ = -1;
|
||||
int depth_brightness_ = -1;
|
||||
int ir_exposure_ = -1;
|
||||
int ir_gain_ = -1;
|
||||
int ir_ae_max_exposure_ = -1;
|
||||
|
||||
@@ -96,7 +96,7 @@ def generate_launch_description():
|
||||
DeclareLaunchArgument('depth_camera_info_qos', default_value='default'),
|
||||
DeclareLaunchArgument('enable_depth_auto_exposure_priority', default_value='false'),
|
||||
DeclareLaunchArgument('depth_precision', default_value=''),
|
||||
DeclareLaunchArgument('mean_intensity_set_point', default_value='-1'),
|
||||
DeclareLaunchArgument('depth_brightness', default_value='-1'),
|
||||
DeclareLaunchArgument('left_ir_width', default_value='0'),
|
||||
DeclareLaunchArgument('left_ir_height', default_value='0'),
|
||||
DeclareLaunchArgument('left_ir_fps', default_value='0'),
|
||||
|
||||
@@ -96,7 +96,7 @@ def generate_launch_description():
|
||||
DeclareLaunchArgument('depth_camera_info_qos', default_value='default'),
|
||||
DeclareLaunchArgument('enable_depth_auto_exposure_priority', default_value='false'),
|
||||
DeclareLaunchArgument('depth_precision', default_value=''),
|
||||
DeclareLaunchArgument('mean_intensity_set_point', default_value='-1'),
|
||||
DeclareLaunchArgument('depth_brightness', default_value='-1'),
|
||||
DeclareLaunchArgument('left_ir_width', default_value='0'),
|
||||
DeclareLaunchArgument('left_ir_height', default_value='0'),
|
||||
DeclareLaunchArgument('left_ir_fps', default_value='0'),
|
||||
|
||||
@@ -113,7 +113,7 @@ def generate_launch_description():
|
||||
DeclareLaunchArgument('depth_ae_roi_right', default_value='-1'),
|
||||
DeclareLaunchArgument('depth_ae_roi_top', default_value='-1'),
|
||||
DeclareLaunchArgument('depth_ae_roi_bottom', default_value='-1'),
|
||||
DeclareLaunchArgument('mean_intensity_set_point', default_value='-1'),
|
||||
DeclareLaunchArgument('depth_brightness', default_value='-1'),
|
||||
DeclareLaunchArgument('left_ir_width', default_value='0'),
|
||||
DeclareLaunchArgument('left_ir_height', default_value='0'),
|
||||
DeclareLaunchArgument('left_ir_fps', default_value='0'),
|
||||
|
||||
@@ -114,7 +114,7 @@ def generate_launch_description():
|
||||
DeclareLaunchArgument('depth_ae_roi_right', default_value='-1'),
|
||||
DeclareLaunchArgument('depth_ae_roi_top', default_value='-1'),
|
||||
DeclareLaunchArgument('depth_ae_roi_bottom', default_value='-1'),
|
||||
DeclareLaunchArgument('mean_intensity_set_point', default_value='-1'),
|
||||
DeclareLaunchArgument('depth_brightness', default_value='-1'),
|
||||
DeclareLaunchArgument('left_ir_width', default_value='0'),
|
||||
DeclareLaunchArgument('left_ir_height', default_value='0'),
|
||||
DeclareLaunchArgument('left_ir_fps', default_value='0'),
|
||||
|
||||
@@ -572,15 +572,15 @@ void OBCameraNode::setupDevices() {
|
||||
TRY_TO_SET_PROPERTY(setIntProperty, OB_PROP_DEPTH_AUTO_EXPOSURE_PRIORITY_INT,
|
||||
set_enable_depth_auto_exposure_priority);
|
||||
}
|
||||
if (mean_intensity_set_point_ != -1 &&
|
||||
if (depth_brightness_ != -1 &&
|
||||
device_->isPropertySupported(OB_PROP_IR_BRIGHTNESS_INT, OB_PERMISSION_WRITE)) {
|
||||
auto range = device_->getIntPropertyRange(OB_PROP_IR_BRIGHTNESS_INT);
|
||||
if (mean_intensity_set_point_ < range.min || mean_intensity_set_point_ > range.max) {
|
||||
if (depth_brightness_ < range.min || depth_brightness_ > range.max) {
|
||||
RCLCPP_ERROR(logger_, "depth brightness value is out of range[%d,%d], please check the value",
|
||||
range.min, range.max);
|
||||
} else {
|
||||
RCLCPP_INFO_STREAM(logger_, "Setting depth brightness to " << mean_intensity_set_point_);
|
||||
TRY_TO_SET_PROPERTY(setIntProperty, OB_PROP_IR_BRIGHTNESS_INT, mean_intensity_set_point_);
|
||||
RCLCPP_INFO_STREAM(logger_, "Setting depth brightness to " << depth_brightness_);
|
||||
TRY_TO_SET_PROPERTY(setIntProperty, OB_PROP_IR_BRIGHTNESS_INT, depth_brightness_);
|
||||
}
|
||||
}
|
||||
// ir ae max
|
||||
@@ -1672,7 +1672,7 @@ void OBCameraNode::getParameters() {
|
||||
setAndGetNodeParameter<int>(depth_ae_roi_top_, "depth_ae_roi_top", -1);
|
||||
setAndGetNodeParameter<int>(depth_ae_roi_right_, "depth_ae_roi_right", -1);
|
||||
setAndGetNodeParameter<int>(depth_ae_roi_bottom_, "depth_ae_roi_bottom", -1);
|
||||
setAndGetNodeParameter<int>(mean_intensity_set_point_, "mean_intensity_set_point", -1);
|
||||
setAndGetNodeParameter<int>(depth_brightness_, "depth_brightness", -1);
|
||||
setAndGetNodeParameter<std::string>(depth_precision_str_, "depth_precision", "");
|
||||
setAndGetNodeParameter<bool>(enable_ir_auto_exposure_, "enable_ir_auto_exposure", true);
|
||||
setAndGetNodeParameter<int>(ir_exposure_, "ir_exposure", -1);
|
||||
|
||||
@@ -135,6 +135,19 @@ void OBCameraNode::setupCameraCtrlServices() {
|
||||
(void)request_header;
|
||||
getLdpStatusCallback(request, response);
|
||||
});
|
||||
set_ptp_config_srv_ = node_->create_service<SetBool>(
|
||||
"set_ptp_config", [this](const std::shared_ptr<rmw_request_id_t> request_header,
|
||||
const std::shared_ptr<SetBool::Request> request,
|
||||
std::shared_ptr<SetBool::Response> response) {
|
||||
setPtpConfigCallback(request_header, request, response);
|
||||
});
|
||||
get_ptp_config_srv_ = node_->create_service<GetBool>(
|
||||
"get_ptp_config", [this](const std::shared_ptr<rmw_request_id_t> request_header,
|
||||
const std::shared_ptr<GetBool::Request> request,
|
||||
std::shared_ptr<GetBool::Response> response) {
|
||||
(void)request_header;
|
||||
getPtpConfigCallback(request, response);
|
||||
});
|
||||
|
||||
get_white_balance_srv_ = node_->create_service<GetInt32>(
|
||||
"get_white_balance", [this](const std::shared_ptr<GetInt32::Request> request,
|
||||
@@ -378,10 +391,10 @@ void OBCameraNode::setAeRoiCallback(const std::shared_ptr<SetArrays ::Request>&
|
||||
reinterpret_cast<const uint8_t*>(&config), sizeof(config));
|
||||
device_->getStructuredData(OB_STRUCT_DEPTH_AE_ROI, reinterpret_cast<uint8_t*>(&config),
|
||||
&data_size);
|
||||
RCLCPP_INFO_STREAM(logger_,
|
||||
"set depth AE ROI : " << "[Left: " << config.x0_left << ", Right: "
|
||||
<< config.x1_right << ", Top: " << config.y0_top
|
||||
<< ", Bottom: " << config.y1_bottom << " ]");
|
||||
RCLCPP_INFO_STREAM(
|
||||
logger_, "set depth AE ROI : "
|
||||
<< "[Left: " << config.x0_left << ", Right: " << config.x1_right
|
||||
<< ", Top: " << config.y0_top << ", Bottom: " << config.y1_bottom << " ]");
|
||||
break;
|
||||
case OB_STREAM_COLOR:
|
||||
config.x0_left = (static_cast<short int>(request->data_param[0]) < 0)
|
||||
@@ -412,10 +425,10 @@ void OBCameraNode::setAeRoiCallback(const std::shared_ptr<SetArrays ::Request>&
|
||||
reinterpret_cast<const uint8_t*>(&config), sizeof(config));
|
||||
device_->getStructuredData(OB_STRUCT_COLOR_AE_ROI, reinterpret_cast<uint8_t*>(&config),
|
||||
&data_size);
|
||||
RCLCPP_INFO_STREAM(logger_,
|
||||
"set color AE ROI : " << "[Left: " << config.x0_left << ", Right: "
|
||||
<< config.x1_right << ", Top: " << config.y0_top
|
||||
<< ", Bottom: " << config.y1_bottom << " ]");
|
||||
RCLCPP_INFO_STREAM(
|
||||
logger_, "set color AE ROI : "
|
||||
<< "[Left: " << config.x0_left << ", Right: " << config.x1_right
|
||||
<< ", Top: " << config.y0_top << ", Bottom: " << config.y1_bottom << " ]");
|
||||
break;
|
||||
default:
|
||||
RCLCPP_ERROR(logger_, "%s NOT a video stream", __FUNCTION__);
|
||||
@@ -878,6 +891,51 @@ void OBCameraNode::getLdpStatusCallback(const std::shared_ptr<GetBool::Request>&
|
||||
}
|
||||
}
|
||||
|
||||
void OBCameraNode::setPtpConfigCallback(
|
||||
const std::shared_ptr<rmw_request_id_t>& requst_header,
|
||||
const std::shared_ptr<std_srvs::srv::SetBool::Request>& request,
|
||||
std::shared_ptr<std_srvs::srv::SetBool::Response>& response) {
|
||||
(void)request_header;
|
||||
|
||||
try {
|
||||
if (!device_->isPropertySupported(OB_DEVICE_PTP_CLOCK_SYNC_ENABLE_BOOL,
|
||||
OB_PERMISSION_READ_WRITE)) {
|
||||
response->success = false;
|
||||
RCLCPP_ERROR(logger_, "OB_DEVICE_PTP_CLOCK_SYNC_ENABLE_BOOL not supported or not writable");
|
||||
return;
|
||||
}
|
||||
device_->setBoolProperty(OB_DEVICE_PTP_CLOCK_SYNC_ENABLE_BOOL, request->data);
|
||||
response->success = true;
|
||||
} catch (const ob::Error& e) {
|
||||
response->success = false;
|
||||
response->message = e.getMessage();
|
||||
} catch (const std::exception& e) {
|
||||
response->success = false;
|
||||
response->message = e.what();
|
||||
} catch (...) {
|
||||
response->success = false;
|
||||
response->message = "unknown error";
|
||||
}
|
||||
}
|
||||
|
||||
void OBCameraNode::getPtpConfigCallback(const std::shared_ptr<GetBool::Request>& request,
|
||||
std::shared_ptr<GetBool::Response>& response) {
|
||||
(void)request;
|
||||
try {
|
||||
response->data = device_->getBoolProperty(OB_DEVICE_PTP_CLOCK_SYNC_ENABLE_BOOL);
|
||||
response->success = true;
|
||||
} catch (const ob::Error& e) {
|
||||
response->message = e.getMessage();
|
||||
response->success = false;
|
||||
} catch (const std::exception& e) {
|
||||
response->message = e.what();
|
||||
response->success = false;
|
||||
} catch (...) {
|
||||
response->message = "unknown error";
|
||||
response->success = false;
|
||||
}
|
||||
}
|
||||
|
||||
void OBCameraNode::getLrmMeasureDistanceCallback(const std::shared_ptr<GetInt32::Request>& request,
|
||||
std::shared_ptr<GetInt32::Response>& response) {
|
||||
(void)request;
|
||||
|
||||
Reference in New Issue
Block a user