get_topic_rate
Measure a ROS 2 topic's average publish frequency over a set duration to diagnose slow or stalled data updates. Returns average_rate_hz and raw output for troubleshooting.
Instructions
限时统计话题发布频率:观察 duration_s 秒后返回平均频率。
何时用:排查"数据不更新/更新太慢"类问题——先看频率是否正常。 参数 topic:话题全名(/ 开头);duration_s:1~15 秒,默认 5。 返回:average_rate_hz(平均频率,未统计到时为 None)、raw_tail(原始输出尾部)。 note 字段会说明未统计到频率的原因。
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"topic": "<topic>"
},
"name": "get_topic_rate"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| topic | Yes | ||
| duration_s | No |