feat(hardware): 接入 SocketCAN 与智身模组协议,补温度诊断和指令看门狗
- hardware: 新增 can_bus.h / joint_module_protocol.h,实现使能/失能/运行帧与 12 字节反馈帧编解码;ReadHardware/WriteHardware 落地,控制字按协议语义映射 (kErrorReset 按重新使能处理,kGetStatus 无需请求) - hardware: 温度/驱动状态/电压经 /joint_diagnostics 发布(默认 10 Hz,可配置) - hardware: 指令看门狗,100 ms 无指令转阻尼,避免上游挂掉后重发最后一帧 - hardware: 限幅与归一化边界分离——[joint_limits] 是唯一实际限幅,加载期校验 其不超过 [motor.*] 的归一化边界;力矩按峰值扭矩夹紧,kp/kd 越界夹紧并告警 - hardware: require_can 开关,无 CAN 时可只发状态(冒烟测试用) - remote: 1002/4 关节按 M20 的 16 槽上报(swing→HipY、wheel→Wheel,其余占位 0), 1002/5 温度改由 /joint_diagnostics 提供 - deploy: 启动时序等订阅者出现再发(ROS1 无 latch,否则整段丢失) - msgs: 新增 JointDiagnostics - docs: 智身模组 CANFD 协议整理、待办清单
This commit is contained in:
@@ -121,7 +121,16 @@ protected:
|
||||
}
|
||||
|
||||
/// 使能时序:disable → error reset → enable;此后运行期恒为 motor control
|
||||
/// ⚠ ROS1 的发布没有 latch:订阅端连接建立前发出去的消息会被直接丢掉。
|
||||
/// 若 hardware 节点后启动(或本节点重启),一次性时序帧会整段丢失,
|
||||
/// 所以这里先等订阅者出现再发。
|
||||
void SendStartupSequence() {
|
||||
for (int i = 0; i < 200 && cmd_pub_.getNumSubscribers() == 0 && ros::ok(); ++i) {
|
||||
ros::Duration(0.01).sleep();
|
||||
}
|
||||
if (cmd_pub_.getNumSubscribers() == 0) {
|
||||
std::cout << "[InvictaInterface] 警告:joint_commands 还没有订阅者,启动时序可能丢失" << std::endl;
|
||||
}
|
||||
const uint16_t seq[] = {invicta_msgs::kDisable, invicta_msgs::kErrorReset, invicta_msgs::kEnable};
|
||||
for (uint16_t word : seq) {
|
||||
PublishRawCommand(word);
|
||||
|
||||
Reference in New Issue
Block a user