Commit Graph

24 Commits

Author SHA1 Message Date
07e2fd3b38 feat: per-marker dock_face_offset and pivot margin for dock_anchor mating_edge
The charger goal is the docked base_link pose, and the real charger face lies 0.40 m behind
it (detector offset_x). mating_edge measured the pivot sweep from a face assumed at
mating_extent (0.325 m) behind the goal, and still forced a terminal of at least
rear_extent. So the robot rotated with its centre about 0.725 m from the charger face.

Two optional keys, valid only with dock_anchor: mating_edge (rejected with center or face):
- dock_face_offset [m]: distance from the goal back to the real dock face. Default
  mating_extent.
- dock_pivot_safety_margin [m]: overrides maneuver/pivot_safety_margin for this marker.
A YAML null reads as unset, so move_base2 can clear a previous marker's value.

For mating_edge, the terminal floor becomes
max(mating_extent - face_offset, 0) + padding (floored at path_point_spacing), and the pivot
vertex becomes max(straight_distance, circumscribed - face_offset + margin). The costmap
rotation radius uses the same margin. center and face are unchanged.

KIT charger (face offset 0.40, margin 0.10, straight_length 0.2): vertex 0.2 m, robot centre
0.60 m from the charger face. Tests cover the three robot starts, the defaults, validation
and null handling. The test target now links yaml-cpp itself.
2026-10-29 16:54:16 +07:00
9d31c0e5db 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).
2026-10-29 15:59:47 +07:00
7c93fe47aa fix: drop the start-footprint check from the back-off pivot
The back-off pivot rejected a robot standing 0.375 m from a charger goal with about
10 deg of yaw ("current footprint does not clear the dock along the approach axis").
With dock_anchor=face the dock is modelled at the goal, which is the docked base pose,
while the real charger face lies 0.40 m behind it. So a rear corner that projected
behind the goal line was read as inside the dock, although it had 0.45 m of clearance.

The robot physically stands at its start pose, and the back-off only moves it away from
the dock, so the check guards nothing. Rotation sweeps and approach legs are still
checked against the costmap when pivot_check_costmap is on. Test: the 29/10 15:36 robot
start now yields backoff_pivot_straight; with the key at 0 it still fails as before.
2026-10-29 15:46:30 +07:00
7c969d037b feat: add a back-off pivot as the last-resort dock maneuver, with optional costmap checks
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.
2026-10-29 15:17:24 +07:00
1f04a95e1b feat: thêm mô hình động học differential và maneuver straight-pivot-straight
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.
2026-08-25 12:14:58 +07:00
a301987808 config: đồng bộ bản mặc định trong gói với schema hiện tại
Bổ sung direct_entry_min_curve_room và straight_length còn thiếu, viết lại comment
bằng tiếng Việt và ghi rõ đây là bản mặc định đóng gói kèm để triển khai nhanh,
không phải cây config đang chạy. Giá trị giữ trung tính, tính năng mới để tắt.
2026-08-15 13:38:03 +07:00
9cf84c641c update 2026-08-15 13:06:04 +07:00
5c0c5d96d7 update 2026-08-15 13:04:56 +07:00
bac3ae0ba3 build: default the contract tests to the build mode instead of always on
The standalone CMake build is the robot deployment path and must not produce a
test executable; a catkin workspace is a development machine and keeps it.
Dropping include(CTest) also stops this package from defining BUILD_TESTING=ON
for the whole tree, which switched every other package's tests back on in the
aggregate standalone build.
2026-08-15 12:42:08 +07:00
2a16606c27 refactor & optimal 2026-08-14 14:04:47 +07:00
539fc5da16 Refactor DockPlanner: typed config, dock anchor, validated dock footprint
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>
2026-08-12 21:52:52 +07:00
91ba7b1569 optimal and add file readme 2026-04-16 02:38:25 +00:00
03907b9613 update 2026-03-26 12:05:20 +00:00
d51ecc0986 update 2026-03-21 19:03:11 +07:00
56d05e4322 u 2026-03-20 08:38:51 +00:00
da82431cd9 update tf3 2026-02-07 10:56:15 +07:00
8f0cd33ec7 update 2026-01-13 14:29:52 +07:00
c4ae3961ab update for ROS 2026-01-07 16:54:50 +07:00
22aa83fe5a robot_nav_core 2026-01-07 09:17:55 +07:00
b5a1b7b6d8 Hiep update 2025-12-30 10:20:42 +07:00
9c84e64253 Hiep sua ten file 2025-12-30 09:59:48 +07:00
92264eaffc update 2025-12-30 09:11:02 +07:00
c5c55147b7 robot::console to robot_cpp 2025-12-24 14:29:24 +07:00
66be0d86cc first commit 2025-12-22 17:37:45 +07:00