Skip to content

Commit 88c04e2

Browse files
committed
Update docs and delete timed sync
1 parent 7faab8f commit 88c04e2

File tree

5 files changed

+192
-21
lines changed

5 files changed

+192
-21
lines changed

docs/source/3_start_single_camera/start_single_camera.md

Lines changed: 129 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
<!-- docs/source/3_start_single_camera/start_single_camera.md -->
2-
31
# Single camera
42

53
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
2725
ros2 launch orbbec_camera orbbec_camera.launch.py config_file_path:=gemini330_series.yaml
2826
```
2927

28+
config_file_path:=gemini330_series.yaml means orbbec_camera.launch.py uses the parameters set in gemini330_series.yaml
29+
30+
## Launch parameters
31+
32+
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:
33+
34+
```yaml
35+
# config/*.yaml files are used to configure the camera parameters
36+
---
37+
orbbec_ros:
38+
camera_parameters:
39+
general:
40+
# Camera model. upport product models by referencing config/*.yaml
41+
camera_model: "gemini330_series"
42+
# The configuration file for yaml params.
43+
config_file_path: "gemini330_series.yaml"
44+
# Log level. Supported levels are 'debug', 'info', 'warning' and 'error'. Default is 'none'.
45+
log_level: "none"
46+
47+
deivce:
48+
# camera name, usually overwritten by launch file
49+
camera_name: "camera"
50+
# camera serial number, usually overwritten by launch file
51+
serial_number: ""
52+
# The USB port of the camera. This parameter is required when using multiple cameras.
53+
usb_port: ""
54+
# Number of devices. If multiple cameras are required, this parameter must be filled in launch file
55+
device_num: 1
56+
# Optional values: v4l2, libuvc
57+
uvc_backend: "libuvc"
58+
# Usually no need to change
59+
vendor_id: "0x2bc5"
60+
```
61+
62+
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
63+
3064
## Visualizing data in rviz2
3165
3266
- view_display launch
@@ -113,7 +147,7 @@ Save point cloud:
113147
ros2 service call /camera/save_point_cloud std_srvs/srv/Empty "{}"
114148
```
115149

116-
&nbsp;
150+
 
117151

118152
## Example visualizations
119153

@@ -123,13 +157,101 @@ Here are examples of how the visualization might appear in rviz2:
123157

124158
![PointCloud View](../image/image1.jpg)
125159

126-
&nbsp;
160+
 
127161

128162
- **Image Data Visualization**
129163

130164
![Image Data View](../image/image2.jpg)
131165

132-
&nbsp;
166+
 
167+
168+
## Aligning Depth to Color
169+
170+
### Commands to Align and View Depth and Color Images
171+
172+
1. **Basic Depth to Color Alignment:**
173+
To simply align the depth image to the color image, use the following command:
174+
175+
```shell
176+
ros2 launch orbbec_camera gemini_330_series.launch.py depth_registration:=true
177+
```
178+
179+
This command activates the depth registration feature without opening a viewer.
180+
2. **Viewing Depth to Color Overlay:**
181+
If you wish to view the depth to color overlay, you need to enable the viewer by using the command below:
182+
183+
```shell
184+
ros2 launch orbbec_camera gemini_330_series.launch.py depth_registration:=true enable_d2c_viewer:=true
185+
```
186+
187+
This launches the camera node with depth to color registration and opens a viewer to display the overlay image.
188+
189+
### Selecting Topics in RViz2
190+
191+
To visualize the aligned images in RViz2:
192+
193+
1. Launch RViz2 after running one of the above commands.
194+
2. Select the topic for the depth to color overlay image. An example topic selection is shown here:
195+
196+
![D2C topic](../image/image3.png)
197+
198+
### Example of Depth to Color Overlay
199+
200+
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:
201+
202+
![D2C VIEW](../image/image4.jpg)
203+
204+
## Enabling and Visualizing Point Cloud
205+
206+
### Enabling Depth Point Cloud
207+
208+
#### Command to Enable Depth Point Cloud
209+
210+
To activate the point cloud data stream for depth information, use the following command:
211+
212+
```shell
213+
ros2 launch orbbec_camera gemini_330_series.launch.py enable_point_cloud:=true
214+
```
215+
216+
#### Visualizing Depth Point Cloud in RViz2
217+
218+
After running the above command, perform the following steps to visualize the depth point cloud:
219+
220+
1. Open RViz2.
221+
2. Add a `PointCloud2` display.
222+
3. Select the `/camera/depth/points` topic for visualization.
223+
4. Set the fixed frame to `camera_link` to properly align the data
224+
225+
#### Example Visualization
226+
227+
Here is what the depth point cloud might look like in RViz2:
228+
229+
![Depth Point VIEW](../image/image5.jpg)
230+
231+
### Enabling Colored Point Cloud
232+
233+
#### Command to Enable Colored Point Cloud
234+
235+
To enable the colored point cloud feature, enter the following command:
236+
237+
```shell
238+
ros2 launch orbbec_camera gemini_330_series.launch.py enable_colored_point_cloud:=true
239+
```
240+
241+
#### Visualizing Colored Point Cloud in RViz2
242+
243+
To visualize the colored point cloud data:
244+
245+
1. Launch RViz2 following the command execution.
246+
2. Add a `PointCloud2` display panel.
247+
3. Choose the `/camera/depth_registered/points` topic from the list.
248+
4. Ensure the fixed frame is set to `camera_link`.
249+
250+
#### Example Visualization
251+
252+
The result of the colored point cloud in RViz2 should look similar to this:
253+
254+
![Color Point VIEW](../image/image6.jpg)
133255

134256
## TF tree diagram
135257

@@ -139,7 +261,7 @@ To get the TF tree
139261
ros2 run rqt_tf_tree rqt_tf_tree --force-discover
140262
```
141263

142-
&nbsp;
264+
 
143265

144266
The TF tree diagram for the OrbbecSDK_ROS2 is illustrated below:
145-
![single_cam_tf.png](../image/single_cam_tf.png)
267+
![single_cam_tf.png](../image/single_cam_tf.png) `<!-- docs/source/3_start_single_camera/start_single_camera.md -->`

docs/source/5_advanced/gdb_debug.md

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,20 @@ Install xterm
1818
sudo apt install xterm
1919
```
2020

21-
Take gemini_330_series.launch.py as an example to use xterm terminal to open gdb
22-
23-
![Multi_camera1](../image/gdb_1.png)
21+
Take orbbec_camera.launch.py as an example to use xterm terminal to open gdb
22+
23+
```python
24+
def create_composable_node(camera_name, params, use_intra_process):
25+
common_arguments = [{'use_intra_process_comms': use_intra_process}]
26+
composable_node = ComposableNode(
27+
namespace=camera_name,
28+
name=camera_name,
29+
package=default_package_name,
30+
plugin='orbbec_camera::OBCameraNodeDriver',
31+
parameters=params,
32+
#extra_arguments=[{'use_intra_process_comms': LaunchConfiguration("use_intra_process_comms")}],
33+
extra_arguments=common_arguments,
34+
prefix=['xterm -e gdb -ex run --args'],
35+
)
36+
return composable_node
37+
```

docs/source/6_tools/tools.md

Lines changed: 45 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,18 +52,44 @@ This tool will save the color and left IR images of each camera and the timestam
5252

5353
The configuration parameter file of this tool node is multi_save_rgbir_params.json
5454

55-
![Multi_camera1](../image/multi_save_rgbir_node1.png)
55+
```json
56+
{
57+
"save_rgbir_params": {
58+
"time_domain": "device",
59+
"usb_ports": [
60+
"2-3",
61+
"2-1"
62+
],
63+
"camera_name": [
64+
"G330_0",
65+
"G330_1"
66+
]
67+
}
68+
}
69+
```
5670

57-
* The parameter order of usb_ports: "Host", "Slave 1", "Slave 2", "Slave 3". Fill in as many usb_ports as there are cameras.
58-
* ir_topics and color_topics are topic names. Fill in as many names as there are cameras.
71+
* time_domain: timestamp type
72+
* usb_ports parameter order: "host", "slave 1", "slave 2", "slave 3", fill in as many usb_ports as there are cameras
73+
* camera_name: the name set for the camera, for example: G330_0
5974

6075
## metadata_save_files_node
6176

6277
The metadata_save_files_node tool will save the depth, left and right IR, images and metadata data
6378

6479
The configuration parameter file of this tool node is metadata_save_params.json
6580

66-
![Multi_camera1](../image/metadata_save_params.png)
81+
```json
82+
{
83+
"metadata_save_params": {
84+
"left_ir_image_topic": "/camera/left_ir/image_raw",
85+
"right_ir_image_topic": "/camera/right_ir/image_raw",
86+
"depth_image_topic": "/camera/depth/image_raw",
87+
"left_ir_metadata_topic": "/camera/left_ir/metadata",
88+
"right_ir_metadata_topic": "/camera/right_ir/metadata",
89+
"depth_metadata_topic": "/camera/depth/metadata"
90+
}
91+
}
92+
```
6793

6894
```bash
6995
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
75101

76102
The configuration parameter file of this tool node is metadata_save_params.json
77103

78-
![Multi_camera1](https://file+.vscode-resource.vscode-cdn.net/home/jj/openSDK/opensdk_ros2/src/OrbbecSDK_ROS2/docs/source/image/metadata_save_params.png)
104+
```json
105+
{
106+
"metadata_export_params": {
107+
"sn": "CP1L44P00085",
108+
"left_ir_image_topic": "/camera/left_ir/image_raw",
109+
"right_ir_image_topic": "/camera/right_ir/image_raw",
110+
"depth_image_topic": "/camera/depth/image_raw",
111+
"color_image_topic": "/camera/color/image_raw",
112+
"left_ir_metadata_topic": "/camera/left_ir/metadata",
113+
"right_ir_metadata_topic": "/camera/right_ir/metadata",
114+
"depth_metadata_topic": "/camera/depth/metadata",
115+
"color_metadata_topic": "/camera/color/metadata"
116+
}
117+
}
118+
```
79119

80120
```bash
81121
ros2 run orbbec_camera metadata_export_files_node

orbbec_camera/launch/gemini_330_series.launch.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ def generate_launch_description():
168168
DeclareLaunchArgument('laser_energy_level', default_value='-1'),
169169
DeclareLaunchArgument('enable_3d_reconstruction_mode', default_value='false'),
170170
DeclareLaunchArgument('enable_sync_host_time', default_value='true'),
171-
DeclareLaunchArgument('time_domain', default_value='device'),
171+
DeclareLaunchArgument('time_domain', default_value='global'),
172172
DeclareLaunchArgument('enable_color_undistortion', default_value='false'),
173173
DeclareLaunchArgument('config_file_path', default_value=''),
174174
DeclareLaunchArgument('enable_heartbeat', default_value='false'),

orbbec_camera/src/ob_camera_node_driver.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -439,11 +439,6 @@ void OBCameraNodeDriver::initializeDevice(const std::shared_ptr<ob::Device> &dev
439439

440440
if (enable_sync_host_time_ && !isOpenNIDevice(device_info_->pid())) {
441441
TRY_EXECUTE_BLOCK(device_->timerSyncWithHost());
442-
sync_host_time_timer_ = this->create_wall_timer(std::chrono::seconds(60 * 60 * 2), [this]() {
443-
if (device_) {
444-
TRY_EXECUTE_BLOCK(device_->timerSyncWithHost());
445-
}
446-
});
447442
}
448443

449444
RCLCPP_INFO_STREAM(logger_, "Device " << device_info_->getName() << " connected");

0 commit comments

Comments
 (0)