This commit is contained in:
lyq 2026-01-29 17:06:08 +08:00
parent 02f0b42d36
commit d7ae466462
7 changed files with 7100 additions and 247 deletions

File diff suppressed because it is too large Load Diff

View File

View File

@ -0,0 +1,8 @@
32.0308500220
120.91511424200
0.000000
0.000000
0.0000000000
0.00000000000
0.000000
0.000000

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,4 @@
32.0937184760
120.79454789700
84.724998
0.000000

File diff suppressed because it is too large Load Diff

View File

@ -97,7 +97,7 @@ class SBUSNode : public rclcpp::Node
} }
// 油门 / 刹车逻辑 // 油门 / 刹车逻辑
if (speed < 0) if (speed <= 0)
{ {
msg.brake = 1; msg.brake = 1;
msg.rpm = 0; msg.rpm = 0;
@ -138,33 +138,34 @@ class SBUSNode : public rclcpp::Node
// 发布控制消息 // 发布控制消息
pub_->publish(msg); pub_->publish(msg);
// 降低打印频率:每 PRINT_INTERVAL 次回调打印一次 if (++print_counter >= PRINT_INTERVAL)
// if (++print_counter >= PRINT_INTERVAL) {
// { LOG_INFO(
// LOG_INFO("\n=====================================") "=====================================\n"
// << "\n 刹车: " << (msg.brake ? "已刹车" : "未刹车") " 刹车: %s\n"
// << "\n 挡位: "; " 挡位: %s\n"
// switch (msg.gear) " 行走电机转速: %d RPM\n"
// { " 轮端转向角度: %.1f °\n"
// case 0: " 清扫状态: %s\n"
// LOG_INFO("空挡"); "=====================================",
// break; msg.brake ? "已刹车" : "未刹车",
// case 2: [&]()
// LOG_INFO("前进挡"); {
// break; switch (msg.gear)
// case 1: {
// LOG_INFO("后退挡"); case 0:
// break; return "空挡";
// default: case 1:
// LOG_INFO("未知挡位(%d)", static_cast<int>(msg.gear)); return "后退挡";
// break; case 2:
// } return "前进挡";
// LOG_INFO("\n 行走电机转速: %d RPM", static_cast<int>(msg.rpm)); default:
// << "\n 轮端转向角度: " << msg.angle << "°" return "未知挡位";
// << "\n 清扫状态: " << (msg.sweep ? "正在清扫" : "未清扫") }
// << "\n=====================================" << std::endl; }(),
// print_counter = 0; // 重置计数器 static_cast<int>(msg.rpm), msg.angle, msg.sweep ? "正在清扫" : "未清扫");
// } print_counter = 0; // 重置计数器
}
} }
else else
{ {