# Nav2 PathAlignCritic因offset_from_furthest阈值过高静默失效

> 原文链接：https://robotics.hellobike.com/pitfalls/2026-11-27-navigation2-6862
> 频道：pitfalls | 更新日期：2026-11-27 | 标签：auto, github-issue, navigation2
> 核心摘要：PathAlignCritic在offset_from_furthest未达阈值时直接跳过评分且无日志，需按公式重算参数并修正文档默认值认知。

# Nav2 PathAlignCritic因offset_from_furthest阈值过高静默失效

::: v-pre
> 本文由 AI 根据公开内容整理，可能有误，请以原文为准：[offset_from_furthest means two different things across three critics, and the one with the highest default fails silently](https://github.com/ros-navigation/navigation2/issues/6862)（GitHub ros-navigation/navigation2 #6862）

**状态**：有绕过办法

## 问题

Nav2中PathAlignCritic、PathFollowCritic与PathAngleCritic对offset_from_furthest处理逻辑不一致。PathAlignCritic在轨迹未达该阈值时直接返回score()导致评分完全失效且无日志提示，造成调参cost_weight无效。此外PathAngleCritic文档默认值20与源码及示例配置的4不符，误导配置。

## 环境

ROS Navigation2 (Rolling分支)

## 解决办法

1. 排查PathAlignCritic失效时，检查offset_from_furthest是否过大，该参数过大会导致Critic被完全跳过而非仅钳位。
2. 依据调优公式 `prediction_horizon_s * max_speed / path_resolution / 3.0` 重新计算offset_from_furthest基准值，确保其适配当前路径分辨率。
3. 注意PathAngleCritic实际默认值为4而非文档所述20，配置时应以源码或官方示例为准。
4. 区分三个Critic行为差异：PathFollowCritic和PathAngleCritic使用std::min钳位继续执行，仅PathAlignCritic会因阈值不足而静默退出。

讨论原作者：@skunal3318 等，版权归原作者所有。
:::

## 原始参考来源 (Sources)

- [GitHub ros-navigation/navigation2 #6862：offset_from_furthest means two different things across three critics, and the one with the highest default fails silently](https://github.com/ros-navigation/navigation2/issues/6862)