Commit Graph

100 Commits

Author SHA1 Message Date
ee3657fefb config(runtime): drop prior_frame and the wall core threshold keys
Both detectors now use robot_base_frame. sim_wall_pair keeps only
tape_min_intensity; core threshold and plateau fraction take their defaults.
2026-11-12 17:01:54 +07:00
154fb7d091 feat(planner_runner): bind dock_maximum_cusp_distance per docking marker
Copies the per-marker cusp-to-goal cap to the DockPlanner namespace and clears it
with YAML null when the next marker does not declare it. dock_global_params.yaml
gets the default maneuver/maximum_cusp_distance: 0.0 (no cap).
2026-11-12 16:28:15 +07:00
dd0a657947 config(runtime): wall reflector station for the Gazebo test (detect + GoToWallStation)
- action_handlers: detect_wall_reflector (WallReflectorDetectionActionHandler,
  rear /b_scan, backward entry) with the sim profile sim_wall_pair: strips
  0.03 m wide, 0.09 m apart, Gazebo laser_retro intensity, offset_x 0.85.
  SIM-ONLY numbers; the robot profile lives in rb_ws.
- compound_actions: GoToWallStation = DetectWallReflectors, then move_to
  wall_reflector_target with profile docking and marker wall_station.
- maker_sources: wall_station in the allow-list and its profile
  (DockPlanner + HybridDockingLocalPlanner, dock_anchor mating_edge,
  dock_face_offset 0.85 = offset_x, dock_straight_length 0.3).
2026-11-12 15:44:27 +07:00
0d00c22fe8 feat(planner_runner): bind dock_straight_length per docking marker
A docking marker profile can now override DockPlanner's
terminal/straight_length with dock_straight_length (dock_planner c94c5b2).
It goes through the same path as dock_face_offset and
dock_pivot_safety_margin: copied into the planner namespace when the marker
declares it, written as YAML null when the next marker does not, so one
marker's value never leaks into another and the global default stays
untouched. Valid for every dock_anchor.

- Test: copied for the marker that declares it, null and rebuilt for the
  next marker, restored when the first marker comes back, and
  terminal/straight_length is never written.
- maker_sources.yaml / dock_global_params.yaml: document the key.
2026-11-12 15:44:14 +07:00
5882082172 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.
2026-11-12 10:23:23 +07:00
42b03e0d78 config(runtime): lane route planner, zone layers, trolley detection, MPCC profiles
- Position profile uses LaneRoutePlanner with PriestMpccLocalPlanner; new
  lane_route_planner_params.yaml, mpcc_local_planner_params.yaml and
  priest_mpcc_local_planner_params.yaml.
- Global costmap: DirectionalLayer plus forbidden/preferred/unpreferred zone
  layers (directional_layer_params.yaml) and the reference graph keys; the
  local costmap keeps the reference graph off.
- TrolleyDetectionActionHandler and a DetectTrolley compound action.
- Dock global planner notes (mating_edge, dock_face_offset), priest planner
  tuning, sbpl primitive path moved to pnkx_nav_core.
- Sim launch defaults to robot_type hook_150.
2026-11-10 16:38:10 +07:00
051e18f989 feat(move_base2): direction zone delivery and costmap readiness wait
- SensorGateway::pushStaticMap also dispatches to DIRECTIONAL_LAYER on
  the global costmap, before STATIC_LAYER: with a same-geometry map the
  directional layer goes PENDING before StaticLayer can report current,
  so a plan cannot pair the new map with the old zones.
- Static maps are replayed in arrival order instead of topic order, so a
  direction grid is never replayed before its static map.
- PlannerRunner checks every enabled global layer under the same lock as
  the snapshot. While a layer is not current it keeps the goal, reports
  waiting_for_costmap, logs the stale layers (throttled) and spends no
  planner_patience or watchdog budget. After costmap_ready_timeout [s]
  (default 10, 0 = legacy behaviour) the attempt fails as before. The
  key is added to config/runtime/move_base_common_params.yaml.
- Test fixture destroys the server before its fake ports (the control
  thread could call a destroyed port).

Full history: branch feature/direction-zone.
2026-11-04 13:24:22 +07:00
75af8ccf12 feat(planner_runner): bind dock_face_offset and dock_pivot_safety_margin per marker
Two new DockPlanner keys, valid only with dock_anchor: mating_edge, are copied from
docking_marker_profiles/<marker> into the planner namespace like footprint_dock and
dock_anchor.

Unlike those two, the new keys are optional. A marker that does not declare one would keep
the value bound by the previous marker, so the charger's smaller pivot margin could leak
into a later trolley docking. When the marker lacks a key that the planner namespace still
holds, the binder writes a YAML null, which DockPlanner reads as unset, and counts it as a
change so that the instance is rebuilt. footprint_dock and dock_anchor keep their old
behaviour.
2026-10-29 16:54:02 +07:00
c3c64919d3 feat(control_loop): reserve backup_global_planner for the position profile
A failed primary global planner on a docking, go_straight or rotate request no longer swaps to backup_global_planner. It goes straight to the planning_failed recovery route and aborts. Only the position profile may use the backup planner. Update STATE_MACHINE.md and add test NonPositionPlannerFailureSkipsBackup.
2026-10-27 13:09:30 +07:00
ea7f9659b8 feat(sensor_gateway): feed DepthCameraObstacleLayer through its own LayerType
robot_costmap_2d has LayerType::DEPTH_CAMERA_LAYER for
DepthCameraObstacleLayer. The gateway now pushes PointCloud2 to that type
as well as to VOXEL_LAYER, in both the local and the global costmap.
LaserScan, PointCloud and DepthCameraData stay VOXEL_LAYER only: the layer
marks and clears from the filtered camera cloud and does not use the depth
image.

Needs robot_costmap_2d main 64974d4 or later (the enum value).

Squashed from feature/depth-camera-layer-type (c280a0a..d3a9208).
2026-10-21 14:21:53 +07:00
8977e5ec14 docs: trỏ EnvMonitor sang Test/docs/move_base2/, xoá PLAN_LIFECYCLE đã chuyển, priest num_obs_proj 200
- Comment trong include/move_base2 (config, control_loop, core/env_monitor, core/grid_analysis,
  io/env_logger, ports/environment_port), src/control_loop.cpp và test/walking_skeleton_test.cpp:
  đường dẫn ENV_MONITOR_PLAN.md đổi từ Test/ sang Test/docs/move_base2/. Không đổi dòng code nào.
- docs/PLAN_LIFECYCLE_CANCEL_PAUSE_RESUME.md: xoá, bản plan đã nằm ở Test/docs/move_base2/.
- config/runtime/priest_local_planner_params.yaml: num_obs_proj 90 -> 200 (số vật cản gần nhất
  đưa vào phép chiếu ADMM), giữ theo quyết định của người dùng.
2026-10-03 15:36:15 +07:00
490f48becb Revert "feat: tiep nhan route graph (Voronoi) cho global planner + anytime ARA* schema, don doc EnvMonitor"
This reverts commit f4f99650df.
2026-10-03 15:30:15 +07:00
f4f99650df feat: tiep nhan route graph (Voronoi) cho global planner + anytime ARA* schema, don doc EnvMonitor
- navigation_server: them addRouteGraph(topic, RouteGraph), day vao sensor_store cung namespace
  addStaticMap; consumer (SBPLLatticePlanner) tu doi chieu map_hash.
- PlannerRunner: them setSensorReader()/attachSensors() - trao SensorReader cho global planner
  nao ke thua robot_sensor_ports::SensorConsumer, goi TRUOC initialize() (dynamic_cast, giong co
  che ControllerRunner dang dung).
- sensor_store_params.yaml: khai topic /route_graph (data_type RouteGraph, capacity 1).
- sbpl_global_params.yaml (config/runtime): dong bo schema initial_epsilon/final_epsilon/
  eps_step/repair_time/return_first_solution + khoi voronoi_corridor (xem pnkx_nav_core
  c52cbe5, Test/sbpl_lattice_planner cho code doc cac khoa nay).
- launch: them arg launch_prefix (vd "stdbuf -oL" - robot::log_* dung printf khong flush, qua
  `| tee` bi block-buffer 8 KB lam log dung o dong cu du node con chay); them
  route_graph_maps_dir/route_graph_topic cho amr_node doc file voronoi.json theo map dang kich hoat.
- docs: xoa PLAN_LIFECYCLE_CANCEL_PAUSE_RESUME.md (don sang Test/docs/move_base2/), sua duong dan
  ENV_MONITOR_PLAN.md trong comment cac header EnvMonitor lien quan.
2026-09-22 15:31:43 +07:00
1e8abf2ce4 perf: global planner doc snapshot costmap thay vi giu mutex het luot makePlan
PlannerRunner truoc gio giu Costmap2D mutex suot makePlan() (giao thuc gen-1) - SBPL search
6-14s la costmap update thread bi block het tung do. Them capability boost::dll
"<alias>ExternalGrid" (cung mau sbpl_recovery dang dung) de planner nhan ban chup thay vi
lock song. threadBody(): planner co setter + costmap bat snapshot_for_readers thi
refreshSnapshot() + dua ban chup vao, khong lock; khong thi rot ve giu mutex nhu cu (rollback
khong build lai). SBPLLatticePlanner them setExternalGrid()/activeGrid(); sua luon check
size external_grid_ so voi grid (grid = activeGrid() nen so voi chinh no, khong bao gio bat
duoc lech) - so dung costmap_robot_->getCostmap() (luoi song).

Test: ReportsExternalGridCapabilityPerPlanner, ExternalGridIsNotCalledWhileTheCostmapLockIsDisabled.
config/runtime: bat snapshot_for_readers: true (cay sim). docs/THREADING.md: bang so sanh khoa
dai vs ban chup.
2026-09-18 13:32:52 +07:00
0d333212b1 config: go schema hybrid path-tracking khoi priest params (revert)
priest_local_planner da reset ve 28e0636 (bo feat hybrid path-tracking
PathTrackerCore/HybridArbiter). Khoa hybrid_mode/tracker_*/blend_*/
debug_hybrid khong con duoc code doc nua, go theo cho khop schema -
noi dung file khop dung dc35900^ (bb64511), giu nguyen cac tune khac
(goal_tolerance, max_velocity...).
2026-09-17 13:43:58 +07:00
9f504ee50e config: bat hybrid_mode 1 -> 2 (cay sim runtime)
SHADOW (1, chi log doi chieu) -> muc ke tiep trong plan hybrid
path-tracking (xem README priest_local_planner).
2026-09-17 13:37:37 +07:00
b205cf41bc config(priest): blend_dev_noise/avoid 0.05/0.20 -> 0.15/0.30 + blend_dev_gate_obstacles (do 17/9) 2026-09-17 09:45:50 +07:00
dc359007b8 config: them khoa hybrid_mode + tracker/blend cho priest_local_planner (cay sim)
hybrid_mode: 1 (shadow) de thu log [DBG-PRIEST-HYB] doi chieu tracker voi
solver truoc khi chuyen 2. Xem doc/HYBRID_TRACK_AVOID_PLAN.md va commit
tuong ung o priest_local_planner (nhanh feature/hybrid-track-avoid).
2026-09-16 18:51:07 +07:00
bb645111f7 tune: xy/yaw_goal_tolerance 0.02/0.01 -> 0.04/0.04 (P4)
Dung sai cu bat kha thi ve vat ly: dung tu 0.15 m/s trong 2 cm can a=0.56
m/s^2 > decel_comfort 0.35 (do 15/9: dist=0.06 ma vmeas=0.17), robot BAT
BUOC vuot goal. yaw 0.01 rad (0.57 deg) nam duoi nhieu odometry, robot san
diem dung. Vanh nha latch (= tolerance x xy_latch_release_factor) theo do
nghi 0.10 -> 0.20 m: do 16/9 latch o 0.093 roi nha o 0.100 vi xoay tai cho
troi 7mm, 0.10 qua sat.
2026-09-16 18:31:30 +07:00
8d9932c905 config: tune runtime sim params (max_velocity, clear map, allocated_time)
- priest max_velocity 0.5 -> 1.2 m/s
- recovery clear_costmap.affected_maps both -> local (chi lam moi
  sensor data, khong dung ban do tich luy)
- SBPLDetourPlanner.allocated_time 1.0 -> 2.0 s
2026-09-15 15:08:14 +07:00
f42cff3510 feat: lan truyen BaseNavigation::emergency()/clearEmergency() len tren
NavigationServer::emergency() phan anh ngay tren thread goi (getTwist
tra 0, getFeedback bao EMERGENCY) truoc khi ham tra ve, du control
thread dang block trong plugin nao; don dep that (planner/recovery/
action/mission layer) chay o chu ky ke cua control thread. State
NavigationState::kEmergency la state GIU, khong terminal: pause/resume/
cancel/goal moi deu bi bo qua, chi clearEmergency() moi thoat, ve
kIdle.

MissionLayer: emergency() -> drain hang doi, goi cancel toi navigation
dung 1 lan, chuyen MissionState::EMERGENCY; clearEmergency() ve
CLEAR_EMERGENCY, khong tu chay lai gi, cho order ke tiep.

Test moi cho ca 2 lop (navigation_server_test, mission_layer_test,
state_machine_test, walking_skeleton_test) phu: force-zero-truoc-cycle,
tu choi moveTo/instantActions khi dang chot, huy goal con pending, mo
chot roi nhan goal moi.
2026-09-15 15:08:09 +07:00
ac307b0358 feat: add the 10 config keys that were silently falling back to defaults
Runtime log kept printing "missing param '<key>', using default ..." for
every one of these at boot. None were dangerous (all default to the safe/
off value already), but a key nobody wrote down is a key nobody can find
when they go looking for it, and it invites someone assuming the default
is something else. Values match the C++ default exactly — this changes
nothing at runtime, only silences the warnings and gives each key a home
to be tuned from later.

- sensors: (new block) laser_sor_enabled/mean_k/stddev_mul — LaserScan SOR
  filter ahead of the costmap (SensorGatewayConfig).
- action_patience — tier-2 safety net for EXECUTING_ACTIONS (ActionPort
  contract: handler timeout is tier 1, this is tier 2, mission_timeout is
  tier 3); already referenced by name in the watchdog action_stall_budget
  comment, key itself was missing.
- recovery_namespace, action_namespace, mission_namespace — the
  mission_namespace comment already said "namespace đọc chúng là
  `mission_namespace` ở trên" pointing at a key that didn't exist yet.
- global_frame, require_current_costmap.
- debug.env — fourth debug switch alongside the existing state/plan/skip;
  updated "cả ba" -> "cả bốn" in the intro comment.
2026-09-12 22:40:22 +07:00
8bc4895a60 feat: lifecycle contract — cancel/pause must reach true quiescence before reporting done
Root cause (from a C++ host log, 2026-09-11): cancel during PLANNING only set
a discard flag on the planner thread, which ran to allocated_time before
CANCELLED could be reported; a queued next mission landed on a still-busy
planner and timed out too. Same class of bug existed for pause, recovery, and
implicitly for a legitimate ABORTED read while a component was still
unwinding. Full audit, decisions, and phased design in
docs/PLAN_LIFECYCLE_CANCEL_PAUSE_RESUME.md; old-vs-new behaviour per state in
docs/LIFECYCLE_BEHAVIOUR_MATRIX.md.

Runtime quiescence, not just "command sent":
- kPausing (new state) mirrors kCancelling: PAUSED/CANCELLED is only entered
  once planner and recovery are idle, the action reports terminal, and the
  robot is stopped per odometry (robot_stopped, stopped_measured_linear/
  angular_eps) — not merely "the command we sent was zero". settle_timeout
  bounds the wait; exceeding it still finishes but logs an ungated error
  naming which component was still busy, so a plugin that doesn't honour
  cancel/pause is visible instead of silently swallowed.
- PlannerRunner::running_planner_ (new): the instance the planner thread is
  actually inside makePlan() with, tracked separately from active_ — active_
  can already point at a different instance after swapPlanner() while the
  old attempt is still running. cancelPlan(), swapPlanner() (when a job is
  running_ or only pending_ and not yet picked up), and the destructor all
  preempt through this pointer now; the old code preempted through active_
  and could silently preempt the wrong (idle) instance after a profile swap.
- ComponentStatusBoard + per-component ComponentPhase (idle/busy/stopping/
  paused/hung), read by PlannerRunner, RecoveryRunner, ActionRunner and
  ControlLoop instead of ad hoc bools — this is what makes "did everything
  actually stop" answerable at all, and what the new Watchdog thread reads
  to flag a component busy-without-progress as hung (logged once at the
  edge) without the control loop needing to detect its own stall.
- Resume: PLANNING replans from the current pose. CONTROLLING re-issues
  setPlan() with the plan already in hand (decided: setPlan again, not a
  fresh plan) — the local planner needs nothing else since it already runs
  once per control cycle; a fresh plan on resume was considered and
  rejected as unnecessary work for a plan that's still valid.
- Command-to-zero on cancel/pause stays immediate (no deceleration ramp) —
  existing VelocityArbiter behaviour, left as is per a scoped decision.

Depends on: Test/sbpl (bd89924), pnkx_nav_core (2b0993b, robot_nav_core::
Preemptable + component_status_probe.h), Test/sbpl_lattice_planner (7456e99),
Test/recovery_core (254c7fc, onCancelRequested + ABI guard), Test/
sbpl_recovery (ea79686, worker-thread cancel), Test/action_core (669c3f7,
pause/resume + kCancelled), Test/dock_pattern_action (cc1ea74).

Verified: 13 gtest binaries / 528 tests, 0 failures. Runtime on the dev
machine (Gazebo + real ROS host + VDA5050 over MQTT), 6 scenarios — cancel
during PLANNING, pause/resume during PLANNING and CONTROLLING (incl.
submit-while-still-winding-down), pause-then-cancel during PLANNING and
CONTROLLING: no ABORTED/RECOVERING in any run, preempt lands within
hundredths of a millisecond of entering CANCELLING/PAUSING, PAUSED/CANCELLED
only reported once the robot is actually stopped per odometry. Full numbers
in the plan doc section 6.

Excluded from this commit (pre-existing, unrelated):
config/runtime/recovery_behaviors_params.yaml (allocated_time 1.0->2.0,
SBPLDetourPlanner tuning predating this work).

Not yet done (see plan doc "Trạng thái"): config tuning (phase 0, pending
per a scoping decision); runtime scenarios for cancel mid-detour and a 30 s
pause mid-action; commit to rb_ws is a separate step, not done here.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-12 22:07:34 +07:00
7d00c5ab66 feat(rotate): áp relative_yaw trong resolveDeferredGoal, đổi binding rotate
- NavigationRequest: thêm relative_yaw [rad], NaN = không dùng, đi kèm
  được với goal_frame/relative_distance thay vì loại trừ.

- resolveDeferredGoal(): thêm nhánh has_yaw. Trước đây relative_distance
  = 0 khiến goal CHÉP NGUYÊN pose hiện tại kể cả orientation — chặng
  rotate coi như đã tới đích ngay khi nhận, không quay độ nào. Giờ tính
  yaw nền (từ pose hiện tại, hoặc từ frame nếu goal_frame có) rồi cộng
  relative_yaw, dựng lại quaternion đủ 4 thành phần. Log "Goal received"
  thêm yaw= để chặng quay không còn trông giống hệt chặng vị trí.

- mission_adapter_bridge.cpp: chở relative_yaw qua nguyên vẹn.

- Thêm 3 dòng debug (nhóm debug_plan, mặc định bật) trong
  runController(): kết quả isGoalReached() khi true (candidate=0, chưa
  từng tính lệnh), v/omega trước arbiter, v/omega sau arbiter — phân
  biệt "chưa từng có lệnh" / "lệnh bị cắt" / "lỗi ngoài move_base2".
  Bật khối log đã có sẵn nhưng bị comment từ trước.

- Binding rotate: PNKXRotateLocalPlanner -> HybridRotateLocalPlanner.

- 13 test mới (deferred_goal_test.cpp + 2 ca bridge): quay giữ nguyên
  x/y chỉ đổi yaw, góc là delta theo hướng hiện tại, dấu âm quay ngược,
  quaternion chuẩn hoá, go_straight không bị đụng hướng, distance+yaw
  đi cùng nhau, frame+yaw lấy nền là hướng robot chứ không phải hướng
  frame đích, mất pose bị từ chối, NaN passthrough.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-11 10:46:58 +07:00
180c0e1cd4 config: cây sim dùng lại f_scan + b_scan, tắt logger, viết lại doc route recovery
costmap_common_params.yaml
  observation_sources quay về "f_scan b_scan"; bốn nguồn depth camera
  (pc_marking, pc_clearing, pc_r_marking, pc_r_clearing) bị comment lại kèm
  nguyên khối tham số để bật lại chỉ bằng cách bỏ dấu #. Lý do: các nguồn
  PointCloud2/DepthCameraData của Gazebo publish theo sim time, so hạn bằng wall
  clock nên hay bị coi là stale và khoá bánh khi RTF thấp. Sau thay đổi này cây
  sim khớp schema đang chạy ở rb_ws (cùng tập observation_sources).

env_monitor_params.yaml
  logger/enabled: true -> false. Ghi JSONL mỗi tick nặng chỉ cần khi lấy dữ liệu
  replay/ML, không phải chế độ chạy thường trực.

recovery_behaviors_params.yaml
  Chỉ sửa comment, không đổi khoá hay giá trị. Bảng route và phần mô tả từng
  trigger được viết lại theo verdict của EnvMonitor (kStall -> oscillation,
  kUnreachable -> path_blocked, kContact -> collision) thay vì đánh số "Phép đo
  1..4" của PathMonitor đã xoá ngày 6/9/2026. Bổ sung: off_path hiện không còn
  nguồn cấp cờ (giữ route cho đủ hợp đồng sáu trigger của StateMachine); phân
  vai rõ giữa env_monitor_params.yaml (KHI NÀO giơ cờ) và file này (giơ cờ rồi
  thì chạy behavior nào); ghi chú phanh của kContact thuộc apply_command nên vẫn
  chạy kể cả khi route collision rỗng.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-09 13:47:33 +07:00
350b1b7f8e feat(sensor_gateway): đẩy static map sang PreferredLayer và UnpreferredLayer
pushStaticMap trước đây chỉ dispatch tới STATIC_LAYER, nên PreferredLayer và
UnpreferredLayer — hai layer cũng ăn OccupancyGrid từ topic /map (namespace
riêng) — không bao giờ nhận được dữ liệu qua SensorGateway. Kết quả: khai layer
trong plugins: nhưng costmap vẫn trống ở vùng preferred/unpreferred.

Thêm dispatch cho cả hai layer trên global và local costmap. dispatchTo lọc theo
LayerType và bỏ qua khi không tìm thấy layer nào khớp, nên cấu hình không khai
hai layer này vẫn chạy y như cũ (no-op, không thêm chi phí đáng kể ngoài một
vòng lặp trên danh sách plugin).

LayerType::PREFERRED_LAYER và UNPREFERRED_LAYER đã có sẵn trong
robot_costmap_2d tại commit a63c084 (bản mà rb_ws đang trỏ tới), nên không sinh
phụ thuộc vào code chưa publish.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-09 13:47:17 +07:00
b84b76766d config: bat elite blend (B2) + ha omega_ff_curvature_floor tren cay sim
Doi cho priest_local_planner de do B2/B3 (xem commit tuong ung o
priest_local_planner):
- elite_blend_enabled: true, topn=10, lambda=0.5, validate_margin=0.01
- omega_ff_curvature_floor: 0.12 -> 0.04

File nay dang mang theo 2 khoa co san tu truoc (khong lien quan doi nay):
slew_reseed_gap: 0.3, zeta_from_start_tangent: false.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-08 16:25:10 +07:00
2a8e4167e8 refactor: bỏ hai công tắc mission_layer_enabled và docking_requires_marker
Mission layer giờ LUÔN chạy: mọi VDA5050 Order đi qua `mission_adapters` — cắt
thành chặng tại mỗi node có action, chỉ phần `released` được chạy,
`orderUpdateId` nối tiếp, `mission_timeout` làm lưới cuối. Đường lùi "order đi
thẳng xuống như một goal" không còn được chọn bằng config; nó chỉ còn là hành vi
tự động khi layer không nạp được nguồn nào, và vẫn kèm log cảnh báo.
`mission_namespace` rỗng giờ bị validate CHẶN — trước đây tắt layer là khỏi cần
namespace, giờ rỗng nghĩa là boot với một layer không đọc được nguồn nào.

Marker của profile docking thành TUỲ CHỌN: docking chạy bằng goal_frame đã quy
về pose tuyệt đối và local planner không đọc `maker_name`, nên
`PNKXDockingLocalPlanner` legacy — lý do duy nhất của công tắc — không còn được
dùng. Request có marker vẫn được validate và bind như cũ, chỉ bỏ nhánh từ chối
request không marker.

Bỏ theo: hai trường config, bốn chỗ đọc/describe/validate, hai khối YAML runtime
và hai dòng trong test config. Test: xoá RejectsDockingRequestWithoutMarker (trái
hợp đồng mới) và DisabledMissionLayerDoesNotNeedANamespace; đổi
MissionLayerIsEnabledByDefault -> MissionNamespaceHasADefault,
RejectsEnabledMissionLayerWithoutNamespace -> RejectsAnEmptyMissionNamespace.

Verify: catkin_make --pkg move_base2 rc=0; ctest -R move_base2 17/17.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013rayqed51UoUzE7QDRmM9K
2026-09-06 21:22:06 +07:00
efd090a506 fix(env_monitor): stand-down của kContact không bao giờ được vũ trang — đọc trigger ở cycle tick
ControlLoop truyền `output.recovery_trigger == kCollision` vào onRecoveryFinished ở cycle tick, mà
StateMachineOutput::recovery_trigger chỉ được điền ở cycle khởi động recovery (và khi trừ ngân sách);
cycle tick là mặc định kPlanningFailed nên from_contact luôn false. Run 6/9 16:30 (đám đông): người
đứng 7 cm trước mũi → 4 cờ collision cùng chỗ → route cạn → ABORT, JSONL contact_standdown = 0.

- ControlLoop::running_recovery_trigger_ ghi ở start_recovery, dùng ở tick kết thúc.
- FakeRecoveryPort::setSucceedWithPath; test walking skeleton
  DetourFromContactThatDidNotMoveTheRobotArmsTheStandDown (cờ → detour có path → chạm lại tại chỗ
  → không RECOVERING thứ hai trong 1,5 s, lệnh về controller).

Test: walking_skeleton 58/58, env_monitor 47/47, các bộ khác pass. Sim 18:07 và 20:26 không hồi quy
(chưa có ca cờ collision thứ hai để kiểm sống).

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017xXjFjr2DQ6rhmhHSW4fk4
2026-09-06 20:36:40 +07:00
67cc877de8 feat(env_monitor): cổng giam vùng cho kStall — đi nhiều mà ở trong vòng nhỏ là loanh quanh
stall/confine_window_s 20 s, confine_radius 1,2 m, confine_cmd_factor 1,5: trong cửa sổ mọi vị trí
nằm trong vòng bán kính < 1,2 m quanh tâm của chúng và lệnh tích luỹ >= 1,5 x max(2 x bán kính,
disp_min) thì giơ stall (không cần geodesic — đi tới đi lui làm eff lật dấu). Cổng dịch chuyển đo
đầu–cuối nên mù với vòng bán kính > 0,3 m; cổng đứng yên chỉ bắt gần như đứng. Replay 8 lượt JSONL
5–6/9: bắt 00:05 (101 s thay vì 206), 10:57 (27 s thay vì 75), 23:37; 0 lần ở 5 lượt sạch. Hệ số
lệnh chặn ca bò thẳng chậm sau người. Verdict/JSONL/dòng 1 Hz thêm confined, region_radius.

Sim 6/9 15:46: 2 mission tới goal, 0 cờ oan, cổng giam vùng không mở (không có ca loanh quanh trong
lượt), kUnreachable 1 cờ đúng (cùng lúc PRIEST khai).

Test: env_monitor 47/47 (+2), 10 bộ còn lại pass; YAML ↔ reader 69/69.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017xXjFjr2DQ6rhmhHSW4fk4
2026-09-06 15:52:35 +07:00
a9785b99ee feat(env_monitor): cổng đứng yên cho kStall — không dịch chuyển suốt idle_window_s là kẹt
stall/idle_window_s 25 s: dịch chuyển thực < disp_min suốt cửa sổ thì giơ stall kể cả khi lệnh
tích luỹ không đủ để đo eff (PRIEST bò 0,03–0,15 m/s tại chỗ 30 s với blocked_ahead cost 253 mà
không khai bất khả thi — run 6/9 10:57, cổng dịch chuyển câm vì lệnh 12 s < 1,5 m, kUnreachable
mới gỡ ở 75 s). Thử offline trên 7 lượt JSONL: mở đúng hai ca quần tại chỗ, 0 lần ở ba lượt sạch.
Ring vị trí 192 mẫu; verdict/JSONL/dòng 1 Hz thêm `idle`.

Sim 6/9 15:18 (map tĩnh + fake_pedestrians): 2 mission tới goal, 2 detour đều của PRIEST,
EnvMonitor 0 cờ, 0 idle, 0 unreachable.

Test: env_monitor 45/45 (+2), 10 bộ còn lại pass; YAML ↔ reader 66/66.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017xXjFjr2DQ6rhmhHSW4fk4
2026-09-06 15:21:57 +07:00
c0a04b29ad refactor: xoá PathMonitor và PathCheckPort, EnvMonitor là bộ giám sát duy nhất; gộp refreshSnapshot
Xoá hạ tầng giám sát cũ đã tắt từ 5/9 (path_monitor/enabled: false), −2947 dòng:
- ControlLoop: PathMonitorConfig, updatePathMonitor / updateProgressMonitor / applyCollisionGuard /
  planIsBlocked / resetPathMonitor / rebuildPlanArcLength, toàn bộ member bốn phép đo, luật "plan
  mới bẩn thì giữ plan cũ" trong collectPlannerResult. Bốn cổng StateMachineInput giữ nguyên
  (off_path không còn nguồn, đặt false).
- ports/path_check_port.h, CostmapPathCheck trong NavigationRuntime.
- plan_inspector: bỏ checkPlan / checkMotion / PlanBlockResult / MotionCheckParams /
  MotionBlockResult; giữ planarTransform, nearestIndex, trackedNearestIndex, crossTrackError.
- Config: readPathMonitor, MoveBase2Config::path_monitor, validate; xoá
  config/runtime/path_monitor_params.yaml; comment YAML/state_machine đổi sang tên verdict EnvMonitor.
- Test: FakePathCheckPort, 30 test WalkingSkeletonPathMonitor/CollisionGuard, 13 test
  PlanInspectorCheck/Motion, 2 test validate thân guard.

P0(b): ControlLoop::step() gọi EnvironmentPort::refresh() một lần đầu cycle (không phụ thuộc
env_monitor/enabled); ControllerRunner::setSnapshotRefreshedByLoop(true) làm ba refreshSnapshot()
trong runner thành no-op — monitor và controller đọc cùng một lưới, một bản copy mỗi cycle.

Test: env_monitor 43, grid_analysis 33, plan_inspector 11, walking_skeleton 57, config_validation 32,
scenario 12, state_machine 100, navigation_server 56, controller_runner 28, velocity_arbiter 29,
planner_runner 31 — pass.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017xXjFjr2DQ6rhmhHSW4fk4
2026-09-06 10:55:15 +07:00
62692838d6 feat(env_monitor): snap điểm thoát sang ô free trước khi kết luận mất liên thông; bật lại kUnreachable
- CostToGoParams::target_snap / geometry/target_snap 0,5 m: T (2 m dọc plan) không free và lùi dọc
  plan không thoát thì dịch ngang sang ô free gần nhất (Target::kSnapped), arc_rest vẫn theo index;
  chỉ khi snap thất bại mới kBlockedExit. Run 6/9 10:15: mọi "unreachable" đều là T nằm trong vành
  0,48 m vì SBPL vẽ plan ôm mép vật cản giữa hành lang rộng 1,55 m — không phải mất liên thông.
- unreachable/action: recover, static_on 1,5 s.
- Test: grid_analysis +2 (plan ôm tường snap ra và có đường; cụm chắn ngang vẫn bịt với snap 0,5).

Sim 6/9 10:38: 0 cờ unreachable, 0 cờ oan, 2 mission tới goal, 2 detour đều của PRIEST.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017xXjFjr2DQ6rhmhHSW4fk4
2026-09-06 10:45:52 +07:00
261cc20ad4 feat: EnvMonitor thay PathMonitor — giám sát môi trường bằng EDT/geodesic/quỹ đạo thật
Bộ giám sát mới trong ControlLoop (core/env_monitor, core/grid_analysis, ports/environment_port,
io/env_logger), thay bốn phép đo của PathMonitor (code cũ còn, tắt bằng path_monitor/enabled: false):

- kContact: dò tiếp xúc dọc quỹ đạo local planner (thay cung v/omega), bao tốc độ sqrt(2a(d - margin))
  có dư, phanh chỉ khi vượt bao, cờ collision khi kề mũi tĩnh 1 s; cổng xoay tại chỗ theo lệnh
  controller muốn; hysteresis + xác nhận khi nhả; đứng ra sau detour không dịch robot (nhường
  controller); giữ phanh khi route khoá thì báo no valid command để controller_patience leo thang.
- kStall: cost_to_go = geodesic tới điểm thoát 2 m dọc plan + phần plan còn lại, index plan bám cửa
  sổ, bộ lọc lật liên thông; cờ no_progress chỉ khi cổng dịch chuyển thực mở (robot không đi được
  đâu trong 12 s dù lệnh >= 1,5 m) — thay ngân sách replan cho stall.
- kUnreachable: liên thông tới điểm thoát, đang ở action log.
- EnvLogger ghi JSONL mỗi tick nặng; config/runtime/env_monitor_params.yaml đủ khoá, comment tiếng
  Việt; ControllerPort::measuredVelocity; FakeEnvironmentPort cho test.

Sim 5–6/9: hết churn detour, khe 1,25 m đi qua 0,5 m/s, lượt 6/9 10:15 2 detour/142 s không oan.
Test: grid_analysis 31, env_monitor 43, plan_inspector 37, walking_skeleton 87, các bộ khác pass.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017xXjFjr2DQ6rhmhHSW4fk4
2026-09-06 10:30:31 +07:00
f2097380e4 feat: trigger collision riêng, ngân sách recovery theo dịch chuyển, guard đo bằng thời gian/góc
Năm thay đổi của cùng một chiến dịch: robot đứng chết ở góc trụ và giữa đám
đông. Mọi con số dưới đây lấy từ log sim ngày 3-4/9, ghi lại trong
Test/COLLISION_GUARD_LOOP_FIX_PLAN.md.

1) Ngân sách recovery nạp lại theo DỊCH CHUYỂN (state_machine)
   Trước: recovery thành công + nộp path mới thì cursor route reset NGAY. Sim
   4/9: guard chặn tại chỗ -> detour lập lại đúng đường cũ (cost y hệt, 0 ms)
   -> cursor về 0 -> chặn lại sau 2 cycle -> 249 vòng trong 52 s, robot bất
   động, controller_patience không bao giờ tích đủ vì path_blocked chen trước
   mỗi 0.2 s. Giờ chỉ nạp lại khi robot đã đi >= recovery_reset_min_travel
   (0.10 m) kể từ lần nạp trước; chưa đi thì tính như một lần thất bại ->
   route cạn -> mute -> controller_patience -> controlling_failed -> ABORT có
   lý do, ~2 s. Mốc theo origin đo quãng đường (reset cùng lúc với nó), nếu
   không thì 0.18 m sau path mới bị báo "0.00 m" và ABORT oan.

2) Guard loại trừ BASELINE (plan_inspector)
   Câu hỏi đổi từ "thân có đè LETHAL không" thành "lệnh này có đưa THÊM ô
   LETHAL vào thân không". Ô đã nằm dưới thân đệm tại pose hiện tại được gom
   thành baseline (rasterize diện tích ~600 ô, binary_search) và bỏ qua ở các
   mẫu sau. Sim 4/9: người kề hông ở 0.46 m ngang (thân 0.48 + đệm 0.05) làm
   mẫu đầu tiên báo "0.05 m" mãi dù PRIEST lệnh đi thẳng, SBPL (không đệm) bảo
   đi được, robot đứng chết. Trượt song song thì đi được, rẽ vào thì vẫn chặn.

3) Thân robot lấy từ FOOTPRINT COSTMAP
   collision_*_offset = 0 cả ba -> hỏi PathCheckPort::robotBodyExtents() mỗi
   cycle (footprint không đệm, cùng hình với SBPL và PRIEST). Đổi footprint lúc
   chạy là guard đổi theo, không phải chép số vào hai file. Khai tay thì phải
   đủ cả ba, khai lửng là config sai. Không có nguồn nào thì báo lỗi và KHÔNG
   kết luận — dừng mù là biến lỗi cấu hình thành robot chết.

4) "Sắp chạm" đo bằng THỜI GIAN và GÓC, không chỉ mét
   Mét dọc cung không nói lên gì với cung xoay gần tại chỗ: cùng 0.15 m, đi
   thẳng 0.36 m/s là chạm sau 0.4 s, còn xoay bò v 0.04 omega -0.5 (R 0.08 m)
   là quay 107 độ và còn 3.8 s — PRIEST đã thôi xoay sau 30-60 độ để thẳng hàng
   với path. Sim 16:26: 11 lần nổ trong 15 s tại góc trụ, xoay 0.9 rad mất 12 s
   thay vì 2 s. Giờ chỉ dừng khi t_contact <= collision_stop_time HOẶC turn <=
   collision_stop_angle; ngoài đó chỉ kẹp v. Đi thẳng (turn ~ 0) không đổi hành
   vi. Cung cũng không dò quá collision_lookahead_angle.

5) Trigger kCollision RIÊNG cho Phép đo 3
   Trước dùng chung path_blocked. Phép đo 1 nổ ở 3 m nên lập lại đường là đủ;
   Phép đo 3 nổ khi đã sát vật, replan từ đúng pose đó thường trả cùng path
   hoặc không ra nghiệm (start trong vành 253) — muốn thoát phải ĐỔI POSE, tức
   back_up đứng trước detour_path. Route, ngân sách và khoá đều riêng. Ưu tiên
   collision > path_blocked > off_path. Cạn route vẫn là KHOÁ chứ không ABORT
   (contract 2026-08-05e).

Config: tách path_monitor ra file riêng path_monitor_params.yaml, sắp xếp lại
theo bốn phép đo; recovery_behaviors_params.yaml sắp xếp lại theo trigger và
dọn bốn khoá chết của mô hình detour cũ. Khoá mới: recovery_reset_min_travel,
collision_exclude_baseline, collision_stop_time, collision_stop_angle,
collision_lookahead_angle.

Debug (khoá debug/state): dòng "hit at sample K: <edge> edge touches cell
(x, y)" và "body overlaps N LETHAL cell(s) ... letting it move" để phân biệt
"góc thân quét tới" với "người bước tới" khi đọc log mà không có costmap.

Verify: catkin_make --pkg move_base2 rc=0; ctest -R move_base2 15/15
(MotionCheck 16, CollisionGuard 13, RecoveryBudget 6, config 34).

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013rayqed51UoUzE7QDRmM9K
2026-09-04 19:35:25 +07:00
78c3808eb1 config: priest sim — in_place_yawrate_max 1.2 rad/s
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-29 10:37:14 +07:00
6d8930c203 config: priest sim — omega_ff_filter_tau 0.35 (E1b)
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-29 10:32:27 +07:00
c4babaa87a config: priest sim — head_slowdown release_cost 128, scale_slew 0.02 -> 0.01
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-29 10:22:29 +07:00
ae019596cc config: priest sim — bật E1a/E2 (clear_scale 0.25, hysteresis 1.5 bucket, restore delay 5)
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-29 09:57:23 +07:00
524939efeb config: priest sim — bật terminal_slide_max_dist 1.5 m (L1)
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-28 23:42:29 +07:00
9d20a46d70 config: priest sim — nới jerk 0.5->1.0, angular_jerk 2.0->3.0 (0.5 quá ì)
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-28 22:59:40 +07:00
96df99fed2 config: priest — bật gate G1 + bao êm ái cho cây sim
10 khoá mới khớp priest_local_planner (gate theo khoảng cách, accel/decel/
jerk comfort, trần gia tốc góc, head slowdown slew) và bật
collision_check_enabled sau khi gate đổi sang phân mức dừng/giảm tốc.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-28 22:34:31 +07:00
c626c4d45d Retune the dev simulation config
Bench and Gazebo settings only; the robot trees are untouched.

Planners: the position profile moves to PriestLocalPlanner, and the three
docking profiles all point at HybridDockingLocalPlanner instead of the Stanley
instances. Loop drops to 20 Hz, command_semantics back to twist for the sim
drive, max_vel_x to 1.20, recovery behaviours and the path monitor off while
the docking chain is under test.

PRIEST runs cem 3 with performance_metrics off and debug_level 0, which is the
configuration the CPU measurements were taken at. Metrics have to stay off for
any further benchmark.

The SBPL primitive path pointed into rl_ws, a workspace that is not on this
machine; it now points at the copy in sbpl_lattice_planner. sensor_store's
report_period goes to 0 to stop the periodic dump. The sim launch defaults
robot_type to T800 and re-enables depth_image_proc.

The VDA5050 charger flow replaces the pallet fixture: DetectCharger and the
charger marker, with the trailing back-off commented out. The rotate compound
action is renamed to lowercase to match what the config reader looks up.
2026-08-27 13:22:26 +07:00
4cdbc11470 Drop terminal_direction from the docking planner allow-list
Nothing reads the key. DockPlanner's config takes dock_anchor, the footprint
and the drive model; terminal_direction was copied down into the planner
namespace and sat there.

The direction of the final straight leg is derived instead: dock_calc tries
nose-first and reverse and keeps whichever needs the smaller pivot, so the side
the robot stands on carries the intent. The layer above has already offset the
goal so base_link ends up on it, which means a marker key forcing the other
direction would contradict the goal position it was handed. Docking in reverse
is a different goal, not a different flag.

Leaving it in the allow-list makes the planner namespace advertise a live key
that does nothing, and a config that lies is worse than one that lacks the key.

The fixture test now asserts the allow-list stays closed instead: the marker
profile also carries global_planner and local_planner, and copying the whole
block down would put meaningless keys into the planner namespace where they can
shadow real ones.
2026-08-27 13:22:07 +07:00
d0c8a0bcdc feat: gate the move_base2 diagnostic logs behind config switches
Seven [move_base2][debug] lines printed unconditionally on every cycle. On a
robot running a full shift that is noise: they describe the normal path, and
constant noise buries the one line that is actually abnormal.

Three switches, grouped by what they answer, all defaulting to on so turning
them off is a deliberate act rather than something that changes behind whoever
is relying on the log:

  debug/state  state machine transitions, printed on change, not per cycle
  debug/plan   controller accepting or rejecting a plan, recovery paths
  debug/skip   why the controller was skipped while CONTROLLING

The abort-detail line stays unconditional and loses its [debug] tag. It is the
reason a mission failed and prints once per abort; a config that can silence it
is a config in which the robot fails silently.

The read path runs YAML debug/{state,plan,skip} into MoveBase2Config, which
carries it to ControlLoopConfig. describe() prints the resulting state at boot
so nobody has to guess why a log went quiet.

Nothing computes differently: stripping every log statement from the old and
new control_loop.cpp leaves a three-line difference, and all three are comments.
The gated arguments are pure reads.
2026-08-27 13:21:58 +07:00
bb030d9ff7 Remove the temporary cmd_vel diagnostic
It was added to find why the robot stood still while every layer reported
normal, and it answered that: the host drops a command whose stamp is older
than its freshness window, and publishCommand freezes that stamp whenever no
request is active. With the answer in hand the line is pure cost - it printed
every control cycle at 20 Hz, and at idle every one of those lines says the
same expected thing.
2026-08-27 12:15:44 +07:00
b18b06465f api: follow the interface rename of the sensor key to topic
move_base_core renamed the string argument of the add/get/remove sensor
functions from five different *_name spellings to topic, because it is the key
that has to match observation_sources and sensor_store_params.yaml rather than
a free-form label. The overrides here follow so declaration and definition read
the same.

Parameter names only; no signature, no behaviour, no ABI. The member
map_name_save_ is untouched - it is not this key.
2026-08-27 12:06:14 +07:00
857194367f config: arc_span is now a two-sided gate, so it must name the real span
Was 2.2 against a 2.0 model - padding that made sense while it was an upper
bound. It is checked on both sides now, because an arc's axis comes only from
its two endpoints and a hidden edge moves it silently. Measured relationship:
yaw error ~= (true span - observed span) / 2.

arc_span_tolerance 0.15 rad allows viewing up to about 30 degrees off-axis for
at most 2.4 degrees of heading error. The extractor always clips a few rays at
each edge, so even head-on the observed span falls about 0.04 rad short, and
the tolerance has to cover that before anything else.

The tuning in the detect block stays out of this commit; it is someone else's
in-flight work on the same file.
2026-08-26 21:09:48 +07:00
fbc2fb75b2 config: document arc_max_point_gap on the arc profile
Two segments adjacent by ray number can still be metres apart - measured in
Gazebo, where a cradle was fused with the wall two rays behind it and fitted as
a 3.2 m circle. The key belongs at or below line_extraction's max_line_gap.

The tuning in the detect block stays out of this commit; it is someone else's
in-flight work on the same file.
2026-08-26 20:39:53 +07:00
648243a0cd config: add the arc_std profile for the concave cradle
Matches the Gazebo dock_cradle_arc model - radius 0.40 m over 2.0 rad. Numbers
for simulation; no real dock has been measured.

offset_x is 0.92 and the derivation is worth stating, because the contact point
is NOT the deepest point. The cradle mouth is 0.673 m across while the robot is
0.960 m wide, so the robot never gets inside the cradle - it meets the two
mouth edges, which stand 0.184 m towards the robot from the deepest point:

    R - R*cos(arc_span/2) = 0.40 - 0.40*cos(1.0) = 0.184 m

so 0.583 rear extent + 0.070 padding + 0.184 + 0.08 clearance = 0.92. Changing
either arc_span or arc_radius moves the mouth and this has to be recomputed.

arc_min_span defaults to 0.52 rad off measured data rather than intuition: on a
0.40 m arc with 3 mm noise the fitted radius drifts +1.9 mm at 45 degrees of
span, +8.6 mm at 30, +25.4 mm at 20. Below 30 degrees a 0.40 m cradle can be
scored as 0.43 and fall outside arc_radius_tolerance.

arc_max_rms is the gate that matters. Every set of points fits some circle, a
right-angled corner included, so the residual is the only thing separating an
arc from a bend.

The tuning in the detect block stays out of this commit; it is someone else's
in-flight work on the same file.
2026-08-26 20:15:19 +07:00