mirror of
https://github.com/orbbec/OrbbecSDK_ROS2.git
synced 2026-09-10 18:30:20 +08:00
fixed set params
This commit is contained in:
@@ -380,21 +380,25 @@ void OBCameraNode::setupDevices() {
|
||||
}
|
||||
}
|
||||
|
||||
if (device_->isPropertySupported(OB_PROP_COLOR_AE_MAX_EXPOSURE_INT, OB_PERMISSION_WRITE)) {
|
||||
if (color_ae_max_exposure_ != -1 &&
|
||||
device_->isPropertySupported(OB_PROP_COLOR_AE_MAX_EXPOSURE_INT, OB_PERMISSION_WRITE)) {
|
||||
RCLCPP_INFO_STREAM(logger_, "Setting color AE max exposure to " << color_ae_max_exposure_);
|
||||
TRY_TO_SET_PROPERTY(setIntProperty, OB_PROP_COLOR_AE_MAX_EXPOSURE_INT, color_ae_max_exposure_);
|
||||
}
|
||||
if (device_->isPropertySupported(OB_PROP_COLOR_BRIGHTNESS_INT, OB_PERMISSION_WRITE)) {
|
||||
if (color_brightness_ != -1 &&
|
||||
device_->isPropertySupported(OB_PROP_COLOR_BRIGHTNESS_INT, OB_PERMISSION_WRITE)) {
|
||||
RCLCPP_INFO_STREAM(logger_, "Setting color brightness to " << color_brightness_);
|
||||
TRY_TO_SET_PROPERTY(setIntProperty, OB_PROP_COLOR_BRIGHTNESS_INT, color_brightness_);
|
||||
}
|
||||
// ir ae max
|
||||
if (device_->isPropertySupported(OB_PROP_IR_AE_MAX_EXPOSURE_INT, OB_PERMISSION_WRITE)) {
|
||||
// ir ae max
|
||||
if (ir_ae_max_exposure_ != -1 &&
|
||||
device_->isPropertySupported(OB_PROP_IR_AE_MAX_EXPOSURE_INT, OB_PERMISSION_WRITE)) {
|
||||
RCLCPP_INFO_STREAM(logger_, "Setting IR AE max exposure to " << ir_ae_max_exposure_);
|
||||
TRY_TO_SET_PROPERTY(setIntProperty, OB_PROP_IR_AE_MAX_EXPOSURE_INT, ir_ae_max_exposure_);
|
||||
}
|
||||
// ir brightness
|
||||
if (device_->isPropertySupported(OB_PROP_IR_BRIGHTNESS_INT, OB_PERMISSION_WRITE)) {
|
||||
if (ir_brightness_ != -1 &&
|
||||
device_->isPropertySupported(OB_PROP_IR_BRIGHTNESS_INT, OB_PERMISSION_WRITE)) {
|
||||
RCLCPP_INFO_STREAM(logger_, "Setting IR brightness to " << ir_brightness_);
|
||||
TRY_TO_SET_PROPERTY(setIntProperty, OB_PROP_IR_BRIGHTNESS_INT, ir_brightness_);
|
||||
}
|
||||
@@ -546,14 +550,14 @@ void OBCameraNode::setupDepthPostProcessFilter() {
|
||||
} else if (filter_name == "NoiseRemovalFilter" && enable_noise_removal_filter_) {
|
||||
auto noise_removal_filter = filter->as<ob::NoiseRemovalFilter>();
|
||||
OBNoiseRemovalFilterParams params = noise_removal_filter->getFilterParams();
|
||||
RCLCPP_INFO_STREAM(logger_, "Default noise removal filter params: "
|
||||
<< "disp_diff: " << params.disp_diff
|
||||
<< ", max_size: " << params.max_size);
|
||||
RCLCPP_INFO_STREAM(
|
||||
logger_, "Default noise removal filter params: " << "disp_diff: " << params.disp_diff
|
||||
<< ", max_size: " << params.max_size);
|
||||
params.disp_diff = noise_removal_filter_min_diff_;
|
||||
params.max_size = noise_removal_filter_max_size_;
|
||||
RCLCPP_INFO_STREAM(logger_, "Set noise removal filter params: "
|
||||
<< "disp_diff: " << params.disp_diff
|
||||
<< ", max_size: " << params.max_size);
|
||||
RCLCPP_INFO_STREAM(logger_,
|
||||
"Set noise removal filter params: " << "disp_diff: " << params.disp_diff
|
||||
<< ", max_size: " << params.max_size);
|
||||
if (noise_removal_filter_min_diff_ != -1 && noise_removal_filter_max_size_ != -1) {
|
||||
noise_removal_filter->setFilterParams(params);
|
||||
}
|
||||
@@ -562,11 +566,11 @@ void OBCameraNode::setupDepthPostProcessFilter() {
|
||||
hdr_merge_gain_2_ != -1) {
|
||||
auto hdr_merge_filter = filter->as<ob::HdrMerge>();
|
||||
hdr_merge_filter->enable(true);
|
||||
RCLCPP_INFO_STREAM(logger_, "Set HDR merge filter params: "
|
||||
<< "exposure_1: " << hdr_merge_exposure_1_
|
||||
<< ", gain_1: " << hdr_merge_gain_1_
|
||||
<< ", exposure_2: " << hdr_merge_exposure_2_
|
||||
<< ", gain_2: " << hdr_merge_gain_2_);
|
||||
RCLCPP_INFO_STREAM(
|
||||
logger_, "Set HDR merge filter params: " << "exposure_1: " << hdr_merge_exposure_1_
|
||||
<< ", gain_1: " << hdr_merge_gain_1_
|
||||
<< ", exposure_2: " << hdr_merge_exposure_2_
|
||||
<< ", gain_2: " << hdr_merge_gain_2_);
|
||||
auto config = OBHdrConfig();
|
||||
config.enable = true;
|
||||
config.exposure_1 = hdr_merge_exposure_1_;
|
||||
@@ -649,10 +653,10 @@ void OBCameraNode::setupProfiles() {
|
||||
throw std::runtime_error("Failed cast profile to VideoStreamProfile");
|
||||
}
|
||||
RCLCPP_DEBUG_STREAM(
|
||||
logger_, "Sensor profile: "
|
||||
<< "stream_type: " << magic_enum::enum_name(profile->type())
|
||||
<< "Format: " << profile->format() << ", Width: " << profile->width()
|
||||
<< ", Height: " << profile->height() << ", FPS: " << profile->fps());
|
||||
logger_,
|
||||
"Sensor profile: " << "stream_type: " << magic_enum::enum_name(profile->type())
|
||||
<< "Format: " << profile->format() << ", Width: " << profile->width()
|
||||
<< ", Height: " << profile->height() << ", FPS: " << profile->fps());
|
||||
supported_profiles_[elem].emplace_back(profile);
|
||||
}
|
||||
std::shared_ptr<ob::VideoStreamProfile> selected_profile;
|
||||
@@ -1383,7 +1387,7 @@ void OBCameraNode::publishDepthPointCloud(const std::shared_ptr<ob::FrameSet> &f
|
||||
return;
|
||||
}
|
||||
std::lock_guard<decltype(point_cloud_mutex_)> point_cloud_msg_lock(point_cloud_mutex_);
|
||||
if(!depth_frame_) {
|
||||
if (!depth_frame_) {
|
||||
RCLCPP_ERROR_STREAM(logger_, "depth frame is null");
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user