From a9ec02dc9394f364858746d5c682485e863e3432 Mon Sep 17 00:00:00 2001 From: nitiantuhao <2062405236@qq.com> Date: Tue, 7 Apr 2026 21:43:23 +0800 Subject: [PATCH] 1.0 --- App/app_tasks.c | 5 +++-- App/preproc/corridor_msgs.h | 2 +- App/robot_params.h | 10 ++++++++-- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/App/app_tasks.c b/App/app_tasks.c index 786b841..ebf2bec 100644 --- a/App/app_tasks.c +++ b/App/app_tasks.c @@ -278,8 +278,9 @@ void AppTasks_RunNavTask_Impl(void *argument) const uint32_t period_ticks = AppTasks_MsToTicks(20U); uint32_t last_ms = HAL_GetTick(); - /* 等传感器全部就绪再启动 (避免刚上电全是脏数据) */ - osDelay(500); + /* 等传感器全部就绪再启动 (避免刚上电全是脏数据)。 + * 实车上 IMU 清零和多路测距任务稳定需要数秒,500ms 不够。 */ + osDelay(PARAM_NAV_STARTUP_DELAY_MS); #if USE_GLOBAL_NAV GlobalNav_Start(); /* 开始赛道级导航 */ diff --git a/App/preproc/corridor_msgs.h b/App/preproc/corridor_msgs.h index 26ce9cc..daa5df8 100644 --- a/App/preproc/corridor_msgs.h +++ b/App/preproc/corridor_msgs.h @@ -72,4 +72,4 @@ typedef enum { SAFETY_MODE_STRAIGHT // 直行段: 前后激光防撞, 不检查 conf } SafetyMode_t; -#endif // CORRIDOR_MSGS_H \ No newline at end of file +#endif // CORRIDOR_MSGS_H diff --git a/App/robot_params.h b/App/robot_params.h index b43a6a6..e7f7948 100644 --- a/App/robot_params.h +++ b/App/robot_params.h @@ -410,6 +410,12 @@ extern "C" { /** @brief 编译开关:1=赛道模式(6沟S型遍历) 0=单沟测试模式(原nav_script) */ #define USE_GLOBAL_NAV 1 +/** @brief 上电后导航启动延迟 [ms] + * 用于等待 IMU 清零、VL53 连续测距和前后激光任务稳定, + * 避免刚上电时用到脏数据导致错误入场或异常转向。 + */ +#define PARAM_NAV_STARTUP_DELAY_MS 5000U + /* --- 入场段 --- */ /* 启动区入口(Y=40)距第一条垄沟(Y=36~39)极近,入场距离仅约 10~40cm */ #define PARAM_GNAV_ENTRY_V 0.08f /* m/s — 入场速度 (沿左端纵向通道向北) */ @@ -424,7 +430,7 @@ extern "C" { #define PARAM_GNAV_TURN_TIMEOUT 8000U /* ms — 单次转向超时 */ /* --- 重捕获 --- */ -#define PARAM_GNAV_REACQUIRE_V 0.05f /* m/s — 重捕获入沟速度 */ +#define PARAM_GNAV_REACQUIRE_V 0.1f /* m/s — 重捕获入沟速度 */ #define PARAM_GNAV_REACQUIRE_CONF 0.6f /* — 重捕获置信度阈值 */ #define PARAM_GNAV_REACQUIRE_WIDTH_TOL 0.05f /* m — 走廊宽度容差 */ #define PARAM_GNAV_REACQUIRE_TICKS 5 /* 拍 — 连续确认次数 (5×20ms=100ms) */ @@ -432,7 +438,7 @@ extern "C" { /* --- 沟内 --- */ #define PARAM_GNAV_CORRIDOR_MAX_LEN 2.50f /* m — 沟内里程保护上限 */ -#define PARAM_GNAV_CORRIDOR_END_DIST 0.10f /* m — 到端检测距离 */ +#define PARAM_GNAV_CORRIDOR_END_DIST 0.05f /* m — 到端检测距离 */ /* --- 连接段 --- */ /* 在纵向端部通道里北行,从一条垄沟入口到下一条入口,距离=垄沟宽40cm+垄背宽30cm=70cm */