feat: add dock_anchor mating_edge for goals already offset to the docked pose

The charger detector offsets its target to the docked base_link pose (offset_x 0.40 from
the V apex), so the charger face is at the robot's rear edge at the goal. dock_anchor=face
places the face at the goal itself, so the pivot vertex came out 0.624 m in front of the
goal, about 0.40 m more than needed. Robots standing 0.38-0.58 m out had to back off or
failed to plan.

dock_anchor=mating_edge keeps every face behaviour, except that the on-the-spot pivot
clearance is measured from the real face, mating_extent behind the goal:
vertex = max(straight_length, circumscribed - mating_extent + pivot_safety_margin).
For the KIT robot (0.65 x 0.69) the vertex drops from 0.624 m to 0.4 m. footprint_dock is
ignored, as with face. center, face, direct entry and single cusp are unchanged.

Test: the 29/10 starts 0.579/0.292 and 0.427/0.155 now pivot directly at 0.4 m;
0.375/-0.149 backs off only to 0.45 m (26 poses against 36 with face).
This commit is contained in:
2026-10-29 15:59:47 +07:00
parent 7c93fe47aa
commit 9d31c0e5db
6 changed files with 89 additions and 7 deletions

View File

@@ -171,6 +171,13 @@ File mặc định đi kèm gói: `config/dock_global_params.yaml`. Cây đang c
từng marker rồi rót vào namespace `DockPlanner` trước khi dựng plugin.
`dock_anchor: center` cộng nửa thân dock phía tiếp cận vào khoảng hở;
`dock_anchor: face` bỏ qua `footprint_dock` hoàn toàn.
`dock_anchor: mating_edge` cũng bỏ qua `footprint_dock`. Nó dành cho goal đã được tầng
trên offset sẵn thành vị trí `base_link` lúc dock xong (ví dụ trạm sạc dò bằng lidar với
`offset_x`): mặt dock nằm sát mép robot đi vào tại goal, sau goal đúng `rear_extent`
(lùi vào) hoặc `front_extent` (tiến vào). Chỉ điểm xoay của kiểu thẳng + xoay + thẳng
(và kiểu lùi ra rồi xoay) đổi: `max(straight_length, bán kính ngoại tiếp − extent mép +
pivot_safety_margin)`, thay vì đo từ goal như `face`. Robot KIT 0.65 × 0.69, trạm sạc:
điểm xoay 0.4 m thay vì 0.624 m. Đường vào thẳng và đường cusp không đổi.
Điều kiện validate: