mirror of
https://github.com/orbbec/OrbbecSDK_ROS2.git
synced 2026-10-07 13:37:44 +08:00
Add camera datasheet and the benchmark chapter
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
Benchmark
|
||||
======================================================
|
||||
|
||||
This chapter introduces how to use the benchmark tool and provides test results for different cameras.
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 2
|
||||
|
||||
introduction.md
|
||||
benchmark_usage.md
|
||||
benchmark_data.md
|
||||
@@ -0,0 +1,3 @@
|
||||
# Benchmark Data
|
||||
|
||||
This section records the data of using the benchmark tool to test different cameras
|
||||
@@ -0,0 +1,119 @@
|
||||
# Benchmark Usage
|
||||
|
||||
This section introduces how to use the benchmark tool in C++ and Python, and provides an example YAML configuration file.
|
||||
|
||||
## Using common benchmark node
|
||||
|
||||
```
|
||||
ros2 run orbbec_camera common_benchmark_node.py \
|
||||
--run_time 2h \
|
||||
--csv_file /path/to/log.csv
|
||||
```
|
||||
|
||||
|
||||
|
||||
* **Parameters**
|
||||
* **--run_time**: Duration for monitoring, specified as time strings like `"10s"`, `"5m"`, `"1h"`, `"2d"`. Default is 10 seconds.
|
||||
* **--csv_file**: Path to the output CSV file. By default, it is saved in the workspace directory with the name "camera_monitor_log.csv".
|
||||
|
||||
## Using service benchmark node
|
||||
|
||||
### ROS2 C++
|
||||
|
||||
* **Single service benchmark**
|
||||
|
||||
```
|
||||
ros2 run orbbec_camera service_benchmark_node \
|
||||
--ros-args \
|
||||
-p service_name:=/camera/get_depth_gain \
|
||||
-p service_type:=orbbec_camera_msgs/srv/GetInt32 \
|
||||
-p count:=10
|
||||
```
|
||||
|
||||
* ****Multiple services benchmark (YAML config)****
|
||||
|
||||
```
|
||||
ros2 run orbbec_camera service_benchmark_node \
|
||||
--ros-args \
|
||||
-p yaml_file:=/path/to/default_service_cpp.yaml
|
||||
```
|
||||
|
||||
### ROS2 Python
|
||||
|
||||
* **Single service benchmark**
|
||||
|
||||
```
|
||||
ros2 run orbbec_camera service_benchmark_node.py --service /camera/get_depth_gain --count 10
|
||||
```
|
||||
|
||||
* ****Multiple services benchmark (YAML config)****
|
||||
|
||||
```
|
||||
ros2 run orbbec_camera service_benchmark_node.py --yaml_file /path/to/default_service.yaml
|
||||
```
|
||||
|
||||
|
||||
|
||||
### **Example YAML configuration**
|
||||
|
||||
We provide an example YAML configuration, located in the `scripts` directory as `service_default.yaml`.
|
||||
|
||||
```yaml
|
||||
default_count: 50
|
||||
|
||||
services:
|
||||
- name: /camera/get_auto_white_balance
|
||||
type: orbbec_camera_msgs/srv/GetInt32
|
||||
- name: /camera/get_color_exposure
|
||||
type: orbbec_camera_msgs/srv/GetInt32
|
||||
- name: /camera/get_color_gain
|
||||
type: orbbec_camera_msgs/srv/GetInt32
|
||||
- name: /camera/get_depth_exposure
|
||||
type: orbbec_camera_msgs/srv/GetInt32
|
||||
- name: /camera/get_depth_gain
|
||||
type: orbbec_camera_msgs/srv/GetInt32
|
||||
- name: /camera/get_device_info
|
||||
type: orbbec_camera_msgs/srv/GetDeviceInfo
|
||||
- name: /camera/send_software_trigger
|
||||
type: std_srvs/srv/SetBool
|
||||
request: {data: false}
|
||||
- name: /camera/set_auto_white_balance
|
||||
type: std_srvs/srv/SetBool
|
||||
request: {data: false}
|
||||
- name: /camera/set_color_ae_roi
|
||||
type: orbbec_camera_msgs/srv/SetArrays
|
||||
request: {data_param: [0,1279,0,719]}
|
||||
- name: /camera/set_color_auto_exposure
|
||||
type: std_srvs/srv/SetBool
|
||||
request: {data: false}
|
||||
- name: /camera/set_color_exposure
|
||||
type: orbbec_camera_msgs/srv/SetInt32
|
||||
request: {data: 30}
|
||||
- name: /camera/set_color_flip
|
||||
type: std_srvs/srv/SetBool
|
||||
request: {data: false}
|
||||
- name: /camera/set_color_gain
|
||||
type: orbbec_camera_msgs/srv/SetInt32
|
||||
request: {data: 20}
|
||||
- name: /camera/set_color_mirror
|
||||
type: std_srvs/srv/SetBool
|
||||
request: {data: false}
|
||||
- name: /camera/set_color_rotation
|
||||
type: orbbec_camera_msgs/srv/SetInt32
|
||||
request: {data: 90}
|
||||
- name: /camera/set_depth_ae_roi
|
||||
type: orbbec_camera_msgs/srv/SetArrays
|
||||
request: {data_param: [0,1279,0,719]}
|
||||
- name: /camera/set_depth_auto_exposure
|
||||
type: std_srvs/srv/SetBool
|
||||
request: {data: false}
|
||||
- name: /camera/set_depth_exposure
|
||||
type: orbbec_camera_msgs/srv/SetInt32
|
||||
request: {data: 3000}
|
||||
- name: /camera/set_depth_flip
|
||||
type: std_srvs/srv/SetBool
|
||||
request: {data: false}
|
||||
- name: /camera/set_depth_gain
|
||||
type: orbbec_camera_msgs/srv/SetInt32
|
||||
request: {data: 200}
|
||||
```
|
||||
@@ -0,0 +1,45 @@
|
||||
# Introduction
|
||||
|
||||
This section introduces the benchmark tool, explaining its purpose, features, and what it can help you measure.
|
||||
|
||||
## common benchmark node
|
||||
|
||||
`common_benchmark_node.py` is a tool for monitoring the performance of Orbbec cameras running in a ROS environment. It collects and records key camera metrics such as frame rate, latency, system resource usage, and packet loss rate in real time, helping users evaluate the stability and performance of camera nodes (updated once per second).
|
||||
|
||||
**Features**
|
||||
|
||||
- Measure published image frame rate and latency (current, min, max, average)
|
||||
|
||||
- Monitor the camera node's CPU/ARM usage (current, min, max, average)
|
||||
|
||||
- Track frame drop rate (publisher) and packet loss rate (subscriber)
|
||||
|
||||
- Print real-time statistics (1 Hz) to the terminal and save results to a CSV file
|
||||
|
||||
- Support configurable runtime duration and CSV output path
|
||||
|
||||
**Example**
|
||||
|
||||
In ROS1, both frame drop rate and packet loss rate can be measured, while in ROS2, the header lacks the `seq` field, so only the publisher-side frame drop rate is calculated.
|
||||
|
||||

|
||||
|
||||

|
||||
|
||||
## service benchmark node
|
||||
|
||||
The `service_benchmark_node` tool is used to monitor the performance of service calls. It can measure the success rate of service calls and the time required to execute service.
|
||||
|
||||
**Features**
|
||||
|
||||
- Benchmark a single service call, measuring latency and success rate
|
||||
|
||||
- Benchmark multiple services as defined in a YAML configuration file
|
||||
|
||||
- Optionally save benchmark results to a CSV file
|
||||
|
||||
**Example**
|
||||
|
||||

|
||||
|
||||
When you need to collect data for multiple services, it is recommended to use a CSV file for analysis.
|
||||
Reference in New Issue
Block a user