From a27ad531386c1f45fefcb2882f57ed6c2e64c9ef Mon Sep 17 00:00:00 2001 From: ob-yalian Date: Wed, 26 Aug 2026 11:56:51 +0800 Subject: [PATCH] docs: document ROS2 color queue diagnostics --- .../4_application_guide/launch_parameters.md | 2 ++ .../4_application_guide/services.md | 16 ++++++++++++++++ .../4_application_guide/launch_parameters.md | 2 ++ .../4_application_guide/services.md | 16 ++++++++++++++++ 4 files changed, 36 insertions(+) diff --git a/docs/en/source/camera_devices/4_application_guide/launch_parameters.md b/docs/en/source/camera_devices/4_application_guide/launch_parameters.md index 90ca0939..2dd14698 100644 --- a/docs/en/source/camera_devices/4_application_guide/launch_parameters.md +++ b/docs/en/source/camera_devices/4_application_guide/launch_parameters.md @@ -65,6 +65,8 @@ The following are the launch parameters available: * For lower CPU usage, see the `color_format` recommendations in [Lower CPU Usage](../5_advanced_guide/performance/lower_cpu_usage.md). * **`enable_[color|depth|left_ir|right_ir|ir]`** * Enable or disable the corresponding image stream. +* **`color_frame_queue_max_frames`**, **`left_color_frame_queue_max_frames`**, **`right_color_frame_queue_max_frames`** + * Set the maximum number of color frames buffered by the corresponding color-frame worker. The default is `10`; when the queue is full, the oldest frame is discarded and the overflow counter is incremented. The current queue size and overflow counters can be queried with `/camera/get_color_queue_stats`. * **`[color|depth|left_ir|right_ir|ir]_rotation`** * Set stream image rotation. * The possible values are `0`, `90`, `180`, `270`. diff --git a/docs/en/source/camera_devices/4_application_guide/services.md b/docs/en/source/camera_devices/4_application_guide/services.md index aace7b64..9dc8d129 100644 --- a/docs/en/source/camera_devices/4_application_guide/services.md +++ b/docs/en/source/camera_devices/4_application_guide/services.md @@ -108,6 +108,22 @@ ros2 service call /camera/set_streams_enable std_srvs/srv/SetBool '{data: false}' ``` +### Color Queue Diagnostics + +* `/camera/get_color_queue_stats` + +This service uses `std_srvs/srv/SetBool`. Pass `false` to query the current statistics, or `true` to query and reset the accumulated statistics. + +```bash +ros2 service call /camera/get_color_queue_stats std_srvs/srv/SetBool '{data: false}' +``` + +The JSON response in `message` contains the total `overflow_count` and a `queues` object. Each enabled queue reports `capacity_frames`, `queue_size`, `max_queue_size`, `overflow_count`, `oldest_queue_wait_ms`, and `max_queue_wait_ms`. The service also reports the node `namespace` and whether the statistics were reset in `statistics_reset`. + +```bash +ros2 service call /camera/get_color_queue_stats std_srvs/srv/SetBool '{data: true}' +``` + ### Runtime Stream Configuration * `/camera/set_stream_profile` diff --git a/docs/zh/source/camera_devices/4_application_guide/launch_parameters.md b/docs/zh/source/camera_devices/4_application_guide/launch_parameters.md index 951af15f..42bf8b86 100644 --- a/docs/zh/source/camera_devices/4_application_guide/launch_parameters.md +++ b/docs/zh/source/camera_devices/4_application_guide/launch_parameters.md @@ -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`。 diff --git a/docs/zh/source/camera_devices/4_application_guide/services.md b/docs/zh/source/camera_devices/4_application_guide/services.md index 4ac6ca93..e9e4f4ee 100644 --- a/docs/zh/source/camera_devices/4_application_guide/services.md +++ b/docs/zh/source/camera_devices/4_application_guide/services.md @@ -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`