diff --git a/config/runtime/custom_global_params.yaml b/config/runtime/custom_global_params.yaml index f462e6b..4a0437b 100644 --- a/config/runtime/custom_global_params.yaml +++ b/config/runtime/custom_global_params.yaml @@ -1,16 +1,42 @@ +# custom_planner — tham số runtime, đọc qua robot::NodeHandle("CustomPlanner"). +# Thiếu key nào thì dùng default trong CustomPlannerConfig (cùng giá trị ghi ở đây). +# +# Khối cũ (environment_type, planner_type, allocated_time, initial_epsilon, +# force_scratch_limit, forward_search, nominalvel_mpersecs, +# timetoturn45degsinplace_secs, allow_unknown, directory_to_save_paths, +# pathway_filename, current_pose_topic_name) đã bỏ: không chỗ nào trong cây này +# đọc chúng — đó là tham số SBPL còn sót từ thời CustomPlanner chưa có config +# riêng. Tham số SBPL thật nằm ở sbpl_global_params.yaml. CustomPlanner: library_path: libcustom_planner - environment_type: XYThetaLattice - planner_type: ARAPlanner - allocated_time: 10.0 - initial_epsilon: 1.0 - force_scratch_limit: 10000 - forward_search: false - nominalvel_mpersecs: 0.8 - timetoturn45degsinplace_secs: 1.31 # = 0.6 rad/s - allow_unknown: true - directory_to_save_paths: "/init/paths" - pathway_filename: "pathway.txt" - current_pose_topic_name: "/amcl_pose" - + # [m] start/goal cách pathway dưới ngưỡng này thì coi là đã bám vào pathway + # (quyết định cách nối NURBS start/goal vào tuyến). + pathway_attach_distance: 0.1 + + # [m] order không có node/edge (goal trần): chỉ nhận khi start-goal gần hơn + # ngưỡng này, ngược lại trả false để move_base2 dùng backup planner. + bare_goal_max_distance: 0.2 + + # Bước tham số u trong [0,1] khi đo chiều dài NURBS một cạnh (không phải mét). + nurbs_length_t_interval: 0.01 + + # [m] khoảng cách mong muốn giữa hai pose khi lấy mẫu NURBS nối start/goal. + nurbs_point_spacing: 0.05 + + # [rad] hai cạnh thẳng đầu gãy dưới góc này thì bỏ cạnh đầu khi tính yaw. + skip_edge_angle: 0.4712 # = 0.15*pi + + # [rad] góc nối giữa hai cạnh <= tight: gãy gắt (cost 20); < wide: gãy vừa (cost 10). + cost_angle_tight: 0.3142 # = 0.1*pi + cost_angle_wide: 1.4137 # = 0.45*pi + + # [rad] cửa sổ góc đổi hướng cần chèn chuỗi pose xoay tại chỗ giữa hai cạnh. + rotation_insert_min: 1.4137 # = 0.45*pi + rotation_insert_max: 2.6704 # = 0.85*pi + + # [rad] bước yaw giữa hai pose xoay tại chỗ được chèn. + rotation_step: 0.1571 # = 0.05*pi + + # [rad] |yaw goal - hướng cạnh cuối| vượt ngưỡng này thì đoạn cuối đi lùi. + backward_decision_angle: 1.5708 # = 0.5*pi diff --git a/config/runtime/dock_global_params.yaml b/config/runtime/dock_global_params.yaml index 3191200..d810ae3 100644 --- a/config/runtime/dock_global_params.yaml +++ b/config/runtime/dock_global_params.yaml @@ -1,11 +1,47 @@ +# DockPlanner plugin and approach-curve parameters. +# +# Collision/free-space checking is intentionally not configured here yet: +# DockPlanner currently generates geometry only. Do not add cost_threshold, +# allow_unknown, or check_free_space until the collision checker is implemented. +# +# The MyGlobalPlanner and global_costmap blocks that used to sit here were +# dropped: nothing in dock_planner ever read them. The planner reads exactly the +# keys below plus dock_anchor and footprint_dock, which move_base2 copies in per +# marker from maker_sources.yaml. DockPlanner: + # Boost.DLL library containing the exported symbol "DockPlanner". library_path: libdock_planner - MyGlobalPlanner: - cost_threshold: 200 # Ngưỡng chi phí vật cản (0-255) - safety_distance: 2 # Khoảng cách an toàn (cells) - use_dijkstra: false # Sử dụng Dijkstra thay vì A* - - # File: config/costmap_params.yaml - global_costmap: - inflation_radius: 0.3 # Bán kính phình vật cản - cost_scaling_factor: 10.0 # Hệ số tỷ lệ chi phí \ No newline at end of file + + approach: + # [m] Extra straight alignment distance beyond half the combined robot/dock + # X extents. Increase if the robot must align earlier before entering a dock. + alignment_distance_padding: 0.0 + + # [m] Lateral-distance range used to interpolate angle_threshold_*. + # Values outside this range are clamped, so behavior remains bounded. + lateral_distance_near: 0.10 + lateral_distance_far: 1.00 + + # [rad] Permitted joining angle at the near/far lateral-distance limits. + # Required relation: 0 < far < near < pi. + angle_threshold_near: 2.35619449019 # 0.75*pi + angle_threshold_far: 1.09955742876 # 0.35*pi + + # [rad] Relaxes the forward direction test relative to the reverse test. + # Required: 0 <= value < angle_threshold_far. + direction_angle_hysteresis: 0.05 + + # [m] Distance margin used when rejecting a reference-path joining point + # that is already too close to the end of the approach curve. + direction_distance_tolerance: 0.10 + + sampling: + # [m] Target spacing between generated path poses. The curve is sampled by + # arc-length estimate and always includes both endpoints. + path_point_spacing: 0.05 + + # footprint_dock is intentionally not declared here. It describes the + # physical dock, not the robot, and move_base2 copies the value selected from + # docking_marker_profiles//footprint_dock into this namespace before + # constructing the planner. If absent, dock size contributes 0 m to approach + # geometry and DockPlanner emits a warning. diff --git a/config/runtime/maker_sources.yaml b/config/runtime/maker_sources.yaml index 42c98b9..a03550b 100644 --- a/config/runtime/maker_sources.yaml +++ b/config/runtime/maker_sources.yaml @@ -22,19 +22,56 @@ maker_sources: trolley charger dock_station undock_station dock_station_2 undock # Marker có entry ở đây dùng CẶP PLANNER RIÊNG. Marker rỗng, hoặc chỉ có trong `maker_sources` mà # không nằm trong bảng này, sẽ dùng cặp `docking` mặc định của move_base_common_params.yaml. # -# ► Chỉnh: chỉ khai marker nào THỰC SỰ cần planner khác mặc định — ba entry dưới đây đang trùng y -# hệt cặp mặc định, tức chúng không đổi hành vi gì, giữ lại chỉ để làm chỗ móc khi cần tách sau -# này. Tham số của planner nằm ở YAML riêng của plugin (dock_global_params.yaml, -# hybrid_local_planner_params.yaml), KHÔNG khai ở đây. +# ► Chỉnh: chỉ khai marker nào THỰC SỰ cần planner khác mặc định. Tham số của planner nằm ở YAML +# riêng của plugin (dock_global_params.yaml, stanley_local_planner_params.yaml), KHÔNG khai ở đây — +# trừ `dock_anchor` và `footprint_dock` dưới đây. +# +# ── dock_anchor ─────────────────────────────────────────────────────────────────────────────────── +# +# Goal pose của marker nằm ở đâu trên đối tượng dock: +# center — goal ở tâm footprint dock; DockPlanner cộng thêm extent từ tâm tới mặt tiếp cận +# (lấy từ footprint_dock). Mặc định khi không khai — giữ nguyên hành vi cũ. +# face — goal đã nằm ngay tâm MẶT tiếp cận; dock không đóng góp vào khoảng dừng, +# footprint_dock bị bỏ qua hoàn toàn (DockPlanner log info nếu vẫn khai). +# +# ── footprint_dock ──────────────────────────────────────────────────────────────────────────────── +# +# Đa giác của ĐỐI TƯỢNG DOCK (kệ / trạm sạc), [m], trong frame của goal pose. KHÔNG phải footprint +# robot: footprint robot khai ở costmap và dùng cho collision check, còn khoá này vào khoảng dừng +# của DockCalc — điểm robot bắt đầu đoạn căn thẳng trước dock: +# +# alignment_distance = + + padding +# +# Chỉ dùng khi `dock_anchor: center`. Khai thiếu = dock bị coi là một điểm, robot tiến sát hơn dự +# tính đúng extent tới mặt gần. +# +# ⚠ CHƯA KHAI TRÊN ROBOT NÀY — cố ý. Không khai = giữ đúng hành vi đang chạy ngoài hiện trường; +# khai một con số chưa đo là dịch điểm dừng của robot đi đúng nửa chiều dài số đó. +# ► Chỉnh: đo kích thước THẬT của từng loại kệ/trạm rồi mở comment. Trục x là hướng robot tiến +# vào. Chúng khác nhau theo loại — để trùng số là mất tác dụng của việc khai theo marker. +# +# Hai khoá trên là các khoá DUY NHẤT trong bảng này được rót xuống plugin: +# `PlannerRunner::bindDockingMarker()` chép chúng sang namespace của `global_planner` khai ngay bên +# trên, TRƯỚC khi instance được dựng, rồi dựng lại instance khi marker đổi. +# +# ⚠ Chỉ `DockPlanner` đọc hai khoá này. Marker nào khai global planner khác thì giá trị vẫn được +# chép sang namespace đó nhưng không ai đọc — không lỗi, không log, chỉ là không có tác dụng. docking_marker_profiles: trolley: global_planner: DockPlanner local_planner: StanleyLocalPlanner + # Goal ở trọng tâm xe trolley (robot chui gầm) → cộng extent tâm→mặt từ footprint_dock. + dock_anchor: center + # footprint_dock: [[x,-y],[x,y],[-x,y],[-x,-y]] # đo rồi mở charger: global_planner: DockPlanner local_planner: StanleyLocalPlanner + # Goal teach ngay tâm mặt trạm sạc → dock không đóng góp khoảng dừng. + dock_anchor: face dock_station: global_planner: DockPlanner local_planner: StanleyLocalPlanner + dock_anchor: center + # footprint_dock: [[x,-y],[x,y],[-x,y],[-x,-y]] # đo rồi mở