docs: document ROS2 color queue diagnostics

This commit is contained in:
ob-yalian
2026-08-26 14:27:04 +08:00
parent 0c78e5a104
commit a27ad53138
4 changed files with 36 additions and 0 deletions
@@ -65,6 +65,8 @@
* 如需降低 CPU 使用率,可参考 [降低 CPU 使用率](../5_advanced_guide/performance/lower_cpu_usage.md) 中的 `color_format` 建议。
* **`enable_[color|depth|left_ir|right_ir|ir]`**
* 启用或关闭对应图像流。
* **`color_frame_queue_max_frames`**、**`left_color_frame_queue_max_frames`**、**`right_color_frame_queue_max_frames`**
* 设置对应彩色帧线程缓存的最大帧数,默认值为 `10`。队列满时会丢弃最旧帧,并增加溢出计数;当前队列长度和溢出统计可通过 `/camera/get_color_queue_stats` 查询。
* **`[color|depth|left_ir|right_ir|ir]_rotation`**
* 设置流图像旋转。
* 可能的值为 `0`、`90`、`180`、`270`。
@@ -108,6 +108,22 @@
ros2 service call /camera/set_streams_enable std_srvs/srv/SetBool '{data: false}'
```
### 彩色帧队列诊断
* `/camera/get_color_queue_stats`
该服务使用 `std_srvs/srv/SetBool`。请求值为 `false` 时查询当前统计信息;请求值为 `true` 时查询并重置累计统计信息。
```bash
ros2 service call /camera/get_color_queue_stats std_srvs/srv/SetBool '{data: false}'
```
响应的 `message` 字段为 JSON,包含总 `overflow_count` 和 `queues` 对象。每个已启用队列会报告 `capacity_frames`、`queue_size`、`max_queue_size`、`overflow_count`、`oldest_queue_wait_ms` 和 `max_queue_wait_ms`。响应同时包含节点 `namespace` 以及是否执行了统计重置的 `statistics_reset` 字段。
```bash
ros2 service call /camera/get_color_queue_stats std_srvs/srv/SetBool '{data: true}'
```
### 运行时数据流配置
* `/camera/set_stream_profile`