first commit

This commit is contained in:
2026-07-29 15:45:16 +07:00
commit 4762a3032c
56 changed files with 15310 additions and 0 deletions

View File

@@ -0,0 +1,171 @@
# Config CHỈ dùng cho test của gói. Bản runtime nằm ở `pnkx_nav_core/config/` (C2).
#
# Chạy test kèm: PNKX_NAV_CORE_CONFIG_DIR=src/AMR_T800/Test/move_base2/test/config
# --- Tham số runtime, dùng cho config_validation_test ----------------------------------------
move_base2:
controller_frequency: 20.0 # [Hz]
planner_frequency: 0.0 # [Hz] 0 = chỉ lập plan khi cần
planner_timeout: 5.0 # [s]
planner_patience: 5.0 # [s]
controller_patience: 15.0 # [s]
oscillation_timeout: 0.0 # [s] 0 = tắt
oscillation_distance: 0.5 # [m]
action_patience: 0.0 # [s] 0 = tắt; lưới cuối, không phải cơ chế timeout chính
max_planning_retries: -1 # < 0 = không giới hạn
recovery_behavior_enabled: true
max_vel_x: 0.5 # [m/s] tiến
min_vel_x: -0.2 # [m/s] lùi, ÂM
max_vel_theta: 1.0 # [rad/s]
acc_lim_x: 1.0 # [m/s^2]
acc_lim_theta: 2.0 # [rad/s^2]
global_frame: map
robot_base_frame: base_link
sensors:
laser_sor_enabled: true # lọc outlier laser TRƯỚC khi vào costmap
laser_sor_mean_k: 8 # [điểm] số láng giềng gần nhất dùng để ước lượng
laser_sor_stddev_mul: 1.5 # [-] ngưỡng = mean + hệ_số * stddev
recovery_namespace: recovery
action_namespace: actions
mission_namespace: mission_adapters
position:
base_global_planner: TestGlobalPlanner
base_local_planner: TestLocalPlanner
xy_goal_tolerance: 0.15 # [m]
yaw_goal_tolerance: 0.10 # [rad]
docking:
base_global_planner: TestDockPlanner
base_local_planner: TestLocalPlanner
xy_goal_tolerance: 0.02 # [m] ghép nối cần chính xác hơn nhiều
yaw_goal_tolerance: 0.02 # [rad]
# --- Cấu hình sai, dùng cho test đường lỗi -----------------------------------------------------
move_base2_bad_frequency:
controller_frequency: 0.0 # phải bị từ chối
move_base2_bad_frames:
controller_frequency: 20.0
global_frame: base_link # trùng robot_base_frame -> pose robot luôn là gốc toạ độ
robot_base_frame: base_link
position:
base_local_planner: TestLocalPlanner
move_base2_no_planner:
controller_frequency: 20.0 # không profile nào có base_local_planner
move_base2_bad_sensors:
controller_frequency: 20.0
position:
base_local_planner: TestLocalPlanner
sensors:
laser_sor_enabled: true
laser_sor_mean_k: 1 # < 2 -> vô nghĩa, phải bị từ chối
# --- Recovery behavior cho recovery_runner_test ------------------------------------------------
#
# Chỉ khai behavior họ kNone: họ velocity cần Costmap2DROBOT thật (TF + chuỗi layer) nên được kiểm
# ở tầng tích hợp, không kiểm bằng fake ở đây.
recovery:
behaviors:
- {name: wait_short, type: WaitRecovery}
- {name: wait_long, type: WaitRecovery}
wait_short:
wait_duration: 1.0 # [s]
wait_long:
wait_duration: 5.0 # [s]
timeout: 3.0 # [s] cố ý NGẮN HƠN wait_duration -> lượt này luôn kết thúc bằng timeout
recovery_empty:
behaviors: []
recovery_missing_library:
behaviors:
- {name: ghost, type: GhostRecovery}
WaitRecovery:
library_path: librecovery_core_wait_recovery
# GhostRecovery cố ý KHÔNG khai library_path.
# --- Action handler cho action_runner_test -----------------------------------------------------
actions:
handlers:
- {name: noop, type: NoopActionHandler}
noop:
action_types: [wait, pick, drop]
duration: 2.0 # [s]
timeout: 10.0 # [s] tầng 1 — trách nhiệm của chính handler
actions_slow:
handlers:
- {name: noop, type: NoopActionHandler}
noop:
action_types: [wait]
hang: true # mô phỏng thiết bị không bao giờ trả lời
timeout: 3.0 # [s] handler tự cắt, không chờ state machine
actions_hang_forever:
handlers:
- {name: noop, type: NoopActionHandler}
noop:
action_types: [wait]
hang: true
timeout: 0.0 # tắt timeout + treo = chạy vĩnh viễn -> phải bị chặn lúc configure
actions_bad:
handlers:
- {name: noop, type: NoopActionHandler}
noop:
action_types: [wait]
duration: 10.0 # [s]
timeout: 5.0 # [s] <= duration -> action LUÔN hỏng; phải bị chặn lúc configure
actions_empty:
handlers: []
actions_missing_library:
handlers:
- {name: ghost, type: GhostActionHandler}
NoopActionHandler:
library_path: libmove_base2_noop_action_handler
# --- Global planner giả cho planner_runner_test -------------------------------------------------
#
# Bốn alias cùng nằm trong một thư viện; mỗi alias là một hành vi mà PlannerRunner phải xử lý đúng.
TestPlannerOk:
library_path: libmove_base2_test_global_planner
TestPlannerEmptyPlan:
library_path: libmove_base2_test_global_planner
TestPlannerThrowing:
library_path: libmove_base2_test_global_planner
TestPlannerInitFails:
library_path: libmove_base2_test_global_planner
# TestPlannerMissingLibrary cố ý KHÔNG khai library_path.
# GhostActionHandler cố ý KHÔNG khai library_path.
# --- Local planner giả cho controller_runner_test ------------------------------------------------
TestControllerOk:
library_path: libmove_base2_test_local_planner
TestControllerSecondary:
library_path: libmove_base2_test_local_planner
TestControllerNoCommand:
library_path: libmove_base2_test_local_planner
TestControllerNaN:
library_path: libmove_base2_test_local_planner
TestControllerThrowing:
library_path: libmove_base2_test_local_planner
TestControllerRefusesLimits:
library_path: libmove_base2_test_local_planner
# TestControllerMissing cố ý KHÔNG khai library_path.