Add documentation for False Positive Filter and SDK JSON configuration

This commit is contained in:
ob-yalian
2026-07-09 11:25:50 +08:00
parent ea550c00c4
commit f560b0bd18
10 changed files with 776 additions and 12 deletions
@@ -258,8 +258,8 @@ The following are the launch parameters available:
* Set the downsampling multiple. You can use `ros2 run orbbec_camera list_camera_profile_mode_node` to view the settable resolution. **Default value:** `1`
> **Supported Modules**: Gemini 301 series
* **`enable_false_positive_filter`**
* Enable this option to reduce ghosting noise.
> **Supported Modules**: DaBaiA / DaBaiAL / Gemini 330 series / Gemini345 / Gemini345Lg
* Enable this option to reduce ghosting noise. For usage examples and runtime tuning, see [False Positive Filtering for Gemini 330 Series](../5_advanced_guide/configuration/false_positive_filter.md).
> **Supported Modules**: Gemini 330 series / Gemini 340 series
* **`enable_edge_noise_removal_filter`**
* Enable EdgeNoiseRemovalFilter to reduce edge noise in depth frames.
> **Supported Modules**: DaBai Max Pro
@@ -330,11 +330,11 @@ The following are the launch parameters available:
* **`config_file_path`**
* The path to the YAML configuration file. Default is `""`. If not specified, default parameters from the launch file will be used. Some presets or special modes are configured through YAML. See [predefined presets](../5_advanced_guide/configuration/predefined_presets.md).
* **`load_config_json_file_path`**
* SDK JSON configuration import path. When set, the node imports the JSON configuration during initialization. For Gemini 330 series, use `gemini_330_series_sdk_json.launch.py` as the dedicated SDK JSON launch file.
* If the JSON contains `application_config`, the node syncs stream enable states, resolution, frame rate, format, undistortion, point cloud, HDR merge, and device-level decimation from it when those values are not explicitly overridden by launch parameters.
* SDK JSON configuration import path. When set, the node imports the JSON configuration during initialization. For Gemini 330 series, use `gemini_330_series_sdk_json.launch.py` as the dedicated SDK JSON launch file. See [SDK JSON Import and Export for Gemini 330 Series](../5_advanced_guide/configuration/sdk_json_config.md).
* If the JSON contains `application_config`, the node syncs stream enable states, resolution, frame rate, format, undistortion, point cloud, HDR merge, and device-level decimation from it when the corresponding launch / YAML parameters have not been passed to the node.
* **`export_config_json_file_path`**
* SDK JSON configuration export path. When set, the node exports the current device configuration to JSON after initialization. You can also export at runtime with the `/camera/export_config_json` service.
* Before export, the node syncs the current ROS sensor stream, point cloud, and HDR merge settings into the SDK `application_config` when the device supports it.
* SDK JSON configuration export path. When set, the node exports the current device configuration to JSON after initialization. You can also export at runtime with the `/camera/export_config_json` service. See [SDK JSON Import and Export for Gemini 330 Series](../5_advanced_guide/configuration/sdk_json_config.md).
* Before export, the node syncs the current ROS2 sensor stream, point cloud, and HDR merge settings into the SDK `application_config` when the device supports it.
* **`frame_aggregate_mode`**
* Set frame aggregate output mode. Optional values: `full_frame`, `color_frame`, `ANY`, `disable`.
* This parameter is case-insensitive. Invalid values are reported and replaced with the default value.
@@ -167,6 +167,7 @@
ros2 service call /camera/get_sdk_version orbbec_camera_msgs/srv/GetString
```
* `/camera/export_config_json`
Export the current device configuration to an SDK JSON file. For the Gemini 330 series JSON import and export workflow, see [SDK JSON Import and Export for Gemini 330 Series](../5_advanced_guide/configuration/sdk_json_config.md).
```bash
ros2 service call /camera/export_config_json orbbec_camera_msgs/srv/SetString "{data: '/tmp/orbbec_camera_config.json'}"
```
@@ -212,6 +213,7 @@
### Depth Filter Configuration
* `/camera/set_filter`
For `FalsePositiveFilter` startup parameters, status checks, and named-parameter tuning examples, see [False Positive Filtering for Gemini 330 Series](../5_advanced_guide/configuration/false_positive_filter.md).
```bash
# filter_name is the filter name, and filter_enable indicates whether the filter is enabled.
# filter_param is the legacy positional parameter form; filter_config is the new named parameter form.
@@ -40,4 +40,6 @@ Configuration & Modes
configuration/disparity_search_offset.md
configuration/interleave_ae_mode.md
configuration/predefined_presets.md
configuration/sdk_json_config.md
configuration/false_positive_filter.md
configuration/net_camera.md
@@ -0,0 +1,216 @@
# False Positive Filtering for Gemini 330 Series
This document describes how to use the `FalsePositiveFilter` in ROS2 for Gemini 330 series cameras, including enabling it at startup, checking its status, enabling or disabling it at runtime, and temporarily tuning its parameters.
The examples below use the default camera name `camera`. If you set a different `camera_name` at startup, replace `/camera/...` in the commands with the actual name.
## Scope
False positive filtering can reduce ghosting noise in depth frames. For the modules supported by the `enable_false_positive_filter` launch parameter, see [Launch Parameters](../../4_application_guide/launch_parameters.md).
This document focuses on Gemini 330 series usage. Before using the filter, confirm that the device firmware, ROS package version, and selected depth preset match the test scenario.
## Optional: Select a Depth Preset
If you need to select an existing depth preset on the device, set `device_preset`:
```bash
ros2 launch orbbec_camera gemini_330_series.launch.py \
device_preset:="<preset_name>"
```
For example, to use the default preset:
```bash
ros2 launch orbbec_camera gemini_330_series.launch.py \
device_preset:="Default"
```
If you manage parameters with YAML, set:
```yaml
device_preset: "<preset_name>"
```
Notes:
* If no specific preset is required, use the launch default.
* `<preset_name>` must be a preset name supported by the device. See [Predefined Presets](predefined_presets.md).
* To flash or upgrade a preset file, see [firmware_update_tool Device Maintenance Tool](../../6_benchmark/firmware_update_tool.md).
* The startup log `Loaded device preset: <preset_name>` indicates that the preset was loaded successfully.
## Optional: Import an SDK JSON File
If false positive filter parameters are already written in an SDK JSON file, import it with `load_config_json_file_path`. For the Gemini 330 series SDK JSON import and export workflow, parameter priority, and log checks, see [SDK JSON Import and Export for Gemini 330 Series](sdk_json_config.md).
Common cases:
* If the JSON file contains `parameters.sensor_depth.depth_preset`, set `device_preset` to an empty value.
* If the JSON file contains detailed false positive filter parameters, the parameters from the JSON file take precedence.
If the JSON file configures false positive filtering, continue to check `/camera/depth_filters/status` and confirm that the `enabled` and `params` fields for `FalsePositiveFilter` match expectations.
## Enable False Positive Filtering at Startup
`gemini_330_series.launch.py` provides a startup switch for false positive filtering:
```python
DeclareLaunchArgument('enable_false_positive_filter', default_value='false')
```
Set it to `true` at startup:
```bash
ros2 launch orbbec_camera gemini_330_series.launch.py \
enable_false_positive_filter:=true
```
If you manage parameters with YAML, set:
```yaml
enable_false_positive_filter: true
```
Notes:
* `enable_false_positive_filter` only controls whether the filter is enabled.
* Detailed false positive filter parameters are not configured through launch parameters.
* To tune detailed parameters at runtime, use `/camera/set_filter` `filter_config`.
## Check the Filter Status
After starting the node, check the depth filter status topic:
```bash
ros2 topic echo /camera/depth_filters/status
```
Find `FalsePositiveFilter` in the output, and check both the enabled state and the detailed parameter state:
```text
filter_name: "FalsePositiveFilter"
enabled: true
params:
- name: "fpEdgeBleedFilterEnable"
value: "true"
- name: "fpebfROIMinXRatio"
value: "0.000000"
```
How to read the result:
* `enabled: true`: false positive filtering is enabled.
* `enabled: false`: false positive filtering is disabled.
* `params`: the current detailed parameter state of the filter.
For the publishing behavior of `/camera/depth_filters/status`, see [Topics](../../4_application_guide/topics.md).
## Enable or Disable the Filter at Runtime
While the node is running, use `/camera/set_filter` to temporarily enable or disable the filter.
Enable:
```bash
ros2 service call /camera/set_filter orbbec_camera_msgs/srv/SetFilter "{filter_name: 'FalsePositiveFilter', filter_enable: true, filter_param: [], filter_config: []}"
```
Disable:
```bash
ros2 service call /camera/set_filter orbbec_camera_msgs/srv/SetFilter "{filter_name: 'FalsePositiveFilter', filter_enable: false, filter_param: [], filter_config: []}"
```
After calling the service, check the status again:
```bash
ros2 topic echo /camera/depth_filters/status
```
Notes:
* Service calls are temporary runtime operations.
* To enable the filter automatically after the next startup, set `enable_false_positive_filter:=true` in launch or YAML.
* For more `/camera/set_filter` usage, see [Services](../../4_application_guide/services.md).
## Tune Filter Parameters at Runtime
The false positive filter has many parameters. When tuning them at runtime, use `filter_config` and set parameters by name.
### Partial Parameter Example
Enable the filter and temporarily tune a few parameters:
```bash
ros2 service call /camera/set_filter orbbec_camera_msgs/srv/SetFilter "{filter_name: 'FalsePositiveFilter', filter_enable: true, filter_param: [], filter_config: [
{name: 'fpEdgeBleedFilterEnable', value: 'true'},
{name: 'fpebfROIMinXRatio', value: '0.0'},
{name: 'fpebfROIMaxXRatio', value: '1.0'}
]}"
```
Notes:
* `filter_name` must be `FalsePositiveFilter`.
* `filter_enable` indicates whether the filter is enabled after this call.
* Keep `filter_param` empty.
* Use `filter_config` to specify the parameters to tune.
* Parameters omitted from `filter_config` keep their current values.
### Full Parameter Example
To set the full false positive filter parameter set in one call, use the following example:
```bash
ros2 service call /camera/set_filter orbbec_camera_msgs/srv/SetFilter "{filter_name: 'FalsePositiveFilter', filter_enable: true, filter_param: [], filter_config: [
{name: 'fpEdgeBleedFilterEnable', value: 'true'},
{name: 'fpebfROIMinXRatio', value: '0.0'},
{name: 'fpebfROIMaxXRatio', value: '1.0'},
{name: 'fpebfROIMinYRatio', value: '0.0'},
{name: 'fpebfROIMaxYRatio', value: '0.6'},
{name: 'fpebfMinBleedLength', value: '40'},
{name: 'fpTextureSparsityFilterEnable', value: 'false'},
{name: 'fptsfROIMinXRatio', value: '0.0'},
{name: 'fptsfROIMaxXRatio', value: '1.0'},
{name: 'fptsfROIMinYRatio', value: '0.0'},
{name: 'fptsfROIMaxYRatio', value: '0.45'},
{name: 'fptsfMaxNoiseLevel', value: '6000'},
{name: 'fptsfMaxSpeckleSize', value: '1300'},
{name: 'fpPatternAmbiguityFilterEnable', value: 'false'},
{name: 'fppafROIMinXRatio', value: '0.0'},
{name: 'fppafROIMaxXRatio', value: '0.99'},
{name: 'fppafROIMinYRatio', value: '0.0'},
{name: 'fppafROIMaxYRatio', value: '0.9'},
{name: 'fppafMaxNoiseLevel', value: '6000'},
{name: 'fppafMaxSpeckleSize', value: '4000'},
{name: 'fppafMaxWidthRatio', value: '0.3'},
{name: 'fppafMaxHeightRatio', value: '0.3'},
{name: 'fppafTolerance', value: '0.15'},
{name: 'fppafScore', value: '50'}
]}"
```
After calling the service, check the status and parameters:
```bash
ros2 topic echo /camera/depth_filters/status
```
## FAQ
### The startup parameter is set, but the status is still false
Check the following:
* Whether the startup command contains `enable_false_positive_filter:=true`.
* Whether YAML sets `enable_false_positive_filter` to `false`.
* Whether the node was not restarted after changing parameters.
* Whether an old parameter file or launch configuration is still being used.
### Are service tuning changes preserved after restart?
`/camera/set_filter` is temporary runtime tuning and only affects the currently running node. After the node restarts, whether false positive filtering is enabled is controlled by the `enable_false_positive_filter` startup parameter. Detailed parameters set through `filter_config` at runtime are not automatically saved through launch or YAML.
### Tuning fails with an unknown parameter error
Check whether each `name` in `filter_config` is a false positive filter parameter supported by the current device and SDK. Parameter names are case-sensitive.
@@ -0,0 +1,162 @@
# SDK JSON Import and Export for Gemini 330 Series
This document describes how to import and export SDK JSON configuration files for Gemini 330 series cameras in ROS2.
SDK JSON files can be used to restore or migrate camera configuration. The JSON file can come from the SDK, OrbbecViewer, or a configuration exported by ROS. The ROS2 node passes the file path to the SDK, triggers import or export, and reads back the final camera configuration after initialization.
## Scope
This document only covers SDK JSON import and export for the Gemini 330 series. Prefer the dedicated launch file:
```bash
gemini_330_series_sdk_json.launch.py
```
This launch file is designed for SDK JSON workflows. It keeps only the parameters required for ROS2 runtime and device management, reducing the chance that default camera parameters from launch override the JSON configuration.
Full launch files such as `gemini_330_series.launch.py` and `gemini_330_series_low_cpu.launch.py` also provide `load_config_json_file_path` and `export_config_json_file_path`, but they contain many camera parameters. When parameters conflict, launch or YAML parameters that have already been passed to the node take precedence over the corresponding configuration in the JSON file.
## Parameter Priority
When SDK JSON and ROS2 launch / YAML parameters configure the same item, use the following rule to understand the final effective value:
```text
launch / YAML parameters passed to the node > same configuration in SDK JSON
```
"Passed to the node" includes default parameter values written by the launch file. Therefore, when using full launch files such as `gemini_330_series.launch.py`, some camera parameters may already be passed to the node even if the user did not explicitly set them on the command line, and those values may override the corresponding JSON configuration.
SDK JSON modules such as `application_config`, `parameters.sensor_depth`, and `parameters.sensor_color` can all contain configuration that corresponds to ROS2 parameters. Regardless of which module a field belongs to, if it controls the same configuration item as a launch / YAML parameter, use the priority rule above to determine the final effective value.
For example, if the JSON file sets `color_brightness=10`, but launch or YAML passes `color_brightness=0`, the camera finally uses `0`. The final effective value is reflected by startup logs such as `Config final readback ...`.
Therefore:
* To restore configuration from JSON as much as possible, use `gemini_330_series_sdk_json.launch.py`.
* If you must use a full launch file, leave parameters that conflict with JSON empty or unset, or set them to the expected values.
For available depth preset names, see [Predefined Presets](predefined_presets.md). To flash or upgrade a preset file, see [firmware_update_tool Device Maintenance Tool](../../6_benchmark/firmware_update_tool.md).
## Import an SDK JSON File
Use `load_config_json_file_path` to specify the SDK JSON file to import:
```bash
ros2 launch orbbec_camera gemini_330_series_sdk_json.launch.py \
load_config_json_file_path:=/path/to/camera_config.json
```
The file path can be an absolute path, a relative path, or start with `~`. Relative paths are resolved to absolute paths based on the current working directory.
When import succeeds, the log contains:
```text
Config JSON loaded file=/path/to/camera_config.json
```
If the file does not exist, the log contains:
```text
Config JSON load skip file=/path/to/camera_config.json reason=file_not_found
```
If the SDK fails to load the JSON file, the log contains:
```text
Config JSON load failed file=/path/to/camera_config.json error="..."
```
## Confirm the Final Effective Configuration
After importing JSON, the node reads back the final camera configuration during initialization and prints logs similar to:
```text
Config final readback [depth] device_preset=Default
Config final readback [color] color_brightness=0
Config final readback [filter.depth.DecimationFilter] scale=2
```
These logs show the final effective camera configuration. If imported JSON conflicts with launch / YAML parameters, the readback logs reflect the overridden final values.
For depth filters, you can also check the current enabled state and parameters from the status topic:
```bash
ros2 topic echo /camera/depth_filters/status
```
## Export an SDK JSON File
After the camera node is running, use the `/camera/export_config_json` service to export the current configuration:
```bash
ros2 service call /camera/export_config_json orbbec_camera_msgs/srv/SetString "{data: '/tmp/orbbec_camera_config.json'}"
```
After a successful call, the specified path contains an SDK JSON configuration file. The file can be imported later with `load_config_json_file_path`.
The export path can be an absolute path, a relative path, or start with `~`. If the parent directory does not exist, the node creates it automatically.
When export succeeds, the service response and log contain:
```text
Exported config json file path: /tmp/orbbec_camera_config.json
```
If the path is empty or export fails, the service returns failure information and the log contains the error reason.
## Export Automatically at Startup
In addition to the runtime service, you can set `export_config_json_file_path` at startup. The node exports the current configuration once after initialization:
```bash
ros2 launch orbbec_camera gemini_330_series_sdk_json.launch.py \
export_config_json_file_path:=/tmp/orbbec_camera_config.json
```
During field debugging, it is usually better to start the node, confirm the camera state, and then export with `/camera/export_config_json`, so the saved file reflects a confirmed configuration.
## Condensed Field Mapping
The table below lists common SDK JSON fields and their related ROS2 parameters. It is intended to help understand conflicts and overrides; it does not mean every field should be configured through launch.
| SDK JSON field | Related ROS2 parameters | Description |
| --- | --- | --- |
| `application_config.sensors.Color.profile.*` | `enable_color`, `color_width`, `color_height`, `color_fps`, `color_format`, `enable_color_undistortion` | Color stream enable state, resolution, frame rate, format, and undistortion. |
| `application_config.sensors.Depth.profile.*` | `enable_depth`, `depth_width`, `depth_height`, `depth_fps`, `depth_format`, `enable_depth_undistortion` | Depth stream enable state, resolution, frame rate, format, and undistortion. |
| `application_config.sensors.LeftIR.profile.*` | `enable_left_ir`, `left_ir_width`, `left_ir_height`, `left_ir_fps`, `left_ir_format`, `enable_left_ir_undistortion` | Left IR stream configuration. |
| `application_config.sensors.RightIR.profile.*` | `enable_right_ir`, `right_ir_width`, `right_ir_height`, `right_ir_fps`, `right_ir_format`, `enable_right_ir_undistortion` | Right IR stream configuration. |
| `application_config.sensors.Accel.profile.*` | `enable_accel`, `accel_rate`, `accel_range` | Accelerometer enable state, sample rate, and range. |
| `application_config.sensors.Gyro.profile.*` | `enable_gyro`, `gyro_rate`, `gyro_range` | Gyroscope enable state, sample rate, and range. |
| `application_config.point_cloud.*` | `enable_point_cloud`, `enable_colored_point_cloud`, `point_cloud_decimation_filter_factor`, `depth_registration`, `align_mode`, `align_target_stream`, `enable_frame_sync`, `frame_aggregate_mode` | Point cloud, colored point cloud, alignment, frame sync, and frame aggregation. |
| `application_config.hdr_merge.*` | `enable_hdr_merge` | HDR merge configuration. |
| `application_config.device_decimation.*` | `preset_resolution_config` | Device-level decimation configuration. |
| `parameters.sensor_depth.depth_preset` | `device_preset` | Depth preset. When importing JSON with a full launch file, avoid overriding JSON with `device_preset`. |
| Exposure, gain, AE ROI, depth unit, laser, disparity, and image orientation fields under `parameters.sensor_depth` | `depth_exposure`, `depth_gain`, `enable_ir_auto_exposure`, `ir_ae_max_exposure`, `depth_ae_roi_*`, `depth_precision`, `enable_laser`, `laser_energy_level`, `disparity_to_depth_mode`, `disparity_range_mode`, `disparity_search_offset`, `depth_rotation`, `depth_flip`, `depth_mirror`, etc. | Depth-related device configuration. |
| `parameters.sensor_depth.frame_interleave.*` | `interleave_frame_enable`, `interleave_ae_mode`, `interleave_skip_index`, `hdr_index*_*`, `laser_index*_*` | HDR / laser interleave configuration. |
| `parameters.sensor_depth.post_processing_filter.*` | `enable_*_filter` and related filter parameters | Depth post-processing filter configuration. Detailed `FalsePositiveFilter` parameters are configured through JSON or `/camera/set_filter` `filter_config`. |
| Exposure, white balance, brightness, sharpness, anti-flicker, AE ROI, and image orientation fields under `parameters.sensor_color` | `enable_color_auto_exposure`, `color_exposure`, `color_gain`, `enable_color_auto_white_balance`, `color_white_balance`, `color_brightness`, `color_sharpness`, `color_powerline_freq`, `color_ae_roi_*`, `color_rotation`, `color_flip`, `color_mirror`, etc. | Color-related device configuration. |
| `parameters.sensor_color.post_processing_filter.DecimationFilter` | `enable_color_decimation_filter`, `color_decimation_filter_scale` | Color decimation filter configuration. |
| `parameters.sensor_left_ir` / `parameters.sensor_right_ir` | `left_ir_rotation`, `right_ir_rotation`, `enable_left_ir_sequence_id_filter`, `enable_right_ir_sequence_id_filter`, `left_ir_sequence_id_filter_id`, `right_ir_sequence_id_filter_id`, etc. | Left and right IR image orientation and sequence id filter configuration. |
## FAQ
### JSON import does not take effect
Check the following:
* Whether `load_config_json_file_path` points to an existing file.
* Whether the log contains `Config JSON loaded file=...`.
* Whether a full launch file passed the same launch / YAML parameter and overrode the JSON configuration.
* Whether the current device and firmware support the fields in the JSON file.
### Should I use the dedicated launch file or the full launch file?
If the goal is to restore configuration from JSON as much as possible, use `gemini_330_series_sdk_json.launch.py`.
If you want to keep the larger set of parameter controls from a launch file, you can continue to use full launch files such as `gemini_330_series.launch.py`, but you need to know which parameters will override JSON.
### Does the exported JSON contain the final configuration?
The exported JSON is based on the current final camera state. Before export, the node syncs current ROS2-side sensor, point cloud, and HDR merge configuration to the SDK `application_config`, and then calls the SDK JSON export.
If JSON was imported at startup and some configuration was overridden by launch / YAML, the exported file contains the overridden final configuration.