This commit is contained in:
2026-04-04 15:59:11 +08:00
parent 7d010a85c3
commit ee63bee6e5
3 changed files with 11 additions and 6 deletions

View File

@@ -4,6 +4,7 @@
*/
#include "nav_script.h"
#include "est/corridor_filter.h"
#include <stdint.h>
#include <stdbool.h>
#include <math.h>
@@ -215,6 +216,10 @@ void NavScript_Update(const CorridorObs_t *obs,
/* 转向完成 -> 决定下一步 */
if (s_internal.pass_count < 2) {
/* 只走了一遍,往回走 */
/* 180° 掉头后,走廊方向基准已经翻转。
* 必须清空上一趟的 EKF/IMU 航向参考,避免返程首拍把新朝向
* 误判成大航向误差,导致一恢复闭环就猛打方向。 */
CorridorFilter_Reset();
s_internal.pass_count++;
s_stage = SCRIPT_STAGE_CORRIDOR_BACKWARD;
} else {