Update Orbbec SDK to version 2.4.10 and modify related configurations

- Updated the OrbbecSDKConfig-release.cmake files for both arm64 and x64 architectures to reference the new SDK version 2.4.10.
- Replaced occurrences of 'depth_brightness' with 'mean_intensity_set_point' in launch files and the camera node header to improve clarity and consistency.
- Added new spatial filtering options (SpatialFastFilter and SpatialModerateFilter) in the camera node implementation, including parameters for radius, magnitude, and difference threshold.
- Updated the setupDevices and setupDepthPostProcessFilter methods to handle the new mean intensity setting and spatial filter parameters.
- Modified launch files for various examples to reflect the new argument names and added new parameters for spatial filtering.
This commit is contained in:
yalian
2025-08-02 00:11:04 +08:00
parent ba9cbc2295
commit d4bbdb4459
31 changed files with 1093 additions and 863 deletions
+4 -3
View File
@@ -382,9 +382,10 @@ ros2 launch orbbec_camera gemini_330_series.launch.py enable_color:=true color_w
* **enable_depth_auto_exposure_priority** * **enable_depth_auto_exposure_priority**
* Enable the Depth auto exposure priority * Enable the Depth auto exposure priority
* For example:`enable_depth_auto_exposure_priority:=true` * For example:`enable_depth_auto_exposure_priority:=true`
* **depth_brightness** * **mean_intensity_set_point**
* Set the Depth brightness * Set the target mean intensity of the Depth image
* For example:`depth_brightness:=100` * For example: `mean_intensity_set_point:=100`
* **Note:** This parameter replaces the deprecated `depth_brightness`.
[......](./docs/launch_parameters.md) [......](./docs/launch_parameters.md)
@@ -299,6 +299,14 @@ ros2 service call /camera/set_filter orbbec_camera_msgs/srv/SetFilter '{filter_
#set HardwareNoiseRemoval #set HardwareNoiseRemoval
ros2 service call /camera/set_filter orbbec_camera_msgs/srv/SetFilter '{filter_name: HardwareNoiseRemoval,filter_enable: true,filter_param: []}' ros2 service call /camera/set_filter orbbec_camera_msgs/srv/SetFilter '{filter_name: HardwareNoiseRemoval,filter_enable: true,filter_param: []}'
# Set SpatialFastFilter
# filter_param: [radius]
ros2 service call /camera/set_filter orbbec_camera_msgs/srv/SetFilter '{filter_name: SpatialFastFilter, filter_enable: true, filter_param: [4]}'
# Set SpatialModerateFilter
# filter_param: [disp_diff, magnitude, radius, ]
ros2 service call /camera/set_filter orbbec_camera_msgs/srv/SetFilter '{filter_name: SpatialModerateFilter, filter_enable: true, filter_param: [160,1,3]}'
``` ```
* `/camera/set_floor_enable` * `/camera/set_floor_enable`
+7 -2
View File
@@ -78,8 +78,9 @@ The following are the launch parameters available:
* Set the Color decimation filter scale * Set the Color decimation filter scale
* **enable_depth_auto_exposure_priority** * **enable_depth_auto_exposure_priority**
* Enable the Depth auto exposure priority * Enable the Depth auto exposure priority
* **depth_brightness** * **mean_intensity_set_point**
* Set the Depth brightness * Set the target mean intensity of the Depth image
* **Note:** This parameter replaces the deprecated `depth_brightness`.
* **enable_ir_auto_exposure** * **enable_ir_auto_exposure**
* Enable the IR auto exposure * Enable the IR auto exposure
* **ir_exposure** * **ir_exposure**
@@ -185,6 +186,10 @@ The following are the launch parameters available:
* Enable the Depth temporal filter.The Depth temporal filter setting parameter is `temporal_filter_diff_threshold`,`temporal_filter_weight` * Enable the Depth temporal filter.The Depth temporal filter setting parameter is `temporal_filter_diff_threshold`,`temporal_filter_weight`
* **enable_hole_filling_filter** * **enable_hole_filling_filter**
* Enable the Depth hole filling filter.The Depth hole filling filter setting parameter is `hole_filling_filter_mode` * Enable the Depth hole filling filter.The Depth hole filling filter setting parameter is `hole_filling_filter_mode`
* **enable_spatial_fast_filter**
- Enable the Depth spatial fast filter. The Depth spatial fast filter setting parameter is `spatial_fast_filter_radius`.
* **enable_spatial_moderate_filter**
- Enable the Depth spatial moderate filter. The Depth spatial moderate filter setting parameters are `spatial_moderate_filter_diff_threshold`, `spatial_moderate_filter_magnitude`, `spatial_moderate_filter_radius`.
* **align_mode** * **align_mode**
* The alignment mode to be used. Options are `HW` for hardware alignment and `SW` for software alignment * The alignment mode to be used. Options are `HW` for hardware alignment and `SW` for software alignment
* **align_target_stream** * **align_target_stream**
@@ -88,7 +88,7 @@ OB_EXPORT ob_depth_work_mode ob_depth_work_mode_list_get_item(const ob_depth_wor
OB_EXPORT void ob_delete_depth_work_mode_list(ob_depth_work_mode_list *work_mode_list, ob_error **error); OB_EXPORT void ob_delete_depth_work_mode_list(ob_depth_work_mode_list *work_mode_list, ob_error **error);
/** /**
* @breif Get the current preset name. * @brief Get the current preset name.
* @brief The preset mean a set of parameters or configurations that can be applied to the device to achieve a specific effect or function. * @brief The preset mean a set of parameters or configurations that can be applied to the device to achieve a specific effect or function.
* *
* @param device The device object. * @param device The device object.
@@ -273,7 +273,7 @@ OB_EXPORT bool ob_device_frame_interleave_list_has_frame_interleave(ob_device_fr
* *
* @param device The device object. * @param device The device object.
* @param error Log error messages. * @param error Log error messages.
* @return The available frame interleave list. * @return The available frame resolution config list.
* *
*/ */
OB_EXPORT ob_preset_resolution_config_list *ob_device_get_available_preset_resolution_config_list(ob_device *device, ob_error **error); OB_EXPORT ob_preset_resolution_config_list *ob_device_get_available_preset_resolution_config_list(ob_device *device, ob_error **error);
@@ -294,7 +294,7 @@ OB_EXPORT uint32_t ob_device_preset_resolution_config_get_count(ob_preset_resolu
* @param error Log error messages. * @param error Log error messages.
* @return The preset resolution in the preset resolution list. * @return The preset resolution in the preset resolution list.
*/ */
OB_EXPORT OBPresetResolutionConfig ob_device_preset_resolution_config_list_get_item(const ob_preset_resolution_config_list *ob_preset_resolution_config_lis, OB_EXPORT OBPresetResolutionConfig ob_device_preset_resolution_config_list_get_item(const ob_preset_resolution_config_list *ob_preset_resolution_config_list,
uint32_t index, ob_error **error); uint32_t index, ob_error **error);
/** /**
@@ -247,7 +247,7 @@ OB_EXPORT ob_filter_config_schema_item ob_filter_config_schema_list_get_item(con
/** /**
* @brief Set the align to stream profile for the align filter. * @brief Set the align to stream profile for the align filter.
* @breif It is useful when the align target stream dose not started (without any frame to get intrinsics and extrinsics). * @brief It is useful when the align target stream dose not started (without any frame to get intrinsics and extrinsics).
* *
* @param filter A filter object. * @param filter A filter object.
* @param align_to_stream_profile The align target stream profile. * @param align_to_stream_profile The align target stream profile.
@@ -1010,6 +1010,16 @@ typedef enum {
} OBHoleFillingMode, } OBHoleFillingMode,
ob_hole_filling_mode; ob_hole_filling_mode;
typedef struct {
uint8_t radius; // window_size
} OBSpatialFastFilterParams, ob_spatial_fast_filter_params;
typedef struct {
uint8_t radius; // window_size
uint8_t magnitude; // magnitude
uint16_t disp_diff; // smooth_delta
} OBSpatialModerateFilterParams, ob_spatial_moderate_filter_params;
typedef struct { typedef struct {
uint8_t magnitude; // magnitude uint8_t magnitude; // magnitude
float alpha; // smooth_alpha float alpha; // smooth_alpha
@@ -30,7 +30,7 @@ class DevicePresetList;
class OBDepthWorkModeList; class OBDepthWorkModeList;
class CameraParamList; class CameraParamList;
class DeviceFrameInterleaveList; class DeviceFrameInterleaveList;
class PresetResolutionConfigeList; class PresetResolutionConfigList;
class Device { class Device {
public: public:
@@ -824,15 +824,15 @@ public:
} }
/** /**
* @brief Get available frame interleave list * @brief Get the available preset resolution config list
* *
* @return DeviceFrameInterleaveList return the available frame interleave list. * @return PresetResolutionConfigList return the available preset resolution config list.
*/ */
std::shared_ptr<PresetResolutionConfigeList> getAvailablePresetResolutionConfigeList() const { std::shared_ptr<PresetResolutionConfigList> getAvailablePresetResolutionConfigList() const {
ob_error *error = nullptr; ob_error *error = nullptr;
auto list = ob_device_get_available_preset_resolution_config_list(impl_, &error); auto list = ob_device_get_available_preset_resolution_config_list(impl_, &error);
Error::handle(&error); Error::handle(&error);
return std::make_shared<PresetResolutionConfigeList>(list); return std::make_shared<PresetResolutionConfigList>(list);
} }
private: private:
@@ -1516,15 +1516,15 @@ public:
}; };
/** /**
* @brief Class representing a list of device Frame Interleave * @brief Class representing a list of preset resolution config list
*/ */
class PresetResolutionConfigeList { class PresetResolutionConfigList {
private: private:
ob_preset_resolution_config_list_t *impl_ = nullptr; ob_preset_resolution_config_list_t *impl_ = nullptr;
public: public:
explicit PresetResolutionConfigeList(ob_preset_resolution_config_list_t *impl) : impl_(impl) {} explicit PresetResolutionConfigList(ob_preset_resolution_config_list_t *impl) : impl_(impl) {}
~PresetResolutionConfigeList() noexcept { ~PresetResolutionConfigList() noexcept {
ob_error *error = nullptr; ob_error *error = nullptr;
ob_delete_preset_resolution_config_list(impl_, &error); ob_delete_preset_resolution_config_list(impl_, &error);
Error::handle(&error, false); Error::handle(&error, false);
File diff suppressed because it is too large Load Diff
@@ -8,12 +8,12 @@ set(CMAKE_IMPORT_FILE_VERSION 1)
# Import target "ob::OrbbecSDK" for configuration "Release" # Import target "ob::OrbbecSDK" for configuration "Release"
set_property(TARGET ob::OrbbecSDK APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE) set_property(TARGET ob::OrbbecSDK APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)
set_target_properties(ob::OrbbecSDK PROPERTIES set_target_properties(ob::OrbbecSDK PROPERTIES
IMPORTED_LOCATION_RELEASE "${_IMPORT_PREFIX}/lib/libOrbbecSDK.so.2.4.8" IMPORTED_LOCATION_RELEASE "${_IMPORT_PREFIX}/lib/libOrbbecSDK.so.2.4.10"
IMPORTED_SONAME_RELEASE "libOrbbecSDK.so.2" IMPORTED_SONAME_RELEASE "libOrbbecSDK.so.2"
) )
list(APPEND _cmake_import_check_targets ob::OrbbecSDK ) list(APPEND _cmake_import_check_targets ob::OrbbecSDK )
list(APPEND _cmake_import_check_files_for_ob::OrbbecSDK "${_IMPORT_PREFIX}/lib/libOrbbecSDK.so.2.4.8" ) list(APPEND _cmake_import_check_files_for_ob::OrbbecSDK "${_IMPORT_PREFIX}/lib/libOrbbecSDK.so.2.4.10" )
# Commands beyond this point should not need to know the version. # Commands beyond this point should not need to know the version.
set(CMAKE_IMPORT_FILE_VERSION) set(CMAKE_IMPORT_FILE_VERSION)
@@ -1 +1 @@
libOrbbecSDK.so.2.4.8 libOrbbecSDK.so.2.4.10
@@ -8,12 +8,12 @@ set(CMAKE_IMPORT_FILE_VERSION 1)
# Import target "ob::OrbbecSDK" for configuration "Release" # Import target "ob::OrbbecSDK" for configuration "Release"
set_property(TARGET ob::OrbbecSDK APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE) set_property(TARGET ob::OrbbecSDK APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)
set_target_properties(ob::OrbbecSDK PROPERTIES set_target_properties(ob::OrbbecSDK PROPERTIES
IMPORTED_LOCATION_RELEASE "${_IMPORT_PREFIX}/lib/libOrbbecSDK.so.2.4.8" IMPORTED_LOCATION_RELEASE "${_IMPORT_PREFIX}/lib/libOrbbecSDK.so.2.4.10"
IMPORTED_SONAME_RELEASE "libOrbbecSDK.so.2" IMPORTED_SONAME_RELEASE "libOrbbecSDK.so.2"
) )
list(APPEND _cmake_import_check_targets ob::OrbbecSDK ) list(APPEND _cmake_import_check_targets ob::OrbbecSDK )
list(APPEND _cmake_import_check_files_for_ob::OrbbecSDK "${_IMPORT_PREFIX}/lib/libOrbbecSDK.so.2.4.8" ) list(APPEND _cmake_import_check_files_for_ob::OrbbecSDK "${_IMPORT_PREFIX}/lib/libOrbbecSDK.so.2.4.10" )
# Commands beyond this point should not need to know the version. # Commands beyond this point should not need to know the version.
set(CMAKE_IMPORT_FILE_VERSION) set(CMAKE_IMPORT_FILE_VERSION)
+1 -1
View File
@@ -1 +1 @@
libOrbbecSDK.so.2.4.8 libOrbbecSDK.so.2.4.10
@@ -115,7 +115,7 @@ def generate_launch_description():
DeclareLaunchArgument('depth_ae_roi_right', default_value='-1'), DeclareLaunchArgument('depth_ae_roi_right', default_value='-1'),
DeclareLaunchArgument('depth_ae_roi_top', default_value='-1'), DeclareLaunchArgument('depth_ae_roi_top', default_value='-1'),
DeclareLaunchArgument('depth_ae_roi_bottom', default_value='-1'), DeclareLaunchArgument('depth_ae_roi_bottom', default_value='-1'),
DeclareLaunchArgument('depth_brightness', default_value='-1'), DeclareLaunchArgument('mean_intensity_set_point', default_value='-1'),
DeclareLaunchArgument('left_ir_width', default_value='0'), DeclareLaunchArgument('left_ir_width', default_value='0'),
DeclareLaunchArgument('left_ir_height', default_value='0'), DeclareLaunchArgument('left_ir_height', default_value='0'),
DeclareLaunchArgument('left_ir_fps', 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_right', default_value='-1'),
DeclareLaunchArgument('depth_ae_roi_top', default_value='-1'), DeclareLaunchArgument('depth_ae_roi_top', default_value='-1'),
DeclareLaunchArgument('depth_ae_roi_bottom', default_value='-1'), DeclareLaunchArgument('depth_ae_roi_bottom', default_value='-1'),
DeclareLaunchArgument('depth_brightness', default_value='-1'), DeclareLaunchArgument('mean_intensity_set_point', default_value='-1'),
DeclareLaunchArgument('left_ir_width', default_value='0'), DeclareLaunchArgument('left_ir_width', default_value='0'),
DeclareLaunchArgument('left_ir_height', default_value='0'), DeclareLaunchArgument('left_ir_height', default_value='0'),
DeclareLaunchArgument('left_ir_fps', 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_right', default_value='-1'),
DeclareLaunchArgument('depth_ae_roi_top', default_value='-1'), DeclareLaunchArgument('depth_ae_roi_top', default_value='-1'),
DeclareLaunchArgument('depth_ae_roi_bottom', default_value='-1'), DeclareLaunchArgument('depth_ae_roi_bottom', default_value='-1'),
DeclareLaunchArgument('depth_brightness', default_value='-1'), DeclareLaunchArgument('mean_intensity_set_point', default_value='-1'),
DeclareLaunchArgument('left_ir_width', default_value='0'), DeclareLaunchArgument('left_ir_width', default_value='0'),
DeclareLaunchArgument('left_ir_height', default_value='0'), DeclareLaunchArgument('left_ir_height', default_value='0'),
DeclareLaunchArgument('left_ir_fps', default_value='0'), DeclareLaunchArgument('left_ir_fps', default_value='0'),
@@ -566,7 +566,7 @@ class OBCameraNode {
int depth_ae_roi_top_ = -1; int depth_ae_roi_top_ = -1;
int depth_ae_roi_right_ = -1; int depth_ae_roi_right_ = -1;
int depth_ae_roi_bottom_ = -1; int depth_ae_roi_bottom_ = -1;
int depth_brightness_ = -1; int mean_intensity_set_point_ = -1;
int ir_exposure_ = -1; int ir_exposure_ = -1;
int ir_gain_ = -1; int ir_gain_ = -1;
int ir_ae_max_exposure_ = -1; int ir_ae_max_exposure_ = -1;
@@ -631,6 +631,8 @@ class OBCameraNode {
bool enable_spatial_filter_ = true; bool enable_spatial_filter_ = true;
bool enable_temporal_filter_ = false; bool enable_temporal_filter_ = false;
bool enable_hole_filling_filter_ = false; bool enable_hole_filling_filter_ = false;
bool enable_spatial_fast_filter_ = false;
bool enable_spatial_moderate_filter_ = false;
// filter params // filter params
int decimation_filter_scale_ = -1; int decimation_filter_scale_ = -1;
int sequence_id_filter_id_ = -1; int sequence_id_filter_id_ = -1;
@@ -653,7 +655,10 @@ class OBCameraNode {
int gmsl_trigger_fd_ = -1; int gmsl_trigger_fd_ = -1;
int gmsl_trigger_fps_ = -1; int gmsl_trigger_fps_ = -1;
bool enable_gmsl_trigger_ = false; bool enable_gmsl_trigger_ = false;
int spatial_fast_filter_radius_ = -1;
int spatial_moderate_filter_radius_ = -1;
int spatial_moderate_filter_diff_threshold_ = -1;
int spatial_moderate_filter_magnitude_ = -1;
rclcpp::Publisher<std_msgs::msg::String>::SharedPtr filter_status_pub_; rclcpp::Publisher<std_msgs::msg::String>::SharedPtr filter_status_pub_;
nlohmann::json filter_status_; nlohmann::json filter_status_;
std::string align_mode_ = "HW"; std::string align_mode_ = "HW";
+1 -1
View File
@@ -96,7 +96,7 @@ def generate_launch_description():
DeclareLaunchArgument('depth_camera_info_qos', default_value='default'), DeclareLaunchArgument('depth_camera_info_qos', default_value='default'),
DeclareLaunchArgument('enable_depth_auto_exposure_priority', default_value='false'), DeclareLaunchArgument('enable_depth_auto_exposure_priority', default_value='false'),
DeclareLaunchArgument('depth_precision', default_value=''), DeclareLaunchArgument('depth_precision', default_value=''),
DeclareLaunchArgument('depth_brightness', default_value='-1'), DeclareLaunchArgument('mean_intensity_set_point', default_value='-1'),
DeclareLaunchArgument('left_ir_width', default_value='0'), DeclareLaunchArgument('left_ir_width', default_value='0'),
DeclareLaunchArgument('left_ir_height', default_value='0'), DeclareLaunchArgument('left_ir_height', default_value='0'),
DeclareLaunchArgument('left_ir_fps', default_value='0'), DeclareLaunchArgument('left_ir_fps', default_value='0'),
+1 -1
View File
@@ -96,7 +96,7 @@ def generate_launch_description():
DeclareLaunchArgument('depth_camera_info_qos', default_value='default'), DeclareLaunchArgument('depth_camera_info_qos', default_value='default'),
DeclareLaunchArgument('enable_depth_auto_exposure_priority', default_value='false'), DeclareLaunchArgument('enable_depth_auto_exposure_priority', default_value='false'),
DeclareLaunchArgument('depth_precision', default_value=''), DeclareLaunchArgument('depth_precision', default_value=''),
DeclareLaunchArgument('depth_brightness', default_value='-1'), DeclareLaunchArgument('mean_intensity_set_point', default_value='-1'),
DeclareLaunchArgument('left_ir_width', default_value='0'), DeclareLaunchArgument('left_ir_width', default_value='0'),
DeclareLaunchArgument('left_ir_height', default_value='0'), DeclareLaunchArgument('left_ir_height', default_value='0'),
DeclareLaunchArgument('left_ir_fps', default_value='0'), DeclareLaunchArgument('left_ir_fps', default_value='0'),
+1 -1
View File
@@ -113,7 +113,7 @@ def generate_launch_description():
DeclareLaunchArgument('depth_ae_roi_right', default_value='-1'), DeclareLaunchArgument('depth_ae_roi_right', default_value='-1'),
DeclareLaunchArgument('depth_ae_roi_top', default_value='-1'), DeclareLaunchArgument('depth_ae_roi_top', default_value='-1'),
DeclareLaunchArgument('depth_ae_roi_bottom', default_value='-1'), DeclareLaunchArgument('depth_ae_roi_bottom', default_value='-1'),
DeclareLaunchArgument('depth_brightness', default_value='-1'), DeclareLaunchArgument('mean_intensity_set_point', default_value='-1'),
DeclareLaunchArgument('left_ir_width', default_value='0'), DeclareLaunchArgument('left_ir_width', default_value='0'),
DeclareLaunchArgument('left_ir_height', default_value='0'), DeclareLaunchArgument('left_ir_height', default_value='0'),
DeclareLaunchArgument('left_ir_fps', 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_right', default_value='-1'),
DeclareLaunchArgument('depth_ae_roi_top', default_value='-1'), DeclareLaunchArgument('depth_ae_roi_top', default_value='-1'),
DeclareLaunchArgument('depth_ae_roi_bottom', default_value='-1'), DeclareLaunchArgument('depth_ae_roi_bottom', default_value='-1'),
DeclareLaunchArgument('depth_brightness', default_value='-1'), DeclareLaunchArgument('mean_intensity_set_point', default_value='-1'),
DeclareLaunchArgument('left_ir_width', default_value='0'), DeclareLaunchArgument('left_ir_width', default_value='0'),
DeclareLaunchArgument('left_ir_height', default_value='0'), DeclareLaunchArgument('left_ir_height', default_value='0'),
DeclareLaunchArgument('left_ir_fps', default_value='0'), DeclareLaunchArgument('left_ir_fps', default_value='0'),
@@ -195,6 +195,8 @@ def generate_launch_description():
DeclareLaunchArgument('enable_temporal_filter', default_value='false'), DeclareLaunchArgument('enable_temporal_filter', default_value='false'),
DeclareLaunchArgument('enable_disaparity_to_depth', default_value='true'), DeclareLaunchArgument('enable_disaparity_to_depth', default_value='true'),
DeclareLaunchArgument('enable_hole_filling_filter', default_value='false'), DeclareLaunchArgument('enable_hole_filling_filter', default_value='false'),
DeclareLaunchArgument('enable_spatial_fast_filter', default_value='false'),
DeclareLaunchArgument('enable_spatial_moderate_filter', default_value='false'),
DeclareLaunchArgument('decimation_filter_scale', default_value='-1'), DeclareLaunchArgument('decimation_filter_scale', default_value='-1'),
DeclareLaunchArgument('sequence_id_filter_id', default_value='-1'), DeclareLaunchArgument('sequence_id_filter_id', default_value='-1'),
DeclareLaunchArgument('threshold_filter_max', default_value='-1'), DeclareLaunchArgument('threshold_filter_max', default_value='-1'),
@@ -213,6 +215,10 @@ def generate_launch_description():
DeclareLaunchArgument('hdr_merge_gain_1', default_value='-1'), DeclareLaunchArgument('hdr_merge_gain_1', default_value='-1'),
DeclareLaunchArgument('hdr_merge_exposure_2', default_value='-1'), DeclareLaunchArgument('hdr_merge_exposure_2', default_value='-1'),
DeclareLaunchArgument('hdr_merge_gain_2', default_value='-1'), DeclareLaunchArgument('hdr_merge_gain_2', default_value='-1'),
DeclareLaunchArgument('spatial_fast_filter_radius', default_value='-1'),
DeclareLaunchArgument('spatial_moderate_filter_diff_threshold', default_value='-1'),
DeclareLaunchArgument('spatial_moderate_filter_magnitude', default_value='-1'),
DeclareLaunchArgument('spatial_moderate_filter_radius', default_value='-1'),
DeclareLaunchArgument('align_mode', default_value='SW'), DeclareLaunchArgument('align_mode', default_value='SW'),
DeclareLaunchArgument('align_target_stream', default_value='COLOR'),# COLOR or DEPTH DeclareLaunchArgument('align_target_stream', default_value='COLOR'),# COLOR or DEPTH
DeclareLaunchArgument('diagnostic_period', default_value='1.0'), DeclareLaunchArgument('diagnostic_period', default_value='1.0'),
@@ -260,8 +266,7 @@ def generate_launch_description():
DeclareLaunchArgument('laser_index0_depth_gain', default_value='16'), DeclareLaunchArgument('laser_index0_depth_gain', default_value='16'),
DeclareLaunchArgument('laser_index0_ir_brightness', default_value='60'), DeclareLaunchArgument('laser_index0_ir_brightness', default_value='60'),
DeclareLaunchArgument('laser_index0_ir_ae_max_exposure', default_value='30000'), DeclareLaunchArgument('laser_index0_ir_ae_max_exposure', default_value='30000'),
DeclareLaunchArgument('show_fps_enable', default_value='false'),
DeclareLaunchArgument('show_fps_enable', default_value='true'),
] ]
def get_params(context, args): def get_params(context, args):
+81 -23
View File
@@ -573,15 +573,15 @@ void OBCameraNode::setupDevices() {
TRY_TO_SET_PROPERTY(setIntProperty, OB_PROP_DEPTH_AUTO_EXPOSURE_PRIORITY_INT, TRY_TO_SET_PROPERTY(setIntProperty, OB_PROP_DEPTH_AUTO_EXPOSURE_PRIORITY_INT,
set_enable_depth_auto_exposure_priority); set_enable_depth_auto_exposure_priority);
} }
if (depth_brightness_ != -1 && if (mean_intensity_set_point_ != -1 &&
device_->isPropertySupported(OB_PROP_IR_BRIGHTNESS_INT, OB_PERMISSION_WRITE)) { device_->isPropertySupported(OB_PROP_IR_BRIGHTNESS_INT, OB_PERMISSION_WRITE)) {
auto range = device_->getIntPropertyRange(OB_PROP_IR_BRIGHTNESS_INT); auto range = device_->getIntPropertyRange(OB_PROP_IR_BRIGHTNESS_INT);
if (depth_brightness_ < range.min || depth_brightness_ > range.max) { if (mean_intensity_set_point_ < range.min || mean_intensity_set_point_ > range.max) {
RCLCPP_ERROR(logger_, "depth brightness value is out of range[%d,%d], please check the value", RCLCPP_ERROR(logger_, "depth brightness value is out of range[%d,%d], please check the value",
range.min, range.max); range.min, range.max);
} else { } else {
RCLCPP_INFO_STREAM(logger_, "Setting depth brightness to " << depth_brightness_); RCLCPP_INFO_STREAM(logger_, "Setting depth brightness to " << mean_intensity_set_point_);
TRY_TO_SET_PROPERTY(setIntProperty, OB_PROP_IR_BRIGHTNESS_INT, depth_brightness_); TRY_TO_SET_PROPERTY(setIntProperty, OB_PROP_IR_BRIGHTNESS_INT, mean_intensity_set_point_);
} }
} }
// ir ae max // ir ae max
@@ -898,6 +898,8 @@ void OBCameraNode::setupDepthPostProcessFilter() {
{"HoleFillingFilter", enable_hole_filling_filter_}, {"HoleFillingFilter", enable_hole_filling_filter_},
{"DisparityTransform", enable_disaparity_to_depth_}, {"DisparityTransform", enable_disaparity_to_depth_},
{"ThresholdFilter", enable_threshold_filter_}, {"ThresholdFilter", enable_threshold_filter_},
{"SpatialFastFilter", enable_spatial_fast_filter_},
{"SpatialModerateFilter", enable_spatial_moderate_filter_},
}; };
std::string filter_name = filter->type(); std::string filter_name = filter->type();
RCLCPP_INFO_STREAM(logger_, "Setting " << filter_name << "......"); RCLCPP_INFO_STREAM(logger_, "Setting " << filter_name << "......");
@@ -979,6 +981,29 @@ void OBCameraNode::setupDepthPostProcessFilter() {
device_->setStructuredData(OB_STRUCT_DEPTH_HDR_CONFIG, device_->setStructuredData(OB_STRUCT_DEPTH_HDR_CONFIG,
reinterpret_cast<const uint8_t *>(&config), sizeof(config)); reinterpret_cast<const uint8_t *>(&config), sizeof(config));
} }
} else if (filter_name == "SpatialFastFilter" && enable_spatial_fast_filter_) {
auto spatial_fast_filter = filter->as<ob::SpatialFastFilter>();
OBSpatialFastFilterParams params{};
if (spatial_fast_filter_radius_ != -1) {
params.radius = spatial_fast_filter_radius_;
RCLCPP_INFO_STREAM(logger_,
"Set SpatialFastFilter radius to " << spatial_fast_filter_radius_);
spatial_fast_filter->setFilterParams(params);
}
} else if (filter_name == "SpatialModerateFilter" && enable_spatial_moderate_filter_) {
auto spatial_moderate_filter = filter->as<ob::SpatialModerateFilter>();
OBSpatialModerateFilterParams params{};
if (spatial_moderate_filter_diff_threshold_ != -1 &&
spatial_moderate_filter_magnitude_ != -1 && spatial_moderate_filter_radius_ != -1) {
params.magnitude = spatial_moderate_filter_magnitude_;
params.radius = spatial_moderate_filter_radius_;
params.disp_diff = spatial_moderate_filter_diff_threshold_;
RCLCPP_INFO_STREAM(logger_, "Set SpatialModerateFilter params: "
<< "magnitude=" << params.magnitude << ", radius="
<< params.radius << ", disp_diff=" << params.disp_diff);
spatial_moderate_filter->setFilterParams(params);
}
} else { } else {
RCLCPP_INFO_STREAM(logger_, "Skip setting filter: " << filter_name); RCLCPP_INFO_STREAM(logger_, "Skip setting filter: " << filter_name);
} }
@@ -1648,7 +1673,7 @@ void OBCameraNode::getParameters() {
setAndGetNodeParameter<int>(depth_ae_roi_top_, "depth_ae_roi_top", -1); 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_right_, "depth_ae_roi_right", -1);
setAndGetNodeParameter<int>(depth_ae_roi_bottom_, "depth_ae_roi_bottom", -1); setAndGetNodeParameter<int>(depth_ae_roi_bottom_, "depth_ae_roi_bottom", -1);
setAndGetNodeParameter<int>(depth_brightness_, "depth_brightness", -1); setAndGetNodeParameter<int>(mean_intensity_set_point_, "mean_intensity_set_point", -1);
setAndGetNodeParameter<std::string>(depth_precision_str_, "depth_precision", ""); setAndGetNodeParameter<std::string>(depth_precision_str_, "depth_precision", "");
setAndGetNodeParameter<bool>(enable_ir_auto_exposure_, "enable_ir_auto_exposure", true); setAndGetNodeParameter<bool>(enable_ir_auto_exposure_, "enable_ir_auto_exposure", true);
setAndGetNodeParameter<int>(ir_exposure_, "ir_exposure", -1); setAndGetNodeParameter<int>(ir_exposure_, "ir_exposure", -1);
@@ -1699,6 +1724,9 @@ void OBCameraNode::getParameters() {
setAndGetNodeParameter<bool>(enable_spatial_filter_, "enable_spatial_filter", false); setAndGetNodeParameter<bool>(enable_spatial_filter_, "enable_spatial_filter", false);
setAndGetNodeParameter<bool>(enable_temporal_filter_, "enable_temporal_filter", false); setAndGetNodeParameter<bool>(enable_temporal_filter_, "enable_temporal_filter", false);
setAndGetNodeParameter<bool>(enable_hole_filling_filter_, "enable_hole_filling_filter", false); setAndGetNodeParameter<bool>(enable_hole_filling_filter_, "enable_hole_filling_filter", false);
setAndGetNodeParameter<bool>(enable_spatial_fast_filter_, "enable_spatial_fast_filter", false);
setAndGetNodeParameter<bool>(enable_spatial_moderate_filter_, "enable_spatial_moderate_filter",
false);
setAndGetNodeParameter<int>(decimation_filter_scale_, "decimation_filter_scale", -1); setAndGetNodeParameter<int>(decimation_filter_scale_, "decimation_filter_scale", -1);
setAndGetNodeParameter<int>(sequence_id_filter_id_, "sequence_id_filter_id", -1); setAndGetNodeParameter<int>(sequence_id_filter_id_, "sequence_id_filter_id", -1);
setAndGetNodeParameter<int>(threshold_filter_max_, "threshold_filter_max", -1); setAndGetNodeParameter<int>(threshold_filter_max_, "threshold_filter_max", -1);
@@ -3688,26 +3716,56 @@ void OBCameraNode::setFilterCallback(const std::shared_ptr<SetFilter ::Request>
"The filter switch setting is successful, but the filter parameter setting fails"; "The filter switch setting is successful, but the filter parameter setting fails";
return; return;
} }
} else { } else if (request->filter_name == "SpatialFastFilter") {
RCLCPP_INFO_STREAM( auto spatial_fast_filter = std::make_shared<ob::SpatialFastFilter>();
logger_, request->filter_name spatial_fast_filter->enable(request->filter_enable);
<< "Cannot be set\n" depth_filter_list_.push_back(spatial_fast_filter);
<< "The filter_name value that can be set is " if (request->filter_param.size() > 0) {
"DecimationFilter, HDRMerge, SequenceIdFilter, ThresholdFilter, Nois" OBSpatialFastFilterParams params{};
"eRemovalFilter, SpatialAdvancedFilter and TemporalFilter"); params.radius = request->filter_param[0];
return; spatial_fast_filter->setFilterParams(params);
} RCLCPP_INFO_STREAM(logger_, "Set SpatialFastFilter radius to " << params.radius);
for (auto &filter : depth_filter_list_) { } else {
std::cout << " - " << filter->getName() << ": " response->message =
<< (filter->isEnabled() ? "enabled" : "disabled") << std::endl; "The filter switch setting is successful, but the filter parameter setting fails";
auto configSchemaVec = filter->getConfigSchemaVec(); return;
for (auto &configSchema : configSchemaVec) {
std::cout << " - {" << configSchema.name << ", " << configSchema.type << ", "
<< configSchema.min << ", " << configSchema.max << ", " << configSchema.step
<< ", " << configSchema.def << ", " << configSchema.desc << "}" << std::endl;
} }
} else if (request->filter_name == "SpatialModerateFilter") {
auto spatial_moderate_filter = std::make_shared<ob::SpatialModerateFilter>();
spatial_moderate_filter->enable(request->filter_enable);
depth_filter_list_.push_back(spatial_moderate_filter);
if (request->filter_param.size() > 2) {
OBSpatialModerateFilterParams params{};
params.disp_diff = request->filter_param[0];
params.magnitude = request->filter_param[1];
params.radius = request->filter_param[2];
spatial_moderate_filter->setFilterParams(params);
RCLCPP_INFO_STREAM(logger_, "Set SpatialModerateFilter params: "
<< "\ndisp_diff:" << params.disp_diff << "\nmagnitude:"
<< params.magnitude << "\nradius:" << params.radius);
} else {
RCLCPP_INFO_STREAM(
logger_, request->filter_name
<< "Cannot be set\n"
<< "The filter_name value that can be set is "
"DecimationFilter, HDRMerge, SequenceIdFilter, ThresholdFilter, "
"NoiseRemovalFilter, HardwareNoiseRemoval, SpatialAdvancedFilter, "
"SpatialFastFilter, SpatialModerateFilter and TemporalFilter");
return;
}
for (auto &filter : depth_filter_list_) {
std::cout << " - " << filter->getName() << ": "
<< (filter->isEnabled() ? "enabled" : "disabled") << std::endl;
auto configSchemaVec = filter->getConfigSchemaVec();
for (auto &configSchema : configSchemaVec) {
std::cout << " - {" << configSchema.name << ", " << configSchema.type << ", "
<< configSchema.min << ", " << configSchema.max << ", " << configSchema.step
<< ", " << configSchema.def << ", " << configSchema.desc << "}" << std::endl;
}
}
response->success = true;
} }
response->success = true;
} catch (const ob::Error &e) { } catch (const ob::Error &e) {
response->message = e.getMessage(); response->message = e.getMessage();
response->success = false; response->success = false;