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).
A differential robot that stood closer to the dock than the safe pivot point had no
maneuver at all. Direct entry lacked curve room, the single cusp exceeded
maximum_forward_extension, and straight-pivot-straight requires the vertex between the
robot and the dock. Two charger dockings on the KIT robot failed this way (start
0.579/0.292 m and 0.427/0.155 m).
- New shape backoff_pivot_straight, differential only. It is tried only after every
existing shape failed. The robot drives straight along its current heading (no rotation
at the start) until it is past the pivot vertex, then follows the existing
straight-pivot-straight geometry. Its feasibility does not depend on the turning radius.
- maneuver/pivot_backoff_max_distance [m]: longest allowed back-off; 0 disables the shape.
- maneuver/pivot_check_costmap: rejects a pivot shape when a rotation sweep (circumscribed
radius + pivot_safety_margin) or an approach-leg footprint covers a LETHAL cell. The
terminal into the dock is not checked: it ends in contact with the dock by design.
- Defaults keep every existing plan unchanged. Tests cover the two robot failures, unchanged
plans for the existing shapes, ackermann, the gates and the costmap callbacks.
Hai thay đổi đi cùng một commit vì maneuver mới là hình dạng chính của base
differential, đồng thời là fallback của base Ackermann; tách ra sẽ tạo commit
trung gian không build được.
Mô hình động học (kinematics/kinematic_model):
- kAckermann là mặc định và giữ nguyên hành vi cũ, nên YAML chưa khai báo khoá
này không đổi gì.
- kDifferential bỏ qua lookup axle TF. Base differential không publish frame
trục lái, tra cứu sẽ ném exception và làm chết plugin ngay lúc initialize;
bán kính quay nhỏ nhất do đó lấy thẳng từ kinematics/minimum_turning_radius.
- Bán kính 0 giờ là giá trị hợp lệ, nghĩa là robot xoay tại chỗ được. Chỉ giá
trị âm hoặc không hữu hạn mới là lỗi cấu hình.
Maneuver straight-pivot-straight:
- Đỉnh xoay nằm giữa robot và dock nên không tốn thêm chiều sâu lối đi như
cusp, vốn đẩy robot ra xa dock hơn chỗ đang đứng.
- Vòng xoay tại chỗ được ghi thẳng vào path thành một khối pose cùng vị trí,
khác yaw. Base Ackermann không đổi hướng ở một góc gấp của polyline, nên
trạng thái dừng-đánh-lái phải nằm trong plan chứ không để controller tự suy.
- maneuver/pivot_fallback_extension mở khoá hình dạng này cho Ackermann, đo
bằng phần cusp đẩy robot RA XA dock hơn chỗ nó đang đứng. Ngưỡng tương đối
là có chủ đích: bản trước đo chiều sâu lối đi tuyệt đối, cộng cả khoảng robot
đang chiếm, nên loại bỏ mọi maneuver xuất phát từ khoảng cách tiếp cận bình
thường. Mặc định 0 = tắt hoàn toàn.
- maneuver/pivot_safety_margin giữ khoảng hở giữa đường tròn thân xe quét khi
xoay tại chỗ và mặt gần của dock. Xoay tại chỗ quay mọi điểm footprint quanh
base_link nên kích thước liên quan là circumscribed radius, luôn lớn hơn
mating extent dùng cho đoạn thẳng cuối.
Kiểm chứng: catkin_make --pkg dock_planner build sạch,
./devel/lib/dock_planner/dock_planner_test PASS.
Split configuration out of the planner into DockPlannerConfig with explicit
load/validate, so a missing or malformed key fails at initialize() with a
message instead of silently defaulting to zero.
- initialize() now scopes its NodeHandle to the plugin name. The previous
"~/<name>" form never resolved ("~" is not a key in the merged tree) and
fell back to ROOT, so every parameter was read from the wrong place and
cost_threshold silently dropped from 200 to 0.
- Replace robot_nav_2d_utils::footprintFromParams(), whose declaration and
definition disagreed on the argument type. The symbol was never defined,
and because the plugin is dlopen'd lazily the failure only surfaced at the
call site on the robot, long after a clean build.
- Read footprint_dock, the dock object's polygon, with range and NaN checks.
move_base2 copies it in per marker before the instance is built.
- dock_anchor selects whether the marker goal sits at the dock centre or on
its approach face; the face case ignores footprint_dock entirely.
- makePlan() rejects start/goal outside the costmap global frame instead of
planning across mismatched frames.
- Add dock_planner_test covering config validation, footprint parsing and
path generation.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>