This commit is contained in:
root 2025-05-19 15:41:05 +08:00
parent 7924773826
commit 5b1b6092fc

View File

@ -172,8 +172,34 @@ private:
}
if (data_safe)
{
RCLCPP_INFO_STREAM(this->get_logger(), "Publishing ControlMsg:"
<< "\n mcu_enabled: " << msg.mcu_enabled
<< "\n brake: " << static_cast<int>(msg.brake)
<< "\n gear: " << static_cast<int>(msg.gear)
<< "\n rpm: " << msg.rpm
<< "\n brake_time_ms: " << msg.brake_time_ms
<< "\n angle: " << msg.angle
<< "\n angle_speed: " << msg.angle_speed
<< "\n main_brush_lift: " << msg.main_brush_lift
<< "\n edge_brush_lift: " << msg.edge_brush_lift
<< "\n vacuum: " << msg.vacuum
<< "\n spray: " << msg.spray
<< "\n mud_flap: " << msg.mud_flap
<< "\n dust_shake: " << msg.dust_shake
<< "\n left_light: " << msg.left_light
<< "\n right_light: " << msg.right_light
<< "\n night_light: " << msg.night_light
<< "\n brake_light: " << msg.brake_light
<< "\n headlight: " << msg.headlight
<< "\n main_brush_spin: " << msg.main_brush_spin
<< "\n edge_brush_spin: " << msg.edge_brush_spin
<< "\n main_brush_pwm: " << static_cast<int>(msg.main_brush_pwm)
<< "\n edge_brush_pwm: " << static_cast<int>(msg.edge_brush_pwm));
pub_->publish(msg); // 发布控制消息
}
}
// CAN反馈回调函数用于获取当前转向角度
void can_callback(const mc::msg::CanFrame::SharedPtr msg)