0129
This commit is contained in:
parent
02f0b42d36
commit
d7ae466462
3122
gps_load_now.txt
3122
gps_load_now.txt
File diff suppressed because it is too large
Load Diff
0
routes/gps_load_1769663101074.txt
Normal file
0
routes/gps_load_1769663101074.txt
Normal file
8
routes/gps_load_1769663889258.txt
Normal file
8
routes/gps_load_1769663889258.txt
Normal file
@ -0,0 +1,8 @@
|
||||
32.0308500220
|
||||
120.91511424200
|
||||
0.000000
|
||||
0.000000
|
||||
0.0000000000
|
||||
0.00000000000
|
||||
0.000000
|
||||
0.000000
|
||||
1180
routes/gps_load_1769672776320.txt
Normal file
1180
routes/gps_load_1769672776320.txt
Normal file
File diff suppressed because it is too large
Load Diff
4
routes/gps_load_1769673831859.txt
Normal file
4
routes/gps_load_1769673831859.txt
Normal file
@ -0,0 +1,4 @@
|
||||
32.0937184760
|
||||
120.79454789700
|
||||
84.724998
|
||||
0.000000
|
||||
2976
routes/gps_load_1769674440790.txt
Normal file
2976
routes/gps_load_1769674440790.txt
Normal file
File diff suppressed because it is too large
Load Diff
@ -97,7 +97,7 @@ class SBUSNode : public rclcpp::Node
|
||||
}
|
||||
|
||||
// 油门 / 刹车逻辑
|
||||
if (speed < 0)
|
||||
if (speed <= 0)
|
||||
{
|
||||
msg.brake = 1;
|
||||
msg.rpm = 0;
|
||||
@ -138,33 +138,34 @@ class SBUSNode : public rclcpp::Node
|
||||
// 发布控制消息
|
||||
pub_->publish(msg);
|
||||
|
||||
// 降低打印频率:每 PRINT_INTERVAL 次回调打印一次
|
||||
// if (++print_counter >= PRINT_INTERVAL)
|
||||
// {
|
||||
// LOG_INFO("\n=====================================")
|
||||
// << "\n 刹车: " << (msg.brake ? "已刹车" : "未刹车")
|
||||
// << "\n 挡位: ";
|
||||
// switch (msg.gear)
|
||||
// {
|
||||
// case 0:
|
||||
// LOG_INFO("空挡");
|
||||
// break;
|
||||
// case 2:
|
||||
// LOG_INFO("前进挡");
|
||||
// break;
|
||||
// case 1:
|
||||
// LOG_INFO("后退挡");
|
||||
// break;
|
||||
// default:
|
||||
// LOG_INFO("未知挡位(%d)", static_cast<int>(msg.gear));
|
||||
// break;
|
||||
// }
|
||||
// LOG_INFO("\n 行走电机转速: %d RPM", static_cast<int>(msg.rpm));
|
||||
// << "\n 轮端转向角度: " << msg.angle << "°"
|
||||
// << "\n 清扫状态: " << (msg.sweep ? "正在清扫" : "未清扫")
|
||||
// << "\n=====================================" << std::endl;
|
||||
// print_counter = 0; // 重置计数器
|
||||
// }
|
||||
if (++print_counter >= PRINT_INTERVAL)
|
||||
{
|
||||
LOG_INFO(
|
||||
"=====================================\n"
|
||||
" 刹车: %s\n"
|
||||
" 挡位: %s\n"
|
||||
" 行走电机转速: %d RPM\n"
|
||||
" 轮端转向角度: %.1f °\n"
|
||||
" 清扫状态: %s\n"
|
||||
"=====================================",
|
||||
msg.brake ? "已刹车" : "未刹车",
|
||||
[&]()
|
||||
{
|
||||
switch (msg.gear)
|
||||
{
|
||||
case 0:
|
||||
return "空挡";
|
||||
case 1:
|
||||
return "后退挡";
|
||||
case 2:
|
||||
return "前进挡";
|
||||
default:
|
||||
return "未知挡位";
|
||||
}
|
||||
}(),
|
||||
static_cast<int>(msg.rpm), msg.angle, msg.sweep ? "正在清扫" : "未清扫");
|
||||
print_counter = 0; // 重置计数器
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Loading…
Reference in New Issue
Block a user