sample_topic
Capture up to a specified number of messages from a ROS 2 topic within a timeout, returning raw data to verify field values and message content.
Instructions
限时采样话题内容:抓取最多 max_messages 条消息,或 timeout_s 秒到期即停。
何时用:想看某话题里数据实际长什么样、字段值是否合理。
参数 topic:话题全名(/ 开头);max_messages:150 条,默认 5;
timeout_s:115 秒,默认 5。命令一定会在限时内返回,不会挂起。
返回:messages_received(实际条数)、stopped_because
(message_limit / timeout / publisher_stopped)、raw(消息原文,未解析)。
采样窗口内无消息时 note 字段会说明(话题可能没有发布者)。
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| topic | Yes | ||
| timeout_s | No | ||
| max_messages | No |