docs: viết lại comment các file config bằng tiếng Việt

File YAML là thứ người vận hành mở ra sửa khi đứng cạnh robot, nên comment phải
đọc hiểu ngay. Mỗi tham số ghi đủ đơn vị, ý nghĩa và hệ quả khi tăng/giảm. Tên
key, plugin, frame, topic và thuật ngữ đã chuẩn hoá giữ nguyên tiếng Anh.
Không đổi một giá trị nào.
This commit is contained in:
2026-08-15 13:37:50 +07:00
parent 0c45d5491a
commit 31c5b218cb
6 changed files with 248 additions and 209 deletions

View File

@@ -96,5 +96,6 @@ obstacles:
frustum_min_range: 0.20 frustum_min_range: 0.20
frustum_max_range: 3.5 frustum_max_range: 3.5
# Depth camera clearing is handled by VoxelLayer frustum clearing from # Việc xoá vật cản (clearing) của camera depth do VoxelLayer đảm nhiệm bằng
# /camera/depth/image_raw + /camera/depth/camera_info. /camera_right/depth/data # frustum clearing, lấy dữ liệu từ /camera/depth/image_raw +
# /camera/depth/camera_info. Nhánh /camera_right/depth/data cũng đi đường đó.

View File

@@ -1,70 +1,84 @@
# DockPlanner: one curved lead-in away from the dock, one direction change, then # DockPlanner — global planner sinh đường vào dock.
# a straight terminal leg along the goal yaw.
# #
# Which robot edge mates with the dock is DERIVED per plan from the side the # Hình dạng đường: một đoạn cua rời xa dock (lead-in), một điểm đổi chiều (cusp),
# robot stands on, not configured: # rồi một đoạn THẲNG cuối trùng hướng yaw của goal. Đoạn cuối luôn thẳng để robot
# robot on the +X side of the goal -> lead-in forward, terminal REVERSE # đã đạt đúng hướng trước khi chui vào dock — đi cong vào gầm trolley rất dễ va.
# (rear edge docks: forks into a pallet)
# robot on the -X side of the goal -> lead-in reverse, terminal FORWARD
# (front edge docks: charging contact)
# This works because the goal pose is already offset upstream so that base_link
# lands exactly on it for the intended maneuver.
# #
# Collision/free-space checking is intentionally not configured here yet: # Mép nào của robot áp vào dock được SUY RA theo từng lần lập plan, dựa vào phía
# DockPlanner currently generates geometry only. Do not add cost_threshold, # robot đang đứng so với goal. Không khai báo bằng tham số:
# allow_unknown, or check_free_space until the collision checker is implemented. # robot ở phía +X của goal -> lead-in đi TIẾN, đoạn cuối đi LÙI
# (mép sau áp dock: càng nâng chui vào pallet)
# robot ở phía -X của goal -> lead-in đi LÙI, đoạn cuối đi TIẾN
# (mép trước áp dock: chấu sạc ở đầu xe)
# Suy được như vậy vì goal đã được offset sẵn từ tầng trên, sao cho base_link
# dừng đúng tại goal khi manơ hoàn tất.
#
# Kiểm tra va chạm / vùng trống CỐ Ý chưa cấu hình ở đây: DockPlanner hiện chỉ
# sinh hình học. Đừng thêm cost_threshold, allow_unknown hay check_free_space
# cho tới khi phần kiểm va chạm được hiện thực.
DockPlanner: DockPlanner:
# Boost.DLL library containing the exported symbol "DockPlanner". # Thư viện Boost.DLL chứa symbol export tên "DockPlanner".
library_path: libdock_planner library_path: libdock_planner
kinematics: kinematics:
# Axle frames used to measure wheel_base from TF, matching StanleyControl. # Hai frame trục bánh, dùng để ĐO wheel_base từ TF. Phải trùng với cặp frame
# StanleyControl đang dùng, nếu lệch thì bán kính cua tính ra sai.
front_axle_frame: "steer_link" front_axle_frame: "steer_link"
rear_axle_frame: "base_link" rear_axle_frame: "base_link"
# [rad] Maximum equivalent bicycle steering angle while driving the # [rad] Góc lái lớn nhất của mô hình xe đạp tương đương khi chạy đoạn cua.
# approach curve. Measure this on the real robot; this is not a servo tick, # PHẢI đo trên robot thật. Đây KHÔNG phải tick servo, KHÔNG phải góc vô lăng,
# steering-wheel angle, or the special standstill-pivot angle. # cũng KHÔNG phải góc pivot tại chỗ.
# Quyết định bán kính cua nhỏ nhất: R_min = wheel_base / tan(góc này).
# Khai lớn hơn thực tế -> planner sinh cung robot bám không nổi, robot lệch
# path. Khai nhỏ hơn thực tế -> đường vòng rộng, tốn không gian.
max_steering_angle: 0.80 max_steering_angle: 0.80
maneuver: maneuver:
# [m] The cusp is placed at least this far from the start, measured away # [m] Cusp được đặt cách điểm xuất phát ít nhất khoảng này, đo theo hướng RỜI
# from the dock. This guarantees a real lead-in leg before the terminal. # XA dock. Bảo đảm luôn có một đoạn lead-in thật trước khi đổi chiều, thay vì
# cusp trùng ngay vị trí robot.
minimum_forward_distance: 0.25 minimum_forward_distance: 0.25
# [m] Reject a maneuver whose cusp has to sit farther than this from the # [m] Từ chối lập plan nếu cusp phải nằm xa hơn khoảng này so với điểm xuất
# start to satisfy the turning-radius and dock-clearance constraints. # phát để thoả ràng buộc bán kính cua và khoảng hở với dock.
# Tăng lên nếu robot đứng lệch nhiều mà vẫn muốn ra được plan; giảm xuống nếu
# muốn chặn sớm những manơ chiếm quá nhiều không gian.
maximum_forward_extension: 3.0 maximum_forward_extension: 3.0
# [m] Plan a NO-CUSP entry (one arc onto the dock axis, then the straight # [m] Bật kiểu vào dock KHÔNG CÓ CUSP (một cung hội tụ vào trục goal rồi đi
# terminal in the same travel direction) when the room left for the arc -- # thẳng vào, giữ nguyên một chiều chạy) khi khoảng chỗ còn lại cho cung —
# the start distance along the approach axis minus the straight terminal # tức khoảng cách dọc trục từ robot tới goal trừ đi độ dài đoạn thẳng cuối —
# length -- exceeds this. The arc radius is still checked against the # vượt ngưỡng này.
# Ackermann limit; the single-cusp maneuver is planned whenever either test # Bán kính cung VẪN được kiểm với giới hạn Ackermann. Trượt bất kỳ phép kiểm
# fails, so this only ever removes a direction change, never adds one. # nào thì quay về đường có cusp, nên tham số này chỉ có thể BỚT một lần đổi
# 0 disables it and always plans a cusp. # chiều, không bao giờ thêm.
# Đặt 0 = tắt hẳn, luôn lập đường có cusp.
direct_entry_min_curve_room: 0.5 direct_entry_min_curve_room: 0.5
terminal: terminal:
# [m] Extra straight-terminal distance beyond the mating robot extent # [m] Khoảng hở CỘNG THÊM cho đoạn thẳng cuối, ngoài phần thân robot nhô ra ở
# (rear_extent when the terminal reverses, front_extent when it drives # mép áp dock (rear_extent khi đoạn cuối đi lùi, front_extent khi đi tiến) và,
# forward) and, for dock_anchor=center, the dock near-face extent. # nếu dock_anchor=center, ngoài nửa thân dock phía tiếp cận.
# Tăng lên nếu thấy robot dừng quá sát dock.
reverse_distance_padding: 0.0 reverse_distance_padding: 0.0
# [m] Requested length of the straight terminal leg. The effective length is # [m] Độ dài đoạn thẳng cuối MONG MUỐN. Giá trị thực tế là
# max(this, mating extent + dock near extent + padding), so 0 keeps the # max(giá trị này, phần nhô mép áp dock + nửa thân dock + padding), nên đặt 0
# clearance-only behaviour. Raising it gives the robot a longer straight run # là chỉ dùng khoảng hở tối thiểu.
# to settle its heading before it enters the dock, but it eats into the room # Tăng lên thì robot có quãng thẳng dài hơn để chỉnh hết sai số hướng trước
# left for the entry arc, so a large value pushes the plan back to a cusp. # khi vào dock, ĐỔI LẠI ăn vào chỗ dành cho cung, nên đặt lớn quá sẽ đẩy plan
# quay về kiểu có cusp.
straight_length: 0.0 straight_length: 0.0
sampling: sampling:
# [m] Maximum target spacing along both the forward arc and reverse line. # [m] Khoảng cách lớn nhất giữa hai điểm liên tiếp trên đường, áp dụng cho cả
# đoạn cung lẫn đoạn thẳng. Nhỏ hơn = đường mượt hơn nhưng nhiều điểm hơn.
path_point_spacing: 0.05 path_point_spacing: 0.05
# footprint_dock and dock_anchor are selected per marker by move_base2 and # footprint_dock và dock_anchor KHÔNG khai ở đây. move_base2 chọn theo từng
# copied into this namespace before the plugin is constructed. # marker rồi rót vào namespace này trước khi khởi tạo plugin.
# #
# dock_anchor: 'center' (default) — goal is the dock footprint center; the # dock_anchor: 'center' (mặc định) — goal nằm ở tâm dock; nửa thân dock phía
# near-face extent of footprint_dock contributes to cusp clearance. # tiếp cận (lấy từ footprint_dock) được cộng vào khoảng hở cusp.
# 'face' — goal already sits on the approach face; footprint_dock is ignored. # 'face' — goal đã nằm sẵn trên mặt tiếp cận; footprint_dock bị bỏ qua.

View File

@@ -1,55 +1,69 @@
# HybridLocalPlanner — local planner lai Pure Pursuit + DWA.
# Bám path bằng Pure Pursuit khi đường trống, chuyển sang DWA khi gặp vật cản,
# rồi nhập lại (rejoin) về path cũ.
HybridLocalPlanner: HybridLocalPlanner:
# base_local_planner: "hybrid_local_planner/HybridLocalPlanner" # base_local_planner: "hybrid_local_planner/HybridLocalPlanner"
# HybridLocalPlanner: # HybridLocalPlanner:
library_path: libhybrid_local_planner library_path: libhybrid_local_planner
# Robot
max_forward_velocity: 1.0
max_reverse_velocity: 0.25 # [m/s], positive magnitude
avoidance_max_velocity: 0.4
max_angular_velocity: 0.6
min_in_place_angular_velocity: 0.3
acc_lim_x: 0.1
decel_lim_x: 0.5
acc_lim_theta: 2.0
min_turn_radius: 0.0
robot_radius: 0.1
footprint_padding: 0.08
use_footprint: true
# GoalTolerance # ===== Giới hạn động học robot =====
xy_goal_tolerance: 0.02 max_forward_velocity: 1.0 # [m/s] trần vận tốc tiến
yaw_goal_tolerance: 0.02 max_reverse_velocity: 0.25 # [m/s] trần vận tốc lùi, ghi bằng ĐỘ LỚN DƯƠNG
avoidance_max_velocity: 0.4 # [m/s] trần vận tốc khi đang né vật cản, thấp hơn để an toàn
max_angular_velocity: 0.6 # [rad/s] trần tốc độ quay
min_in_place_angular_velocity: 0.3 # [rad/s] tốc độ quay tối thiểu khi quay tại chỗ,
# đặt quá thấp thì servo không thắng nổi ma sát tĩnh
acc_lim_x: 0.1 # [m/s^2] trần gia tốc khi tăng tốc
decel_lim_x: 0.5 # [m/s^2] trần gia tốc khi giảm tốc (độ lớn dương)
acc_lim_theta: 2.0 # [rad/s^2] trần gia tốc góc
min_turn_radius: 0.0 # [m] bán kính cua nhỏ nhất. 0 = không ràng buộc (vi sai)
robot_radius: 0.1 # [m] bán kính robot, chỉ dùng khi use_footprint = false
footprint_padding: 0.08 # [m] nới footprint thêm để có biên an toàn
use_footprint: true # true = kiểm va chạm theo footprint đa giác,
# false = coi robot là hình tròn robot_radius
# Trajectory # ===== Dung sai tới đích =====
max_global_plan_lookahead_dist: 3.0 xy_goal_tolerance: 0.02 # [m] sai số vị trí chấp nhận là đã tới goal
global_plan_viapoint_sep: 0.5 yaw_goal_tolerance: 0.02 # [rad] sai số góc chấp nhận là đã tới goal
global_plan_goal_sep: 0.05
predict_time: 3.0
sim_period: 0.1
sim_time_samples: 10
# Optimization # ===== Quỹ đạo và cách đọc path toàn cục =====
w_omega: 2.5 max_global_plan_lookahead_dist: 3.0 # [m] chỉ lấy phần path trong tầm này để bám
obs_cost_gain: 1.3 global_plan_viapoint_sep: 0.5 # [m] khoảng cách giữa các điểm trung gian trích ra từ path
path_cost_gain: 0.5 global_plan_goal_sep: 0.05 # [m] khoảng cách lấy mẫu dày hơn ở đoạn gần goal
to_goal_cost_gain: 0.8 predict_time: 3.0 # [s] DWA mô phỏng quỹ đạo trước bao lâu
speed_cost_gain: 0.5 sim_period: 0.1 # [s] bước thời gian khi mô phỏng
sim_time_samples: 10 # số bước mô phỏng trên mỗi quỹ đạo ứng viên
# Obstacles # ===== Trọng số hàm chi phí DWA =====
obs_range: 2.5 # Tăng một trọng số tức là giảm tương đối tất cả những cái còn lại.
w_omega: 2.5 # phạt quay nhiều, giữ robot đi thẳng khi có thể
obs_cost_gain: 1.3 # phạt tiến gần vật cản
path_cost_gain: 0.5 # phạt lệch khỏi path toàn cục
to_goal_cost_gain: 0.8 # thưởng cho quỹ đạo tiến gần goal
speed_cost_gain: 0.5 # thưởng cho quỹ đạo chạy nhanh
#GeneralSetting # ===== Vật cản =====
segment_transition_threshold: 0.03 # [m], also used as DWA stop distance for intermediate segments obs_range: 2.5 # [m] bán kính quét vật cản quanh robot
rotation_segment_yaw_threshold: 0.05 # [rad], ignore tiny yaw noise at duplicate positions
direction_change_hysteresis: 0.15 # normalized dot product # ===== Thiết lập chung =====
use_obstacle_avoidance: true segment_transition_threshold: 0.03 # [m] ngưỡng coi là đã tới hết một chặng path;
slow_velocity_th: 0.1 # cũng là khoảng cách DWA dừng ở chặng trung gian
turn_direction_th: 0.1 rotation_segment_yaw_threshold: 0.05 # [rad] bỏ qua nhiễu yaw nhỏ hơn ngưỡng này khi hai
avoidance_clear_hold_time: 0.5 # [s] # điểm path trùng vị trí, tránh quay vặt vô nghĩa
rejoin_blend_time: 0.8 # [s] direction_change_hysteresis: 0.15 # tích vô hướng chuẩn hoá. Trễ để robot không lật
rejoin_max_velocity: 0.25 # [m/s] # tiến/lùi liên tục quanh điểm đổi chiều
rejoin_heading_tolerance: 0.35 # [rad] use_obstacle_avoidance: true # false = tắt nhánh DWA, chỉ chạy Pure Pursuit
rejoin_path_tolerance: 0.20 # [m] slow_velocity_th: 0.1 # [m/s] dưới ngưỡng này coi như robot đang bò chậm
pp_max_omega_correction: 0.15 # [rad/s] turn_direction_th: 0.1 # [rad] ngưỡng xác định robot đang rẽ hướng nào
rejoin_acc_lim_theta: 1.0 # [rad/s^2]
rejoin_lookahead_distance: 0.8 # [m] # ----- Giai đoạn nhập lại path sau khi né vật cản -----
avoidance_clear_hold_time: 0.5 # [s] phải thấy đường thông liên tục bấy lâu mới thôi né,
# tránh nhấp nháy né/không né
rejoin_blend_time: 0.8 # [s] thời gian pha trộn mượt khi chuyển về bám path
rejoin_max_velocity: 0.25 # [m/s] trần vận tốc trong lúc nhập lại
rejoin_heading_tolerance: 0.35 # [rad] lệch hướng nhỏ hơn ngưỡng này mới cho nhập lại
rejoin_path_tolerance: 0.20 # [m] lệch ngang nhỏ hơn ngưỡng này mới cho nhập lại
pp_max_omega_correction: 0.15 # [rad/s] trần lượng hiệu chỉnh quay của Pure Pursuit
rejoin_acc_lim_theta: 1.0 # [rad/s^2] trần gia tốc góc riêng cho giai đoạn nhập lại
rejoin_lookahead_distance: 0.8 # [m] cự ly nhìn trước khi nhập lại. Lớn = vào mượt nhưng
# cắt cua; nhỏ = bám sát nhưng dễ lắc

View File

@@ -7,7 +7,7 @@ LocalPlannerAdapter:
MPPILocalPlanner: MPPILocalPlanner:
library_path: libmppi_local_planner library_path: libmppi_local_planner
# Robot limits [m/s, rad/s] # ===== Giới hạn robot [m/s, rad/s] =====
min_velocity: 0.0 min_velocity: 0.0
# Cao hon reference_velocity mot khoang dem (headroom). Neu de sat ref thi # Cao hon reference_velocity mot khoang dem (headroom). Neu de sat ref thi
# nua tren cua nhieu sampling bi clamp o max, keo van toc trung binh xuong # nua tren cua nhieu sampling bi clamp o max, keo van toc trung binh xuong
@@ -19,7 +19,7 @@ MPPILocalPlanner:
obstacle_point_radius: 0.08 obstacle_point_radius: 0.08
footprint_padding: 0.05 footprint_padding: 0.05
# MPPI core # ===== Lõi MPPI =====
# Horizon = model_dt * time_steps = 3.6 s ~ 1.8 m @0.5 m/s. # Horizon = model_dt * time_steps = 3.6 s ~ 1.8 m @0.5 m/s.
# Truoc day 1.4 s (0.7 m) qua ngan: robot chi "thay" vat can khi da sat, khong con # Truoc day 1.4 s (0.7 m) qua ngan: robot chi "thay" vat can khi da sat, khong con
# cho de vong qua -> hoac ket hoac lang nhang. Do thuc te: 0.7m/1.2m khong toi dich; # cho de vong qua -> hoac ket hoac lang nhang. Do thuc te: 0.7m/1.2m khong toi dich;
@@ -38,14 +38,14 @@ MPPILocalPlanner:
wz_std: 0.25 wz_std: 0.25
reference_velocity: 0.48 reference_velocity: 0.48
# Path and goal # ===== Path và goal =====
# Phai lon hon horizon (1.8 m), neu khong terminal goal_weight se keo robot ve # Phai lon hon horizon (1.8 m), neu khong terminal goal_weight se keo robot ve
# diem cat cua reference path va lam no giam toc moi chu ky. # diem cat cua reference path va lam no giam toc moi chu ky.
max_global_plan_lookahead_dist: 3.0 max_global_plan_lookahead_dist: 3.0
xy_goal_tolerance: 0.10 xy_goal_tolerance: 0.10
yaw_goal_tolerance: 0.10 yaw_goal_tolerance: 0.10
# Costmap and cost weights # ===== Costmap và trọng số hàm chi phí =====
obstacle_range: 2.5 obstacle_range: 2.5
obstacle_cost_threshold: 150 obstacle_cost_threshold: 150
obstacle_cell_step: 2 obstacle_cell_step: 2
@@ -77,7 +77,7 @@ MPPILocalPlanner:
stuck_omega_threshold: 0.05 stuck_omega_threshold: 0.05
stuck_patience_cycles: 40 stuck_patience_cycles: 40
# --- Covariance thich nghi (giai doan 2) --- # ===== Covariance thích nghi (giai đoạn 2) =====
# Moi chu ky fit lai do rong nhieu cho TUNG buoc thoi gian tu chinh batch. # Moi chu ky fit lai do rong nhieu cho TUNG buoc thoi gian tu chinh batch.
# vx_std/wz_std o tren chi con la gia tri khoi tao va gia tri sau reset. # vx_std/wz_std o tren chi con la gia tri khoi tao va gia tri sau reset.
adaptive_covariance: true adaptive_covariance: true

View File

@@ -5,37 +5,37 @@ min_approach_linear_velocity: 0.05
LocalPlannerAdapter: LocalPlannerAdapter:
library_path: liblocal_planner_adapter library_path: liblocal_planner_adapter
PNKXLocalPlanner: PNKXLocalPlanner:
# Algorithm # Thuật toán
library_path: libpnkx_local_planner library_path: libpnkx_local_planner
trajectory_generator_name: LimitedAccelGenerator trajectory_generator_name: LimitedAccelGenerator
algorithm_nav_name: MKTAlgorithmDiffPredictiveTrajectory algorithm_nav_name: MKTAlgorithmDiffPredictiveTrajectory
algorithm_rotate_name: MKTAlgorithmDiffRotateToGoal algorithm_rotate_name: MKTAlgorithmDiffRotateToGoal
# Goal checking # Bộ kiểm tra đã tới goal
goal_checker_name: GoalChecker goal_checker_name: GoalChecker
PNKXDockingLocalPlanner: PNKXDockingLocalPlanner:
# Algorithm # Thuật toán
library_path: libpnkx_local_planner library_path: libpnkx_local_planner
trajectory_generator_name: LimitedAccelGenerator trajectory_generator_name: LimitedAccelGenerator
algorithm_nav_name: MKTAlgorithmDiffPredictiveTrajectory algorithm_nav_name: MKTAlgorithmDiffPredictiveTrajectory
algorithm_rotate_name: MKTAlgorithmDiffRotateToGoal algorithm_rotate_name: MKTAlgorithmDiffRotateToGoal
# Goal checking # Bộ kiểm tra đã tới goal
goal_checker_name: GoalChecker goal_checker_name: GoalChecker
PNKXGoStraightLocalPlanner: PNKXGoStraightLocalPlanner:
# Algorithm # Thuật toán
library_path: libpnkx_local_planner library_path: libpnkx_local_planner
trajectory_generator_name: LimitedAccelGenerator trajectory_generator_name: LimitedAccelGenerator
algorithm_nav_name: MKTAlgorithmDiffGoStraight algorithm_nav_name: MKTAlgorithmDiffGoStraight
# Goal checking # Bộ kiểm tra đã tới goal
goal_checker_name: GoalChecker goal_checker_name: GoalChecker
PNKXRotateLocalPlanner: PNKXRotateLocalPlanner:
# Algorithm # Thuật toán
library_path: libpnkx_local_planner library_path: libpnkx_local_planner
algorithm_rotate_name: MKTAlgorithmDiffRotateToGoal algorithm_rotate_name: MKTAlgorithmDiffRotateToGoal
trajectory_generator_name: LimitedAccelGenerator trajectory_generator_name: LimitedAccelGenerator
# Goal checking # Bộ kiểm tra đã tới goal
goal_checker_name: SimpleGoalChecker goal_checker_name: SimpleGoalChecker
stateful: true stateful: true
@@ -44,23 +44,23 @@ LimitedAccelGenerator:
max_vel_x: 1.2 max_vel_x: 1.2
min_vel_x: -1.2 min_vel_x: -1.2
max_vel_y: 0.0 # diff drive robot max_vel_y: 0.0 # robot vi sai: không có chuyển động ngang
min_vel_y: 0.0 # diff drive robot min_vel_y: 0.0 # robot vi sai: không có chuyển động ngang
max_speed_xy: 2.0 # max_trans_vel: 0.8 # choose slightly less than the base's capability max_speed_xy: 2.0 # [m/s] trần tốc độ tịnh tiến. Đặt thấp hơn khả năng thật của base một chút
min_speed_xy: 0.25 # min_trans_vel: 0.1 # this is the min trans velocity when there is negligible rotational velocity min_speed_xy: 0.25 # [m/s] tốc độ tịnh tiến tối thiểu khi gần như không quay
max_vel_theta: 0.4 # max_rot_vel: 1.0 # choose slightly less than the base's capability max_vel_theta: 0.4 # [rad/s] trần tốc độ quay. Đặt thấp hơn khả năng thật của base một chút
min_vel_theta: 0.05 # min_rot_vel: 0.1 default: 0.4 # this is the min angular velocity when there is negligible translational velocity min_vel_theta: 0.05 # [rad/s] tốc độ quay tối thiểu khi gần như không tịnh tiến
acc_lim_x: 3.0 acc_lim_x: 3.0
acc_lim_y: 0.0 # diff drive robot acc_lim_y: 0.0 # robot vi sai: không có chuyển động ngang
acc_lim_theta: 1.5 acc_lim_theta: 1.5
decel_lim_x: -3.0 decel_lim_x: -3.0
decel_lim_y: -0.0 decel_lim_y: -0.0
decel_lim_theta: -2.0 decel_lim_theta: -2.0
# Whether to split the path into segments or not # Có cắt path thành từng chặng hay không
split_path: true split_path: true
sim_time: 1.5 sim_time: 1.5
vx_samples: 15 vx_samples: 15
@@ -69,7 +69,7 @@ LimitedAccelGenerator:
discretize_by_time: true discretize_by_time: true
angular_granularity: 0.05 angular_granularity: 0.05
linear_granularity: 0.1 linear_granularity: 0.1
# sim_period # sim_period: lấy theo chu kỳ điều khiển
include_last_point: true include_last_point: true
MKTAlgorithmDiffPredictiveTrajectory: MKTAlgorithmDiffPredictiveTrajectory:
@@ -79,7 +79,8 @@ MKTAlgorithmDiffPredictiveTrajectory:
index_samples: 60 index_samples: 60
follow_step_path: true follow_step_path: true
# Kalman filter tuning (filters v and w commands) # Chỉnh bộ lọc Kalman (lọc lệnh v và w trước khi gửi xuống base).
# q_* = nhiễu quá trình, r_* = nhiễu đo. Tăng r_* -> lọc mạnh, lệnh mượt nhưng chậm đáp ứng
kf_q_v: 0.25 kf_q_v: 0.25
kf_q_w: 0.8 kf_q_w: 0.8
kf_r_v: 0.05 kf_r_v: 0.05
@@ -87,25 +88,26 @@ MKTAlgorithmDiffPredictiveTrajectory:
kf_p0: 0.5 kf_p0: 0.5
kf_filter_angular: false kf_filter_angular: false
# Lookahead # ----- Điểm nhìn trước (lookahead) -----
use_velocity_scaled_lookahead_dist: true # Whether to use the velocity scaled lookahead distances or constant lookahead_distance. (default: false) use_velocity_scaled_lookahead_dist: true # true = cự ly nhìn trước co giãn theo vận tốc; false = dùng cố định lookahead_dist. (mặc định: false)
# only when false: # chỉ có tác dụng khi cờ trên = false:
lookahead_dist: 0.5 # The lookahead distance (m) to use to find the lookahead point. (default: 0.6) lookahead_dist: 0.5 # [m] cự ly nhìn trước cố định để chọn điểm bám. (mặc định: 0.6)
# only when true: # chỉ có tác dụng khi cờ trên = true:
min_lookahead_dist: 0.6 # The minimum lookahead distance (m) threshold. (default: 0.3) min_lookahead_dist: 0.6 # [m] cận dưới của cự ly nhìn trước. Nhỏ quá thì robot lắc ở tốc độ thấp. (mặc định: 0.3)
max_lookahead_dist: 2.0 # The maximum lookahead distance (m) threshold. (default: 0.9) max_lookahead_dist: 2.0 # [m] cận trên của cự ly nhìn trước. Lớn quá thì robot cắt cua. (mặc định: 0.9)
lookahead_time: 1.9 # The time (s) to project the velocity by, a.k.a. lookahead gain. (default: 1.5) lookahead_time: 1.9 # [s] nhân với vận tốc hiện tại ra cự ly nhìn trước, tức hệ số lookahead. (mặc định: 1.5)
min_journey_squared: 0.2 # Minimum squared journey to consider for goal (default: 0.2) min_journey_squared: 0.2 # [m^2] quãng đường bình phương tối thiểu mới xét tới goal (mặc định: 0.2)
max_journey_squared: 0.5 # Maximum squared journey to consider for goal (default: 0.2) max_journey_squared: 0.5 # [m^2] quãng đường bình phương tối đa còn xét tới goal (mặc định: 0.2)
max_lateral_accel: 0.9 # Max lateral accel for speed reduction on curves (m/s^2) max_lateral_accel: 0.9 # [m/s^2] trần gia tốc ngang, dùng để tự giảm tốc khi vào cua
# Rotate to heading param - onle one of use_rotate_to_heading and allow_reversing can be set to true # ----- Quay tại chỗ về đúng hướng -----
use_rotate_to_heading: true # Whether to enable rotating to rough heading and goal orientation when using holonomic planners. Recommended on for all robot types that can rotate in place. (default: true) # Chỉ được bật MỘT trong hai: use_rotate_to_heading hoặc allow_reversing
# only when true: use_rotate_to_heading: true # Cho phép quay tại chỗ về hướng path và về hướng goal. Nên bật với mọi robot quay tại chỗ được. (mặc định: true)
rotate_to_heading_min_angle: 0.03 # The difference in the path orientation and the starting robot orientation (radians) to trigger a rotate in place. (default: 0.785) # chỉ có tác dụng khi cờ trên = true:
rotate_to_heading_min_angle: 0.03 # [rad] lệch hướng giữa path và robot vượt ngưỡng này thì quay tại chỗ trước khi chạy. (mặc định: 0.785)
angular_decel_zone: 0.1 angular_decel_zone: 0.1
# stoped # Ngưỡng coi robot là ĐÃ DỪNG
rot_stopped_velocity: 0.03 rot_stopped_velocity: 0.03
trans_stopped_velocity: 0.03 trans_stopped_velocity: 0.03
@@ -124,25 +126,26 @@ MKTAlgorithmDiffGoStraight:
index_samples: 60 index_samples: 60
follow_step_path: true follow_step_path: true
# Lookahead # ----- Điểm nhìn trước (lookahead) -----
use_velocity_scaled_lookahead_dist: true # Whether to use the velocity scaled lookahead distances or constant lookahead_distance. (default: false) use_velocity_scaled_lookahead_dist: true # true = cự ly nhìn trước co giãn theo vận tốc; false = dùng cố định lookahead_dist. (mặc định: false)
# only when false: # chỉ có tác dụng khi cờ trên = false:
lookahead_dist: 0.5 # The lookahead distance (m) to use to find the lookahead point. (default: 0.6) lookahead_dist: 0.5 # [m] cự ly nhìn trước cố định để chọn điểm bám. (mặc định: 0.6)
# only when true: # chỉ có tác dụng khi cờ trên = true:
min_lookahead_dist: 0.6 # The minimum lookahead distance (m) threshold. (default: 0.3) min_lookahead_dist: 0.6 # [m] cận dưới của cự ly nhìn trước. Nhỏ quá thì robot lắc ở tốc độ thấp. (mặc định: 0.3)
max_lookahead_dist: 2.0 # The maximum lookahead distance (m) threshold. (default: 0.9) max_lookahead_dist: 2.0 # [m] cận trên của cự ly nhìn trước. Lớn quá thì robot cắt cua. (mặc định: 0.9)
lookahead_time: 2.0 # The time (s) to project the velocity by, a.k.a. lookahead gain. (default: 1.5) lookahead_time: 2.0 # [s] nhân với vận tốc hiện tại ra cự ly nhìn trước, tức hệ số lookahead. (mặc định: 1.5)
min_journey_squared: 1.0 # Minimum squared journey to consider for goal (default: 0.2) min_journey_squared: 1.0 # [m^2] quãng đường bình phương tối thiểu mới xét tới goal (mặc định: 0.2)
max_journey_squared: 1.0 # Maximum squared journey to consider for goal (default: 0.2) max_journey_squared: 1.0 # [m^2] quãng đường bình phương tối đa còn xét tới goal (mặc định: 0.2)
max_lateral_accel: 0.9 # Max lateral accel for speed reduction on curves (m/s^2) max_lateral_accel: 0.9 # [m/s^2] trần gia tốc ngang, dùng để tự giảm tốc khi vào cua
# Rotate to heading param - onle one of use_rotate_to_heading and allow_reversing can be set to true # ----- Quay tại chỗ về đúng hướng -----
use_rotate_to_heading: true # Whether to enable rotating to rough heading and goal orientation when using holonomic planners. Recommended on for all robot types that can rotate in place. (default: true) # Chỉ được bật MỘT trong hai: use_rotate_to_heading hoặc allow_reversing
# only when true: use_rotate_to_heading: true # Cho phép quay tại chỗ về hướng path và về hướng goal. Nên bật với mọi robot quay tại chỗ được. (mặc định: true)
rotate_to_heading_min_angle: 0.03 # The difference in the path orientation and the starting robot orientation (radians) to trigger a rotate in place. (default: 0.785) # chỉ có tác dụng khi cờ trên = true:
rotate_to_heading_min_angle: 0.03 # [rad] lệch hướng giữa path và robot vượt ngưỡng này thì quay tại chỗ trước khi chạy. (mặc định: 0.785)
angular_decel_zone: 0.1 angular_decel_zone: 0.1
# stoped # Ngưỡng coi robot là ĐÃ DỪNG
rot_stopped_velocity: 0.03 rot_stopped_velocity: 0.03
trans_stopped_velocity: 0.03 trans_stopped_velocity: 0.03
@@ -161,25 +164,26 @@ MKTAlgorithmDiffRotateToGoal:
index_samples: 60 index_samples: 60
follow_step_path: true follow_step_path: true
# Lookahead # ----- Điểm nhìn trước (lookahead) -----
use_velocity_scaled_lookahead_dist: true # Whether to use the velocity scaled lookahead distances or constant lookahead_distance. (default: false) use_velocity_scaled_lookahead_dist: true # true = cự ly nhìn trước co giãn theo vận tốc; false = dùng cố định lookahead_dist. (mặc định: false)
# only when false: # chỉ có tác dụng khi cờ trên = false:
lookahead_dist: 0.5 # The lookahead distance (m) to use to find the lookahead point. (default: 0.6) lookahead_dist: 0.5 # [m] cự ly nhìn trước cố định để chọn điểm bám. (mặc định: 0.6)
# only when true: # chỉ có tác dụng khi cờ trên = true:
min_lookahead_dist: 0.6 # The minimum lookahead distance (m) threshold. (default: 0.3) min_lookahead_dist: 0.6 # [m] cận dưới của cự ly nhìn trước. Nhỏ quá thì robot lắc ở tốc độ thấp. (mặc định: 0.3)
max_lookahead_dist: 2.0 # The maximum lookahead distance (m) threshold. (default: 0.9) max_lookahead_dist: 2.0 # [m] cận trên của cự ly nhìn trước. Lớn quá thì robot cắt cua. (mặc định: 0.9)
lookahead_time: 1.9 # The time (s) to project the velocity by, a.k.a. lookahead gain. (default: 1.5) lookahead_time: 1.9 # [s] nhân với vận tốc hiện tại ra cự ly nhìn trước, tức hệ số lookahead. (mặc định: 1.5)
min_journey_squared: 0.2 # Minimum squared journey to consider for goal (default: 0.2) min_journey_squared: 0.2 # [m^2] quãng đường bình phương tối thiểu mới xét tới goal (mặc định: 0.2)
max_journey_squared: 0.8 # Maximum squared journey to consider for goal (default: 0.2) max_journey_squared: 0.8 # [m^2] quãng đường bình phương tối đa còn xét tới goal (mặc định: 0.2)
max_lateral_accel: 0.9 # Max lateral accel for speed reduction on curves (m/s^2) max_lateral_accel: 0.9 # [m/s^2] trần gia tốc ngang, dùng để tự giảm tốc khi vào cua
# Rotate to heading param - onle one of use_rotate_to_heading and allow_reversing can be set to true # ----- Quay tại chỗ về đúng hướng -----
use_rotate_to_heading: true # Whether to enable rotating to rough heading and goal orientation when using holonomic planners. Recommended on for all robot types that can rotate in place. (default: true) # Chỉ được bật MỘT trong hai: use_rotate_to_heading hoặc allow_reversing
# only when true: use_rotate_to_heading: true # Cho phép quay tại chỗ về hướng path và về hướng goal. Nên bật với mọi robot quay tại chỗ được. (mặc định: true)
rotate_to_heading_min_angle: 0.03 # The difference in the path orientation and the starting robot orientation (radians) to trigger a rotate in place. (default: 0.785) # chỉ có tác dụng khi cờ trên = true:
rotate_to_heading_min_angle: 0.03 # [rad] lệch hướng giữa path và robot vượt ngưỡng này thì quay tại chỗ trước khi chạy. (mặc định: 0.785)
angular_decel_zone: 0.1 angular_decel_zone: 0.1
# stoped # Ngưỡng coi robot là ĐÃ DỪNG
rot_stopped_velocity: 0.03 rot_stopped_velocity: 0.03
trans_stopped_velocity: 0.03 trans_stopped_velocity: 0.03

View File

@@ -1,56 +1,62 @@
PriestLocalPlanner: PriestLocalPlanner:
library_path: libpriest_local_planner library_path: libpriest_local_planner
# ================= Horizon / optimizer ================= # ================= Tầm nhìn / bộ tối ưu =================
t_fin: 7.0 # [s] planning horizon t_fin: 7.0 # [s] tầm nhìn dự báo, robot lập kế hoạch trước bao lâu
num_steps: 30 # trajectory samples over the horizon num_steps: 30 # số điểm mẫu trên mỗi quỹ đạo trong tầm nhìn đó
num_batch: 60 # trajectories per CEM iteration num_batch: 60 # số quỹ đạo sinh ra mỗi vòng lặp CEM. Tăng = tìm kỹ hơn, tốn CPU hơn
initial_up_sampling: 5 # candidate oversampling factor initial_up_sampling: 5 # hệ số sinh dư ứng viên ở vòng đầu trước khi lọc
ellite_num: 40 # elites ranked by projection residual ellite_num: 40 # số quỹ đạo "tinh hoa" giữ lại, xếp hạng theo sai số chiếu
num_warm: 20 # warm-started trajectories between cycles num_warm: 20 # số quỹ đạo mang từ chu kỳ trước sang để khởi động nóng
max_proj_iter: 8 # alternating projection iterations max_proj_iter: 8 # số vòng lặp chiếu luân phiên (alternating projection)
max_cem_iter: 4 # CEM iterations per control cycle max_cem_iter: 4 # số vòng lặp CEM mỗi chu kỳ điều khiển
optimizer_threads: 4 # bounded workers; avoid severe overhead from using all CPU cores optimizer_threads: 4 # số thread giới hạn. Đừng lấy hết số core — overhead nuốt hết lợi ích
solve_time_warn_ms: 30.0 # [ms] leaves margin inside the 30 Hz controller period solve_time_warn_ms: 30.0 # [ms] cảnh báo khi giải lâu hơn ngưỡng này, chừa biên trong chu kỳ 30 Hz
lateral_std: 0.8 # [m] std of lateral waypoint perturbations lateral_std: 0.8 # [m] độ lệch chuẩn khi nhiễu loạn waypoint theo phương ngang.
# Lớn = khám phá rộng, dễ tìm đường vòng; nhỏ = bám sát path toàn cục
# ================= Robot limits (differential drive) ================= # ================= Giới hạn robot (dẫn động vi sai) =================
max_velocity: 0.5 # [m/s] forward velocity limit max_velocity: 0.5 # [m/s] trần vận tốc tiến
max_angular_velocity: 0.4 # [rad/s] also enforced inside the optimizer as a max_angular_velocity: 0.4 # [rad/s] đồng thời được ép bên trong bộ tối ưu dưới dạng
# lateral-acceleration clamp |a_n| <= omega_max * v # chặn gia tốc ngang |a_n| <= max_angular_velocity * v
max_acceleration: 0.5 # [m/s^2] used in the trajectory projection max_acceleration: 0.5 # [m/s^2] dùng trong phép chiếu quỹ đạo
reference_velocity: 0.4 # [m/s] desired cruise speed along the path reference_velocity: 0.4 # [m/s] tốc độ hành trình mong muốn dọc path
v_eps: 0.05 # [m/s] below this speed the curvature clamp/cost is skipped v_eps: 0.05 # [m/s] chậm hơn ngưỡng này thì bỏ qua phần chặn/phạt độ cong,
v_min_seed: 0.05 # [m/s] initial-velocity seed along yaw when the robot is stopped # tránh chia cho số gần 0 khi robot gần đứng yên
v_min_seed: 0.05 # [m/s] vận tốc mồi theo hướng yaw khi robot đang đứng yên,
# để bộ tối ưu có điểm xuất phát khác 0
# Trajectory -> differential (v, omega) conversion with curvature feedforward: # Đổi quỹ đạo -> lệnh vi sai (v, omega), có feedforward theo độ cong:
# omega = clamp(omega_traj, +-max_angular_velocity) - heading_gain * heading_error # omega = clamp(omega_traj, +-max_angular_velocity) - heading_gain * sai_số_hướng
heading_gain: 1.5 # [1/s] feedback gain on the heading error heading_gain: 1.5 # [1/s] hệ số phản hồi trên sai số hướng.
heading_error_stop: 1.2 # [rad] above this, rotate in place (v = 0) # Tăng = bẻ về path nhanh hơn nhưng dễ dao động
min_in_place_yawrate: 0.2 # [rad/s] heading_error_stop: 1.2 # [rad] lệch hướng lớn hơn ngưỡng này thì quay tại chỗ (v = 0)
min_in_place_yawrate: 0.2 # [rad/s] tốc độ quay tối thiểu khi quay tại chỗ, tránh quay quá chậm
# ================= Goal / plan ================= # ================= Goal / plan =================
xy_goal_tolerance: 0.10 # [m] xy_goal_tolerance: 0.10 # [m] sai số vị trí chấp nhận là đã tới goal
yaw_goal_tolerance: 0.10 # [rad] yaw_goal_tolerance: 0.10 # [rad] sai số góc chấp nhận là đã tới goal
max_global_plan_lookahead_dist: 3.0 # [m] max_global_plan_lookahead_dist: 3.0 # [m] chỉ lấy phần path toàn cục trong tầm này để bám
# ================= Obstacles (from local costmap) ================= # ================= Vật cản (lấy từ local costmap) =================
num_obs: 40 # obstacles in the CEM cost num_obs: 40 # số vật cản đưa vào hàm chi phí CEM
num_obs_proj: 30 # closest obstacles inside the projection num_obs_proj: 30 # số vật cản gần nhất đưa vào phép chiếu
obstacle_range: 2.5 # [m] costmap scan radius around the robot obstacle_range: 2.5 # [m] bán kính quét costmap quanh robot
robot_radius: 0.50 # [m] robot_radius: 0.50 # [m] bán kính robot dùng cho phép kiểm va chạm
obstacle_point_radius: 0.08 # [m] obstacle_point_radius: 0.08 # [m] bán kính quy ước cho mỗi điểm vật cản
footprint_padding: 0.05 # [m] footprint_padding: 0.05 # [m] nới footprint thêm để có biên an toàn
obstacle_cost_threshold: 150 obstacle_cost_threshold: 150 # ô costmap có cost >= ngưỡng này mới coi là vật cản
obstacle_cell_step: 2 obstacle_cell_step: 2 # bước nhảy khi quét ô costmap. Lớn = nhanh hơn, bỏ sót nhiều hơn
max_obstacle_points: 150 max_obstacle_points: 150 # trần số điểm vật cản, chặn chi phí tính toán khi môi trường dày
# ================= Cost weights ================= # ================= Trọng số hàm chi phí =================
weight_smoothness: 0.1 # Chỉnh các trọng số này là chỉnh "tính cách" của planner. Tăng một cái tức là
weight_track: 0.2 # giảm tương đối tất cả những cái còn lại.
weight_obs: 1.2 weight_smoothness: 0.1 # phạt quỹ đạo gãy khúc
weight_clearance: 3.0 # bounded proximity term in (0,1]: 1 at an obstacle weight_track: 0.2 # phạt lệch khỏi path toàn cục
# centre, 0.5 on the collision boundary, 0 out of range weight_obs: 1.2 # phạt tiến gần vật cản
weight_angular: 0.5 # hinge penalty on |omega| > max_angular_velocity weight_clearance: 3.0 # phần thưởng giữ khoảng hở, giá trị trong (0,1]: bằng 1 ngay tại
cem_lamda: 0.9 # CEM temperature # tâm vật cản, 0.5 tại biên va chạm, 0 khi ngoài tầm
cem_alpha: 0.7 # CEM mean/cov blending factor weight_angular: 0.5 # phạt kiểu bản lề khi |omega| vượt max_angular_velocity
cem_lamda: 0.9 # nhiệt độ CEM. Thấp = chỉ tin nhóm tinh hoa, hội tụ nhanh nhưng dễ kẹt
cem_alpha: 0.7 # hệ số pha trộn mean/cov giữa hai vòng CEM. Cao = đổi chậm, ổn định hơn