关节状态接口
关节参数读取 — basic_server
Section titled “关节参数读取 — basic_server”| 属性 | 值 |
|---|---|
| Type | 1002 |
| Command | 4 |
| 上报频率 | 10Hz(主动上报) |
| 数据路径 | Items.MotorStatus |
文档中出现的所有 Type / Command 均为十进制数字。
MotorStatus 字段(关节状态)
Section titled “MotorStatus 字段(关节状态)”MotorStatus 包含关节位置和速度数据:
| 字段 | 类型 | 单位 | 说明 |
|---|---|---|---|
| Joint[] | float[16] | rad 或 rad/s | 16 个关节角度/转速(按上述关节顺序) |
HipX、HipY、Knee 关节上报的数据为角度(rad);Wheel 关节上报的数据为转速(rad/s)。
关节参数读取和控制指令下发 — ROS2
Section titled “关节参数读取和控制指令下发 — ROS2”关节相关的 ROS2 话题为 rl_deploy 运动控制部署节点使用的自定义话题,在 31 和 33 网段的主机上均可订阅:
| 话题 | 消息类型 | 说明 |
|---|---|---|
| /JOINTS_DATA | drdds/msg/JointsData | 关节状态反馈(位置、速度) |
| /JOINTS_CMD | drdds/msg/JointsDataCmd | 关节控制指令下发 |
关节温度监控 — basic_server
Section titled “关节温度监控 — basic_server”| 属性 | 值 |
|---|---|
| Type | 1002 |
| Command | 5 |
| 上报频率 | 2Hz(主动上报) |
| 数据路径 | Items.DeviceTemperature |
文档中出现的所有 Type / Command 均为十进制数字。
DeviceTemperature 字段
Section titled “DeviceTemperature 字段”| 字段 | 类型 | 单位 | 说明 |
|---|---|---|---|
| Motor[] | float[16] | ℃ | 16 个关节电机温度(按上述关节顺序) |
| Driver[] | float[16] | ℃ | 16 个关节驱动器温度(按上述关节顺序) |
该上报以 2Hz 频率周期性主动推送,需客户端持续发送心跳。
上报数据中 DeviceTemperature 部分示例:
"DeviceTemperature": { "Motor": [42.1, 43.5, 45.2, 38.0, 41.8, 42.9, 44.8, 37.5, 40.3, 41.7, 43.6, 36.8, 41.0, 42.3, 44.1, 37.2], "Driver": [39.5, 40.2, 41.8, 35.1, 38.9, 40.0, 41.5, 34.8, 38.1, 39.4, 40.9, 34.2, 38.6, 39.8, 41.2, 34.5]}关节相关异常通过 Type=1002 Cmd=3(错误状态上报,2Hz + 变更时额外上报)返回。
以下为关节相关错误码:
| 错误码(十六进制) | 含义 | 级别 |
|---|---|---|
| 0x8001 | 电机温度警告(Motor temp warning) | 警告 |
| 0x8002 | 电机温度过高保护(Motor temp over-high protection) | 保护 |
| 0x8003 | 电机温度致命切断(Motor temp fatal cutoff) | 故障 |
| 0x8007 | 关节驱动器过温(Joint driver overtemp) | 保护 |
| 0x8008 | 驱动器欠压(Driver undervoltage) | 保护 |
| 0x8009 | 驱动器过压(Driver overvoltage) | 保护 |
| 0x8012 | 关节驱动器通信超时(Joint driver comm timeout) | 故障 |
| 0x8016 | 编码器无数值(Encoder no value) | 故障 |
| 0x8020 | 驱动器过流(Driver overcurrent) | 保护 |
| 0x8021 | 温度传感器断连(Temp sensor disconnected) | 故障 |
| 0x8022 | 关节角度超限(Joint angle over limit) | 保护 |
| 0x8024 | 关节数据 NaN(Joint data NaN) | 故障 |
| 0x8025 | 关节数据更新错误(Joint data update error) | 故障 |
| 0x8027 | 机身姿态错误(Body attitude error) | 保护 |
| 0x8028 | 驱动器状态错误(Driver status error) | 故障 |
| 0x8029 | 运动姿态错误(Motion attitude error) | 保护 |
| 0x8030 | 关节驱动器过温警告(Joint driver overtemp warning) | 警告 |
M20s 运控状态上报
Section titled “M20s 运控状态上报”适用型号:M20s。 以下内容仅适用于山猫 M20s,基于 robotserver 新协议(消息码与 M20 不同,协议总则见通信架构中的 M20s 章节)。
该消息类型以 10Hz 的频率向持续发送心跳的客户端主动上报,用户可通过该上报获取机器人当前的运动控制状态信息。
| Type | Command | 消息类型 |
|---|---|---|
| 1048577(0x0010 0001) | 15728640(0x00f0 0000) | 获取机器人运控状态信息 |
JSON 格式上报:
{ "PatrolDevice": { "Type": 1048577, "Command": 15728640, "Time": "2026-01-01 00:00:00.000", "Items": { "MotionStatus": { "AccX": 0, "AccY": 0, "AccZ": 0, "AngularZ": 0, "Gait": 0, "Height": 0, "LinearX": 0, "LinearY": 0, "MotionState": 0, "OmegaX": 0, "OmegaY": 0, "OmegaZ": 0, "Payload": 0, "Pitch": 0, "RemainMile": 0, "Roll": 0, "Yaw": 0 }, "MotorStatus": { "Joint": [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] } } }}Items 字段包含 MotionStatus 和 MotorStatus 两组参数。
MotionStatus(M20s)
Section titled “MotionStatus(M20s)”MotionStatus 参数组反馈机器人整机的运动状态信息:
| 参数项 | 含义 | 数据类型 | 单位 |
|---|---|---|---|
| AccX / AccY / AccZ | x / y / z 方向加速度 | float | m/s² |
| Roll | 滚转角 | float | rad |
| Pitch | 俯仰角 | float | rad |
| Yaw | 偏航角 | float | rad |
| OmegaX / OmegaY / OmegaZ | 绕 IMU 的 x / y / z 轴旋转的角速度 | float | rad/s |
| LinearX | 当前 x 方向自身线速度 | float | m/s |
| LinearY | 当前 y 方向自身线速度 | float | m/s |
| AngularZ | 当前 yaw 角速度 | float | rad/s |
| Gait | 运动姿态 | int | / |
| MotionState | 运动模式 | int | / |
| Height | 当前自身高度 | float | m |
| Payload | 当前负载 | float | kg |
| RemainMile | 预测剩余里程 | float | km |
注意: Payload、Height 参数上报的是机器人当前状态的估算值,可能与实际存在偏差,仅供状态参考。
MotorStatus(M20s)
Section titled “MotorStatus(M20s)”MotorStatus 参数组反馈机器人各个关节的运动状态信息:
| 参数项 | 含义 | 数据类型 | 单位 |
|---|---|---|---|
| Joint | 机器人关节角度 | array<float> | rad |
Joint 为长度为 16 的数组,按顺序依次表示:
- LeftFrontHipX、LeftFrontHipY、LeftFrontKnee、LeftFrontWheel
- RightFrontHipX、RightFrontHipY、RightFrontKnee、RightFrontWheel
- LeftBackHipX、LeftBackHipY、LeftBackKnee、LeftBackWheel
- RightBackHipX、RightBackHipY、RightBackKnee、RightBackWheel
DeviceTemperature(M20s)
Section titled “DeviceTemperature(M20s)”关节电机与驱动器温度通过设备状态上报(2Hz)中的 Items.DeviceTemperature 字段获取:
| Type | Command | 消息类型 |
|---|---|---|
| 1048578(0x0010 0002) | 15728640(0x00f0 0000) | 获取机器人设备状态信息 |
| 参数项 | 含义 | 数据类型 | 单位 |
|---|---|---|---|
| Motor | 电机温度列表(16 关节) | array<float> | ℃ |
| Driver | 电机驱动器温度列表(16 关节) | array<float> | ℃ |
上报数据中 DeviceTemperature 部分示例:
"DeviceTemperature": { "Motor": [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], "Driver": [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]}基础状态(运动状态、步态、使用模式、充电状态等)上报请参见运动控制状态接口中的 M20s 章节。