pico_interfaces

返回 ROS 2 工作空间

pico_interfaces 定义 ROS 2 的 MCU 下行消息。构建 pico_ros2 时,colcon build --packages-up-to pico_ros2 会一并构建本包。

MitCommands

pico_interfaces/msg/MitCommands 包含 commands 字段,是一个最多 32 项的 MitCommand 数组。驱动根据每项的 motor_id 定位电机,数组位置可以随消息变化。

MitCommand

字段 类型 含义 单位
motor_id uint8 电机编号,允许 0~31 —
valid bool 为 true 时,本次下行帧包含该电机指令 —
k_p float64 刚度系数 N·m/rad
k_d float64 阻尼系数 N·m·s/rad
q_r float64 参考位置 rad
dq_r float64 参考速度 rad/s
tau_ff float64 前馈力矩 N·m

在已加载工作空间的终端查看消息定义。

ros2 interface show pico_interfaces/msg/MitCommands

话题配置、校验规则和发送示例见 MIT 下行指令。串口中的字节布局见 MCU 下行协议。

在 GitHub 查看源文档