Files

56 lines
1.2 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# ROS 话题格式
通过 rosbridge WebSocket(`ws://192.168.0.11:9090`)发布,均为单向 `publish`(前端 → ROS),无订阅。
---
## 1. `/cmd_chassis` — 底盘控制
**类型:** `std_msgs/Float32MultiArray`
**格式:**
```json
{
"layout": { "dim": [], "data_offset": 0 },
"data": [0.5, 0.0]
}
```
`data` 字段:
| 索引 | 含义 | 单位 | 来源常量 |
|------|------|------|---------|
| `data[0]` | 线速度 | m/s | `BASE_SPEED` (0.5) |
| `data[1]` | 角速度(偏航) | 度/秒 | `YAW_VELOCITY` (1.0) |
---
## 2. `/cmd_gimbal` — 云台控制
**类型:** `geometry_msgs/Twist`
**格式:**
```json
{
"linear": { "x": 0, "y": 0, "z": 0 },
"angular": { "x": 0, "y": 10.0, "z": 0 }
}
```
`angular` 字段:
| 字段 | 含义 | 单位 | 来源常量 |
|------|------|------|---------|
| `angular.y` | 俯仰角速度 (pitch) | 度/秒 | `GIMBAL_PITCH_DEG_S` (10) |
| `angular.z` | 偏航角速度 (yaw) | 度/秒 | `GIMBAL_YAW_DEG_S` (10) |
`linear` 字段保留填零,云台无平移运动。
---
## 3. 发布频率
发布频率常量 `PUBLISH_RATE = 30` Hz,但在 ManualMode 中实际采用 on-demand 模式:仅当键盘按住、且速度值有变化时才发布。