新增状态6: 驻车(任务开始前)

This commit is contained in:
Alvin-lyq 2026-04-15 11:25:13 +08:00
parent 191e630a41
commit 33f4ce28e0
2 changed files with 7 additions and 1 deletions

View File

@ -963,6 +963,12 @@ class fu_node : public rclcpp::Node
// ======== 计算行驶状态 ======== // ======== 计算行驶状态 ========
int16_t calculateDrivingStatus() int16_t calculateDrivingStatus()
{ {
// 状态6: 驻车(任务开始前)
if (!is_start)
{
return 6;
}
// 检查栅格数据新鲜度超过3秒认为数据过期 // 检查栅格数据新鲜度超过3秒认为数据过期
auto now = node_clock_->now(); auto now = node_clock_->now();
double grid_age = 0.0; double grid_age = 0.0;

View File

@ -19,7 +19,7 @@ struct GeneralMsg
int motorTemp = 0; // 电机温度 °C int motorTemp = 0; // 电机温度 °C
int controllerTemp = 0; // 控制器温度 °C int controllerTemp = 0; // 控制器温度 °C
int64_t timestamp = 0; // 时间戳 int64_t timestamp = 0; // 时间戳
int drivingStatus = 0; // 行驶状态0=正常行驶(默认1=遇障停车2=绕障中3=雷达数据超时停车4=RTK没信号停车5=到达终点停车 int drivingStatus = 6; // 行驶状态0=正常行驶(执行清扫任务1=遇障停车2=绕障中3=雷达数据超时停车4=RTK没信号停车5=到达终点停车6=驻车(任务开始前)
int driveMode = 0; // 驾驶模式0=本地模式1=自驾模式2=遥控模式3=远控模式 int driveMode = 0; // 驾驶模式0=本地模式1=自驾模式2=遥控模式3=远控模式
}; };