Update README framework

This commit is contained in:
jj
2025-03-03 18:28:57 +08:00
parent f380fc56bc
commit c3dbf99a9f
37 changed files with 411 additions and 987 deletions
@@ -0,0 +1,40 @@
## 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](./images/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](./images/image4.jpg)
Binary file not shown.

After

Width:  |  Height:  |  Size: 736 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 70 KiB

@@ -0,0 +1,66 @@
# Multi-Camera
- To get the `usb_port` of the camera, plug in the camera and run the following command in the terminal:
```bash
ros2 run orbbec_camera list_devices_node
```
- Set the `device_num` parameter to the number of cameras you have.
- Go to the `OrbbecSDK_ROS2/launch/multi_xxx.launch.py` file and change the `usb_port`.
- Don't forget to put the `include` tag inside the `group` tag.
Otherwise, the parameter values of different cameras may become contaminated.
```python
from launch import LaunchDescription
from launch.actions import DeclareLaunchArgument, IncludeLaunchDescription, GroupAction, ExecuteProcess
from launch.launch_description_sources import PythonLaunchDescriptionSource
from launch_ros.actions import Node
from ament_index_python.packages import get_package_share_directory
import os
def generate_launch_description():
# Include launch files
package_dir = get_package_share_directory('orbbec_camera')
launch_file_dir = os.path.join(package_dir, 'launch')
launch1_include = IncludeLaunchDescription(
PythonLaunchDescriptionSource(
os.path.join(launch_file_dir, 'gemini2L.launch.py')
),
launch_arguments={
'camera_name': 'camera_01',
'usb_port': '6-2.4.4.2', # replace your usb port here
'device_num': '2'
}.items()
)
launch2_include = IncludeLaunchDescription(
PythonLaunchDescriptionSource(
os.path.join(launch_file_dir, 'gemini2L.launch.py')
),
launch_arguments={
'camera_name': 'camera_02',
'usb_port': '6-2.4.1', # replace your usb port here
'device_num': '2'
}.items()
)
# If you need more cameras, just add more launch_include here, and change the usb_port and device_num
# Launch description
ld = LaunchDescription([
GroupAction([launch1_include]),
GroupAction([launch2_include]),
])
return ld
```
- To launch the cameras, run the following command:
```bash
ros2 launch orbbec_camera multi_camera.launch.py
```
Binary file not shown.

After

Width:  |  Height:  |  Size: 116 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 103 KiB

@@ -0,0 +1,53 @@
## Enabling and Visualizing Point Cloud in ROS 2
This section demonstrates how to enable point cloud data output from the camera node and visualize it using RViz2, similarly to the initial camera node setup discussed in the [Starting Camera Node](./start_camera_node.MD) document.
### Enabling Depth Point Cloud
#### Command to Enable Depth Point Cloud
To activate the point cloud data stream for depth information, use the following command:
```bash
ros2 launch orbbec_camera gemini_330_series.launch.py enable_point_cloud:=true
```
#### Visualizing Depth Point Cloud in RViz2
After running the above command, perform the following steps to visualize the depth point cloud:
1. Open RViz2.
2. Add a `PointCloud2` display.
3. Select the `/camera/depth/points` topic for visualization.
4. Set the fixed frame to `camera_link` to properly align the data.
##### Example Visualization
Here is what the depth point cloud might look like in RViz2:
![Depth Point Cloud Visualization](./images/image5.jpg)
### Enabling Colored Point Cloud
#### Command to Enable Colored Point Cloud
To enable the colored point cloud feature, enter the following command:
```bash
ros2 launch orbbec_camera gemini_330_series.launch.py enable_colored_point_cloud:=true
```
#### Visualizing Colored Point Cloud in RViz2
To visualize the colored point cloud data:
1. Launch RViz2 following the command execution.
2. Add a `PointCloud2` display panel.
3. Choose the `/camera/depth_registered/points` topic from the list.
4. Ensure the fixed frame is set to `camera_link`.
##### Example Visualization
The result of the colored point cloud in RViz2 should look similar to this:
![Colored Point Cloud Visualization](./images/image6.jpg)
Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 143 KiB

@@ -0,0 +1,83 @@
## Starting the Camera Node in ROS 2
This guide provides instructions on how to launch the camera node with a colored point cloud feature enabled using ROS 2.
### Command to Start the Node
To start the camera node, execute the following command in your terminal:
```bash
ros2 launch orbbec_camera gemini_330_series.launch.py enable_colored_point_cloud:=true
```
This command initiates the camera node and enables the colored point cloud.
### Published Topics
Once the camera node is running, it will publish data on several ROS topics. Below is a list of the available topics:
- **IMU Data and IMU Information:**
- `camera/accel/imu_info`
- `camera/gyro/imu_info`
- `camera/gyro_accel/sample`
- **Color Camera Topics:**
- `/camera/color/camera_info`
- `/camera/color/image_raw`
- `/camera/color/image_raw/compressed`
- `/camera/color/image_raw/compressedDepth`
- `/camera/color/image_raw/theora`
- `/camera/color/metadata`
- **Depth Camera Topics:**
- `/camera/depth/camera_info`
- `/camera/depth/image_raw`
- `/camera/depth/image_raw/compressed`
- `/camera/depth/image_raw/compressedDepth`
- `/camera/depth/image_raw/theora`
- `/camera/depth/metadata`
- `/camera/depth/points`
- `/camera/depth_filter_status`
- `/camera/depth_registered/points`
- `/camera/depth_to_color`
- `/camera/depth_to_left_ir`
- `/camera/depth_to_right_ir`
- **Infrared Camera Topics:**
- `/camera/left_ir/camera_info`
- `/camera/left_ir/image_raw`
- `/camera/left_ir/image_raw/compressed`
- `/camera/left_ir/image_raw/compressedDepth`
- `/camera/left_ir/image_raw/theora`
- `/camera/left_ir/metadata`
- `/camera/right_ir/camera_info`
- `/camera/right_ir/image_raw`
- `/camera/right_ir/image_raw/compressed`
- `/camera/right_ir/image_raw/compressedDepth`
- `/camera/right_ir/image_raw/theora`
- `/camera/right_ir/metadata`
- **Miscellaneous Topics:**
- `/diagnostics`
- `/parameter_events`
- `/rosout`
- `/rosout_agg`
### Visualizing Data in RViz2
To view the PointCloud or Image data, use RViz2:
1. Launch RViz2.
2. Select the topic you wish to visualize from the list of published topics.
3. Add the selected topic to RViz2 to start viewing the data.
### Example Visualizations
Here are examples of how the visualization might appear in RViz2:
- **PointCloud Visualization**
![PointCloud View](./images/image1.jpg)
- **Image Data Visualization**
![Image Data View](./images/image2.jpg)