fix(env_monitor): ignore relocalization pose jumps, veto confined gate on proven progress

Sim 6/11 20:34: AMCL "Setting pose" pulled the map pose back 1.2 m while the
robot drove straight. EnvMonitor counted the jump as travel, the 20 s position
window folded onto itself and the confined gate fired a false stall.

- env_monitor/pose_jump_reject [m] (default 0.5, 0 = off): a pose step larger
  than this plus the reachable distance since the last valid pose is a reset,
  not travel. Stall windows restart at most once per longest position window;
  repeated jumps are reported but keep the windows. The jump distance is added
  to the cost_jump allowance. The control loop passes NaN when there is no pose
  and logs each jump as a warning.
- env_monitor/stall/progress_veto (default true): the confined gate does not
  fire while every eff measured in confine_window_s is >= eff_off. The idle gate
  is not vetoed; a cost jump breaks the proof.
- Tests: env_monitor_test 66 (3 new cases fail on the old code),
  config_validation_test 37.

Config runtime: the two keys above; lane_route_planner zone_deviation_weight and
output_endpoint_spins (R2.12), route_too_long_* marked as compatibility keys;
DirectionalLayer type unquoted in the no-virtual-walls global plugin list.
This commit is contained in:
2026-11-12 10:23:23 +07:00
parent 42b03e0d78
commit 5882082172
9 changed files with 609 additions and 24 deletions

View File

@@ -37,6 +37,16 @@ env_monitor:
# [s] Sau khi nhận plan mới (planner hay detour) không kết luận gì: mẫu cũ thuộc plan cũ.
grace_after_new_plan: 1.0
# [m] Pose dời quá (đây + tốc độ lớn nhất trong khoảng mất pose x thời gian từ pose hợp lệ trước) = pose bị ĐẶT LẠI
# (AMCL "Setting pose", /initialpose, TF đứng rồi chạy lại). Cú dời không cộng vào quãng đường (replan_budget,
# standdown). Cửa sổ stall đo lại tối đa một lần mỗi khoảng dài nhất của idle_window_s, confine_window_s và
# disp_window_s; cú nhảy lặp vẫn được báo nhưng giữ cửa sổ để robot kẹt thật còn được phát hiện.
# Sim 6/11 20:34: AMCL kéo pose lùi 1.2 m lúc robot chạy thẳng 0.3 m/s -> quỹ đạo 20 s gấp lên chính nó -> cổng giam
# vùng nổ oan -> detour_path vô ích. 0 = TẮT (cú dời tính như quãng đi, như bản cũ).
# ► Chỉnh: phải lớn hơn bước sửa pose bình thường của localization (AMCL vài cm). HẠ (0.3) nếu localization hay giật
# 0.3–0.5 m mà vẫn thấy stall oan; ĐỪNG hạ dưới 0.2 — bước sửa thường sẽ bị coi là nhảy và làm giảm quãng đường đo.
pose_jump_reject: 0.5
# --- Thân robot và ngữ nghĩa vật cản --------------------------------------------------------------
body:
# [m] mũi / đuôi / nửa bề rộng từ base_link. CẢ BA = 0 = lấy footprint KHÔNG đệm của costmap mỗi lượt
@@ -116,6 +126,13 @@ env_monitor:
confine_window_s: 20.0 # [s] GIẢM (15) để nổ sớm hơn; TĂNG (30) nếu thấy nổ khi robot né vòng rộng hợp lý.
confine_radius: 1.2 # [m] vùng lớn hơn đây không gọi là giam. TĂNG (1.5) nếu local minimum của bãi rộng hơn.
confine_cmd_factor: 1.5 # [-] lệnh phải gấp chừng này lần đường kính vùng. GIẢM (1.2) nếu thấy quần chậm mà không nổ.
# Sim chạy chậm hơn thời gian thực (RTF < 1) thì lệnh tích luỹ bị phóng to 1/RTF so với quãng đi
# thật: RTF 0.66 (sim 6/11) là hệ số 1.5 mất tác dụng — chỉ còn confine_radius chặn ca đi thẳng.
progress_veto: true # true = cổng giam vùng KHÔNG nổ khi tiến độ đã chứng minh: mọi eff đo được trong
# confine_window_s gần nhất đều >= eff_off (và eff gần nhất mới hơn window_s). Plan có vòng quay đầu
# (planner chỉ đi tiến) giữ robot trong vòng nhỏ mà cost_to_go vẫn giảm đều -> không phải kẹt.
# Cost nhảy sẽ huỷ bằng chứng trong confine_window_s; cổng đứng yên không bị phủ quyết.
# false = giam vùng xét hình học vị trí bất kể cost_to_go.
retry_backoff: 3.0 # [s] sau một lượt recovery HỎNG không tích bằng chứng (thay cho behavior wait).
# --- unreachable: không còn đường trong cửa sổ tới điểm thoát -> cờ path_blocked -> route path_blocked --