add soft filter max diff

This commit is contained in:
Joe Dong
2023-03-24 14:57:33 +08:00
parent ed8898cd47
commit 5ceb870714
4 changed files with 27 additions and 3 deletions
+5 -3
View File
@@ -11,10 +11,12 @@ int main() {
std::cout << "Current device not support depth work mode!" << std::endl;
return -1;
}
auto depthModeList = device->getDepthWorkModeList();
auto current_depth_mode = device->getCurrentDepthWorkMode();
std::cout << "current depth mode: " << current_depth_mode.name << std::endl;
auto depth_mode_list = device->getDepthWorkModeList();
std::cout << "depth mode list: " << std::endl;
for (uint32_t i = 0; i < depthModeList->count(); i++) {
std::cout << "depthModeList[" << i << "]: " << (*depthModeList)[i].name;
for (uint32_t i = 0; i < depth_mode_list->count(); i++) {
std::cout << "depth_mode_list[" << i << "]: " << (*depth_mode_list)[i].name;
std::cout << std::endl;
}
+13
View File
@@ -122,6 +122,16 @@ void OBCameraNode::setupDevices() {
device_->setBoolProperty(OB_PROP_DEPTH_SOFT_FILTER_BOOL, enable_soft_filter_);
device_->setBoolProperty(OB_PROP_COLOR_AUTO_EXPOSURE_BOOL, enable_color_auto_exposure_);
device_->setBoolProperty(OB_PROP_IR_AUTO_EXPOSURE_BOOL, enable_ir_auto_exposure_);
auto default_soft_filter_max_diff = device_->getIntProperty(OB_PROP_DEPTH_MAX_DIFF_INT);
if (soft_filter_max_diff_ != -1 && default_soft_filter_max_diff != soft_filter_max_diff_) {
device_->setIntProperty(OB_PROP_DEPTH_MAX_DIFF_INT, soft_filter_max_diff_);
}
auto default_soft_filter_speckle_size =
device_->getIntProperty(OB_PROP_DEPTH_MAX_SPECKLE_SIZE_INT);
if (soft_filter_speckle_size_ != -1 &&
default_soft_filter_speckle_size != soft_filter_speckle_size_) {
device_->setIntProperty(OB_PROP_DEPTH_MAX_SPECKLE_SIZE_INT, soft_filter_speckle_size_);
}
} catch (const ob::Error& e) {
RCLCPP_ERROR_STREAM(logger_, "Failed to setup devices: " << e.getMessage());
} catch (const std::exception& e) {
@@ -306,6 +316,9 @@ void OBCameraNode::getParameters() {
if (enable_colored_point_cloud_) {
depth_registration_ = true;
}
setAndGetNodeParameter<bool>(enable_ldp_, "enable_ldp", true);
setAndGetNodeParameter<int>(soft_filter_max_diff_, "soft_filter_max_diff", -1);
setAndGetNodeParameter<int>(soft_filter_speckle_size_, "soft_filter_speckle_size", -1);
}
void OBCameraNode::setupTopics() {