mirror of
https://github.com/orbbec/OrbbecSDK_ROS2.git
synced 2026-10-08 05:47:45 +08:00
Update docs and delete timed sync
This commit is contained in:
@@ -1,5 +1,3 @@
|
||||
<!-- docs/source/3_start_single_camera/start_single_camera.md -->
|
||||
|
||||
# Single camera
|
||||
|
||||
This guide provides instructions on how to launch the camera node with a colored point cloud feature enabled using ROS 2.
|
||||
@@ -27,6 +25,42 @@ source install/setup.bash
|
||||
ros2 launch orbbec_camera orbbec_camera.launch.py config_file_path:=gemini330_series.yaml
|
||||
```
|
||||
|
||||
config_file_path:=gemini330_series.yaml means orbbec_camera.launch.py uses the parameters set in gemini330_series.yaml
|
||||
|
||||
## Launch parameters
|
||||
|
||||
For the definition and function of launch parameters, please refer to common.yaml. All open parameters are in common.yaml.The following is a partial common.yaml display:
|
||||
|
||||
```yaml
|
||||
# config/*.yaml files are used to configure the camera parameters
|
||||
---
|
||||
orbbec_ros:
|
||||
camera_parameters:
|
||||
general:
|
||||
# Camera model. upport product models by referencing config/*.yaml
|
||||
camera_model: "gemini330_series"
|
||||
# The configuration file for yaml params.
|
||||
config_file_path: "gemini330_series.yaml"
|
||||
# Log level. Supported levels are 'debug', 'info', 'warning' and 'error'. Default is 'none'.
|
||||
log_level: "none"
|
||||
|
||||
deivce:
|
||||
# camera name, usually overwritten by launch file
|
||||
camera_name: "camera"
|
||||
# camera serial number, usually overwritten by launch file
|
||||
serial_number: ""
|
||||
# The USB port of the camera. This parameter is required when using multiple cameras.
|
||||
usb_port: ""
|
||||
# Number of devices. If multiple cameras are required, this parameter must be filled in launch file
|
||||
device_num: 1
|
||||
# Optional values: v4l2, libuvc
|
||||
uvc_backend: "libuvc"
|
||||
# Usually no need to change
|
||||
vendor_id: "0x2bc5"
|
||||
```
|
||||
|
||||
Notice:If you run orbbec_camera.launch.py, the default combination of launch parameters used is common.yaml+gemini330_series.yaml, and the parameters in gemini330_series.yaml have higher priority than common.yaml
|
||||
|
||||
## Visualizing data in rviz2
|
||||
|
||||
- view_display launch
|
||||
@@ -113,7 +147,7 @@ Save point cloud:
|
||||
ros2 service call /camera/save_point_cloud std_srvs/srv/Empty "{}"
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
## Example visualizations
|
||||
|
||||
@@ -123,13 +157,101 @@ Here are examples of how the visualization might appear in rviz2:
|
||||
|
||||

|
||||
|
||||
|
||||
|
||||
|
||||
- **Image Data Visualization**
|
||||
|
||||

|
||||
|
||||
|
||||
|
||||
|
||||
## Aligning Depth to Color
|
||||
|
||||
### 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:
|
||||
|
||||
```shell
|
||||
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:
|
||||
|
||||
```shell
|
||||
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:
|
||||
|
||||

|
||||
|
||||
### 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:
|
||||
|
||||

|
||||
|
||||
## Enabling and Visualizing Point Cloud
|
||||
|
||||
### Enabling Depth Point Cloud
|
||||
|
||||
#### Command to Enable Depth Point Cloud
|
||||
|
||||
To activate the point cloud data stream for depth information, use the following command:
|
||||
|
||||
```shell
|
||||
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:
|
||||
|
||||

|
||||
|
||||
### Enabling Colored Point Cloud
|
||||
|
||||
#### Command to Enable Colored Point Cloud
|
||||
|
||||
To enable the colored point cloud feature, enter the following command:
|
||||
|
||||
```shell
|
||||
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:
|
||||
|
||||

|
||||
|
||||
## TF tree diagram
|
||||
|
||||
@@ -139,7 +261,7 @@ To get the TF tree
|
||||
ros2 run rqt_tf_tree rqt_tf_tree --force-discover
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
The TF tree diagram for the OrbbecSDK_ROS2 is illustrated below:
|
||||

|
||||
 `<!-- docs/source/3_start_single_camera/start_single_camera.md -->`
|
||||
|
||||
@@ -18,6 +18,20 @@ Install xterm
|
||||
sudo apt install xterm
|
||||
```
|
||||
|
||||
Take gemini_330_series.launch.py as an example to use xterm terminal to open gdb
|
||||
Take orbbec_camera.launch.py as an example to use xterm terminal to open gdb
|
||||
|
||||

|
||||
```python
|
||||
def create_composable_node(camera_name, params, use_intra_process):
|
||||
common_arguments = [{'use_intra_process_comms': use_intra_process}]
|
||||
composable_node = ComposableNode(
|
||||
namespace=camera_name,
|
||||
name=camera_name,
|
||||
package=default_package_name,
|
||||
plugin='orbbec_camera::OBCameraNodeDriver',
|
||||
parameters=params,
|
||||
#extra_arguments=[{'use_intra_process_comms': LaunchConfiguration("use_intra_process_comms")}],
|
||||
extra_arguments=common_arguments,
|
||||
prefix=['xterm -e gdb -ex run --args'],
|
||||
)
|
||||
return composable_node
|
||||
```
|
||||
|
||||
@@ -52,10 +52,25 @@ This tool will save the color and left IR images of each camera and the timestam
|
||||
|
||||
The configuration parameter file of this tool node is multi_save_rgbir_params.json
|
||||
|
||||

|
||||
```json
|
||||
{
|
||||
"save_rgbir_params": {
|
||||
"time_domain": "device",
|
||||
"usb_ports": [
|
||||
"2-3",
|
||||
"2-1"
|
||||
],
|
||||
"camera_name": [
|
||||
"G330_0",
|
||||
"G330_1"
|
||||
]
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
* The parameter order of usb_ports: "Host", "Slave 1", "Slave 2", "Slave 3". Fill in as many usb_ports as there are cameras.
|
||||
* ir_topics and color_topics are topic names. Fill in as many names as there are cameras.
|
||||
* time_domain: timestamp type
|
||||
* usb_ports parameter order: "host", "slave 1", "slave 2", "slave 3", fill in as many usb_ports as there are cameras
|
||||
* camera_name: the name set for the camera, for example: G330_0
|
||||
|
||||
## metadata_save_files_node
|
||||
|
||||
@@ -63,7 +78,18 @@ The metadata_save_files_node tool will save the depth, left and right IR, images
|
||||
|
||||
The configuration parameter file of this tool node is metadata_save_params.json
|
||||
|
||||

|
||||
```json
|
||||
{
|
||||
"metadata_save_params": {
|
||||
"left_ir_image_topic": "/camera/left_ir/image_raw",
|
||||
"right_ir_image_topic": "/camera/right_ir/image_raw",
|
||||
"depth_image_topic": "/camera/depth/image_raw",
|
||||
"left_ir_metadata_topic": "/camera/left_ir/metadata",
|
||||
"right_ir_metadata_topic": "/camera/right_ir/metadata",
|
||||
"depth_metadata_topic": "/camera/depth/metadata"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
```bash
|
||||
ros2 run orbbec_camera metadata_save_files_node
|
||||
@@ -75,7 +101,21 @@ The metadata_save_files_node tool will save depth, color, left and right IR imag
|
||||
|
||||
The configuration parameter file of this tool node is metadata_save_params.json
|
||||
|
||||

|
||||
```json
|
||||
{
|
||||
"metadata_export_params": {
|
||||
"sn": "CP1L44P00085",
|
||||
"left_ir_image_topic": "/camera/left_ir/image_raw",
|
||||
"right_ir_image_topic": "/camera/right_ir/image_raw",
|
||||
"depth_image_topic": "/camera/depth/image_raw",
|
||||
"color_image_topic": "/camera/color/image_raw",
|
||||
"left_ir_metadata_topic": "/camera/left_ir/metadata",
|
||||
"right_ir_metadata_topic": "/camera/right_ir/metadata",
|
||||
"depth_metadata_topic": "/camera/depth/metadata",
|
||||
"color_metadata_topic": "/camera/color/metadata"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
```bash
|
||||
ros2 run orbbec_camera metadata_export_files_node
|
||||
|
||||
Reference in New Issue
Block a user