This commit is contained in:
obyalian
2025-10-19 16:06:36 +08:00
parent 69fa710737
commit 5513cf2882
200 changed files with 2925 additions and 19 deletions
@@ -0,0 +1,39 @@
## Aligning Depth to Color in ROS 2
This section explains how to align depth images with color images to create an overlay image using ROS 2. This is particularly useful for applications requiring synchronized visual information from different sensor modalities.
### Commands to Align and View Depth and Color Images
1. **Basic Depth to Color Alignment:**
To simply align the depth image to the color image, use the following command:
```bash
ros2 launch orbbec_camera gemini_330_series.launch.py depth_registration:=true
```
This command activates the depth registration feature without opening a viewer.
2. **Viewing Depth to Color Overlay:**
If you wish to view the depth to color overlay, you need to enable the viewer by using the command below:
```bash
ros2 launch orbbec_camera gemini_330_series.launch.py depth_registration:=true enable_d2c_viewer:=true
```
This launches the camera node with depth to color registration and opens a viewer to display the overlay image.
### Selecting Topics in RViz2
To visualize the aligned images in RViz2:
1. Launch RViz2 after running one of the above commands.
2. Select the topic for the depth to color overlay image. An example topic selection is shown here:
![Topic Selection for Depth to Color Overlay](../../image/align_depth_color/image3.png)
### Example of Depth to Color Overlay
After selecting the appropriate topic in RViz2, you will be able to see the depth to color overlay image. Here's what it might look like:
![Depth to Color Overlay Image](../../image/align_depth_color/image4.jpg)
@@ -0,0 +1,13 @@
# Configuration of depth NFOV and WFOV modes
For the Femto Mega and Femto Bolt devices, the NFOV and WFOV modes are implemented by configuring the resolution of
Depth and IR in the launch file.
In launch file, depth_width, depth_height, ir_width, ir_height represents the resolution of the depth and the resolution of
the IR.
The frame fps and resolution of IR must be consistent with the depth. The correspondence between different modes and
resolutions is as follows:
- NFOV unbinned: 640 x 576.
- NFOV binned: 320 x 288.
- WFOV unbinned: 1024 x 1024.
- WFOV binned: 512 x 512.
@@ -0,0 +1,32 @@
# Depth work mode switch
Orbbec SDK ROS 2 supports the depth work mode switch. The depth work mode switch is supported by Gemini 2, Gemini 2 L,
and Femto and Femto Bolt cameras.
- Before starting the camera, depth work mode (depth_work_mode) can be configured for the corresponding xxx.launch.py
file's support.
- The depth work mode switch is supported by Gemini 2, Gemini 2 L, and Gemini 2 XL cameras.
- The default depth work mode configuration of xxx.launch.py is the camera's default configuration. If you need to
modify it, you can switch to the corresponding mode as needed.
- The specific camera depth work mode support types can be found in the comments of the depth mode.
```python
# Depth work mode support is as follows:
# Unbinned Dense Default
# Unbinned Sparse Default
# Binned Sparse Default
# Obstacle Avoidance
DeclareLaunchArgument('depth_work_mode', default_value='')
```
- View depth work modes:
```bash
ros2 run orbbec_camera list_depth_work_mode_node
```
* Example:
```bash
ros2 launch orbbec_camera gemini2L.launch.py depth_work_mode:="Unbinned Dense Default"
```
@@ -0,0 +1,47 @@
# Disparity_search_offset
> This section describes how to use the disparity_search_offset function in the Gemini330 series cameras (minimum camera firmware version [1.4.60](https://www.orbbec.com/docs/g330-firmware-release/)).Disparity_search_offset is effective only for1280×720, 1280×800 and 640×400 resolutions of depth stream.
## Function Introduction
The definition of disparity search range: For any pixel *(u_l, v)* in the left image, by default, the corresponding disparity search range in the right image is *[ (u_l - 255, v)*, *(u_l, v) ]*, where the disparity search length is 256 and the maximum integer disparity is 255. If the starting point of the search is adjusted to *[ (u_l - 255 - offset, v)*, *(u_l - offset, v) ]*, the offset is defined as the disparity shift. Therefore, our disparity search range configuration includes both the disparity search length and the search position offset (which can also be referred to as the disparity shift).
![Depth Point Cloud Visualization](../../image/disparity_search_offset/search_offset0.png)
## Parameter Introduction
The disparity_search_offset related parameters are set in [gemini_330_series.launch.py](https://github.com/orbbec/OrbbecSDK_ROS2/blob/v2-main/orbbec_camera/launch/gemini_330_series.launch.py)
* `disparity_range_mode` : Disparity search length,can only be set to 64, 128 and 256.
* `disparity_search_offset` : Disparity search offset value,Disparity search offset value, can be set from 0 to 127.
* `disparity_offset_config` : Disparity search offset interleave frames.
* `offset_index0` : Frame 0 disparity search offset value.
* `offset_index1` : Frame 1 disparity search offset value.
| disparity range mode | disparity search offset | Minimum depth of inclined wall (mm) |
| :------------------: | :---------------------: | :---------------------------------: |
| 64 | 85 | Gemini 335L  388-406 |
| 64 | 127 | Gemini 335L  302-317 |
| disparity range mode | disparity search offset | Minimum depth of inclined wall (mm) |
| :------------------: | :---------------------: | :---------------------------------------------: |
| 128 | 0 | Gemini 335  233-249<br />Gemini 335L  453-475 |
| 128 | 45 | Gemini 335  172-184<br />Gemini 335L  334-349 |
| 128 | 127 | Gemini 335  117-125<br />Gemini 335L  226-236 |
| disparity range mode | disparity search offset | Minimum depth of inclined wall (mm) |
| :------------------: | :---------------------: | :---------------------------------: |
| 256 | 85 | Gemini 335L  169-178 |
| 256 | 127 | Gemini 335L  151-158 |
## Run the launch
Setting the disparity_search_offset parameter,`colcon build` again and run launch
```bash
ros2 launch orbbec_camera gemini_330_series.launch.py
```
@@ -0,0 +1,81 @@
# Using interleave_ae with Gemini330 series cameras
> This section describes how to use interleave_ae in Gemini 330 series cameras (minimum camera firmware version [1.4.00](https://www.orbbec.com/docs/g330-firmware-release/))
## Parameter Introduction
The interleave_ae related parameters are set in [gemini_330_series.launch.py](https://github.com/orbbec/OrbbecSDK_ROS2/blob/v2-main/orbbec_camera/launch/gemini_330_series.launch.py)
* `interleave_ae_mode` : Set laser or hdr interleave.
* `interleave_frame_enable` : enable interleave frame mode.
* `interleave_skip_enable` : enable skip frame mode.
* `interleave_skip_index` : Set 0 for skip pattern ir, set 1 for skip flood ir.
**interleave hdr**
When the `interleave_ae_mode` parameter is set to `hdr` and `interleave_frame_enable `is set to `true`, interleave hdr will be enabled
* `hdr_index1_laser_control` : Frame 1 laser switch settings.
* `hdr_index1_depth_exposure` : Frame 1 depth exposure value setting, not in AE mode.
* `hdr_index1_depth_gain` : Frame 1 depth gain value setting, not in AE mode.
* `hdr_index1_ir_brightness` : Frame 1 ir gain value setting.
* `hdr_index1_ir_ae_max_exposure` : Frame 1 ir maximum exposure value setting in AE (auto exposure).
* `hdr_index0_laser_control`: Frame 0 laser switch settings.
* `hdr_index0_depth_exposure`: Frame 0 depth exposure value setting, not in AE mode.
* `hdr_index0_depth_gain` : Frame 0 depth gain value setting, not in AE mode.
* `hdr_index0_ir_brightness` : Frame 0 ir gain value setting.
* `hdr_index0_ir_ae_max_exposure` : Frame 0 ir maximum exposure value setting in AE (auto exposure).
**interleave laser**
When the `interleave_ae_mode` parameter is set to `laser` and `interleave_frame_enable `is set to `true`, interleave laser will be enabled
* `laser_index1_laser_control` : Frame 1 laser switch settings.
* `laser_index1_depth_exposure` : Frame 1 depth exposure value setting, not in AE mode.
* `laser_index1_depth_gain` : Frame 1 depth gain value setting, not in AE mode.
* `laser_index1_ir_brightness` : Frame 1 ir gain value setting.
* `laser_index1_ir_ae_max_exposure` : Frame 1 ir maximum exposure value setting in AE (auto exposure).
* `laser_index0_laser_control` : Frame 0 laser switch settings.
* `laser_index0_depth_exposure` : Frame 0 depth exposure value setting, not in AE mode.
* `laser_index0_depth_gain` : Frame 0 depth gain value setting, not in AE mode.
* `laser_index0_ir_brightness` : Frame 0 ir gain value setting.
* `laser_index0_ir_ae_max_exposure` : Frame 0 ir maximum exposure value setting in AE (auto exposure).
## Run the launch
Setting the interleave_ae parameter,`colcon build` again and run launch
```bash
ros2 launch orbbec_camera gemini_330_series.launch.py
```
**Example Visualization**
![Depth Point Cloud Visualization](../../image/interleave_ae_mode/interleave_ae0.jpeg)
![Depth Point Cloud Visualization](../../image/interleave_ae_mode/interleave_ae1.jpeg)
## Multi_camera_synced + Interleave_ae
Please refer to [multi_camera_synced](./multi_camera_synced.md) and [Parameter Introduction](#parameter-introduction)
@@ -0,0 +1,101 @@
# Net_camera
> This section describes how to use Net camera in OrbbecSDK_ROS2.Currently, only Femto_Mega, Gemini 335Le and Gemini 435Le devices are supported, and other Net devices will be supported in the near future.
You can find example usage code in the [example](https://github.com/orbbec/OrbbecSDK_ROS2/tree/v2-main/orbbec_camera/examples).
## Femto Mega & Gemini 435Le & Gemini 335Le
**Parameter Introduction**
Network device settings: `enumerate_net_device` is set to true, which will automatically enumerate network devices.
If you do not want to automatically enumerate network devices,you can set `enumerate_net_device` to false, `net_device_ip` to the device's IP address, and `net_device_port` to the default value of 8090.
* `enumerate_net_device` : Enable automatically enumerate network devices.
* `net_device_ip` : Setting net device's IP address.
* `net_device_port` : Setting net device's port.Usually, you can set it to 8090.
**Single Net camera**
> If you need to run Gemini 435Le/Gemini 335Le, you only need to replace [femto_mega.launch.py ](https://github.com/orbbec/OrbbecSDK_ROS2/tree/v2-main/orbbec_camera/launch/femto_mega.launch.py)in the run command with [gemini435_le.launch.py](https://github.com/orbbec/OrbbecSDK_ROS2/tree/v2-main/orbbec_camera/launch/gemini435_le.launch.py)/[gemini_330_series.launch.py](https://github.com/orbbec/OrbbecSDK_ROS2/tree/v2-main/orbbec_camera/launch/gemini_330_series.launch.py)
For [femto_mega.launch.py](https://github.com/orbbec/OrbbecSDK_ROS2/tree/v2-main/orbbec_camera/launch/femto_mega.launch.py) as an example:
- **automatically enumerate network devices:**
```bash
ros2 launch orbbec_camera femto_mega.launch.py enumerate_net_device:=true
```
- **Specify IP address to start the device:**
Note: `net_device_ip` needs to be changed to the IP address of the device, here it is 192.168.1.10
```bash
ros2 launch orbbec_camera femto_mega.launch.py enumerate_net_device:=false net_device_ip:=192.168.1.10 net_device_port:=8090
```
**Multi Net camera**
For [multi_net_camera.launch.py](https://github.com/orbbec/OrbbecSDK_ROS2/blob/v2-main/orbbec_camera/examples/net_camera/multi_net_camera.launch.py) as an example:
```bash
ros2 launch orbbec_camera multi_net_camera.launch.py
```
## set_device_ip Utility
The **`set_device_ip`** executable allows you to configure the IP settings of a network camera directly from ROS 2, including switching between DHCP and static IP, and setting subnet mask and gateway. This is useful for quickly assigning or updating IP addresses without modifying launch files.
> **Note:** The IP settings applied with `set_device_ip` are **permanent** and **will not be reset** if the device is powered off or restarted.
**Example Usage**
```bash
ros2 run orbbec_camera set_device_ip --ros-args \
-p old_ip:=192.168.1.10 \
-p dhcp:=false \
-p new_ip:=192.168.1.11 \
-p mask:=255.255.255.0 \
-p gateway:=192.168.1.1
```
**Parameters**
- **`old_ip`** – Current IP address of the device.
- **`dhcp`** – Set to `true` to use DHCP or `false` for static IP.
- **`new_ip`** – Static IP address to assign when DHCP is disabled.
- **`mask`** – Subnet mask for the new IP.
- **`gateway`** – Gateway address for the new IP.
## Force IP Function
The **Force IP** feature allows you to assign a **static IP address** to a network camera, overriding DHCP settings. This is useful when multiple network cameras are connected, and you need each device to have a fixed IP for reliable communication.
> **Note:** The Force IP configuration **will be reset if the device is powered off or restarted**. You need to reapply the settings after reboot.
**Parameters**
- **`force_ip_enable`** – Enable the Force IP function. **Default:** `false`
- **`force_ip_mac`** – Target device MAC address when multiple cameras are connected (e.g., `"54:14:FD:06:07:DA"`). You can use the `list_devices_node` to find the MAC of each device. **Default:** `""`
- **`force_ip_address`** – Static IP address to assign . **Default:** `192.168.1.10`
- **`force_ip_subnet_mask`** – Subnet mask for the static IP. **Default:** `255.255.255.0`
- **`force_ip_gateway`** – Gateway address for the static IP. **Default:** `192.168.1.1`
**Example Usage**
- **Enable Force IP for a specific device:**
```bash
ros2 launch orbbec_camera gemini_330_series.launch.py \
force_ip_enable:=true \
force_ip_mac:=54:14:FD:06:07:DA \
force_ip_address:=192.168.1.50 \
force_ip_subnet_mask:=255.255.255.0 \
force_ip_gateway:=192.168.1.1 \
net_device_ip:=192.168.1.50 \
net_device_port:=8090
```
> Tip: Make sure the camera is connected and its MAC address is correct before enabling Force IP. Use `list_devices_node` to check the MAC address of all connected cameras.
@@ -0,0 +1,15 @@
# Predefined presets
| Preset | Features | Recommended use cases |
| -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Default | - Best visual perception``- Overall good performance in accuracy, fill rate, tiny objects, etc. | - Generic `<br>`- Robotics |
| Hand | - Clear hand and finger edges | - Gesture recognition |
| High Accuracy | - Depth of high confidence `<br>`- Barely noise depth values `<br>`- Lower fill rate | - Collision avoidance `<br>`- Object scanning |
| High Density | - Higher fill rate `<br>`- More tiny objects `<br>`- May suffer from noise depth values | - Object recognition `<br>`- Pick & place `<br>`- Foreground & background animation |
| Medium Density | - Balanced performance in fill rate and accuracy `<br>`- In comparison to Default: lower fill rate, better edge quality | - Generic and alternative to Default |
| Custom | - User defined Preset `<br>`- Derived from Presets above, with customized modifications, e.g. a new configuration for the post-processing pipeline, modified mean intensity set point of depth AE function, etc. | - Better depth performance achieved using customized configurations in comparison to using predefined presets `<br>`- For well-established custom configurations |
Choose the appropriate preset name based on your specific use case and set it as the value for the `device_preset`
parameter.