Bench and Gazebo settings only; the robot trees are untouched. Planners: the position profile moves to PriestLocalPlanner, and the three docking profiles all point at HybridDockingLocalPlanner instead of the Stanley instances. Loop drops to 20 Hz, command_semantics back to twist for the sim drive, max_vel_x to 1.20, recovery behaviours and the path monitor off while the docking chain is under test. PRIEST runs cem 3 with performance_metrics off and debug_level 0, which is the configuration the CPU measurements were taken at. Metrics have to stay off for any further benchmark. The SBPL primitive path pointed into rl_ws, a workspace that is not on this machine; it now points at the copy in sbpl_lattice_planner. sensor_store's report_period goes to 0 to stop the periodic dump. The sim launch defaults robot_type to T800 and re-enables depth_image_proc. The VDA5050 charger flow replaces the pallet fixture: DetectCharger and the charger marker, with the trailing back-off commented out. The rotate compound action is renamed to lowercase to match what the config reader looks up.
Chạy move_base2 trên sim
Bộ launch này thay cho chuỗi lệnh của move_base cũ. Không sửa gì ở đường chạy cũ — hai runtime
chạy song song được, chọn bằng lệnh roslaunch nào được gọi.
Đường chạy cũ (giữ nguyên, để đối chiếu)
roslaunch amr_startup robot_maze_world.launch
roslaunch amr_startup rviz.launch
roslaunch robot_depth_image_proc depth_image_proc_gazebo.launch
export PNKX_NAV_CORE_CONFIG_DIR=/home/duongtd/T800_ws/src/AMR_T800/pnkx_nav_core/config
roslaunch amr_startup amr_control.launch
Đường chạy move_base2
cd /home/duongtd/T800_ws && source devel/setup.bash
roslaunch move_base2 move_base2_sim.launch
Một lệnh, không cần export gì. Muốn tách terminal như cũ thì chạy từng phần:
# Terminal 1 — Gazebo + model T800 + world (dùng lại launch cũ, không đổi)
roslaunch amr_startup robot_maze_world.launch
# Terminal 2 — rviz (dùng lại config cũ)
rviz -d $(rospack find amr_startup)/rviz/navigation.rviz
# Terminal 3 — depth image -> point cloud (dùng lại launch cũ)
roslaunch robot_depth_image_proc depth_image_proc_gazebo.launch
# Terminal 4 — nav stack trên move_base2. KHÔNG export gì: launch tự đặt config dir.
roslaunch move_base2 move_base2_control.launch
Tham số
| Arg | Mặc định | Ghi chú |
|---|---|---|
world |
maze |
maze | warehouse | sehc | empty |
robot_type |
T800 |
quyết định footprint; T800 = [[0.583,±0.48],[-0.583,±0.48]] |
gui |
true |
false = gzserver headless, chạy được qua ssh |
rviz |
true |
|
depth_proc |
true |
tắt khi không cần đường depth camera |
roslaunch move_base2 move_base2_sim.launch world:=warehouse gui:=false
Đổi qua lại giữa hai runtime bằng cách nào
amr_control nạp plugin navigation bằng cách tra symbol MoveBase — tên này hard-code trong
host (amr_control.cpp:244-246), không đọc từ config. Thư viện nào được nạp thì do khoá
MoveBase: library_path trong move_base_common_params.yaml quyết định, và file đó được tìm qua
PNKX_NAV_CORE_CONFIG_DIR.
Vì vậy chuyển đổi = trỏ PNKX_NAV_CORE_CONFIG_DIR sang cây khác:
| Runtime | PNKX_NAV_CORE_CONFIG_DIR |
MoveBase: library_path |
|---|---|---|
| cũ | pnkx_nav_core/config |
libmove_base |
| mới | move_base2/config/runtime |
libmove_base2 |
move_base2/config/runtime/ là cây config tự đủ: mọi file đều là file thật, không còn symlink.
Trước đây thư mục này symlink sang pnkx_nav_core/config/, nhưng symlink trỏ ra ngoài repo nên
clone move_base2 lẻ ra là link chết — và robot::NodeHandle bỏ qua link chết trong im lặng
(entry.is_regular_file() trả false, không log), robot chạy bằng default hard-code mà không ai
biết. Đổi lấy tính tự đủ khi clone.
Bốn file thuộc riêng move_base2, không có bản tương ứng bên pnkx_nav_core:
move_base_common_params.yaml (chứa MoveBase: library_path: libmove_base2),
action_handlers_params.yaml, compound_actions_params.yaml, maker_sources.yaml.
Số còn lại là bản sao của pnkx_nav_core/config/. Hệ quả phải nhớ, đúng thứ CLAUDE.md cảnh
báo ("sửa mãi không có tác dụng vì sửa nhầm bản cũ"): hai bản KHÔNG còn tự đồng bộ. Sửa tham số
planner/costmap cho move_base2 thì sửa ở đây; sửa cho move_base cũ / c_api / standalone thì sửa
bên pnkx_nav_core/config. Kiểm lệch:
diff -rq Test/move_base2/config/runtime pnkx_nav_core/config \
-x action_handlers_params.yaml -x compound_actions_params.yaml \
-x maker_sources.yaml -x move_base_common_params.yaml
libmove_base2.so export cả hai alias MoveBase và MoveBase2, nên host không phải sửa dòng
nào.
Xem gì khi chạy
Log khởi động của amr_node phải có, theo thứ tự:
[move_base2] dùng schema mới ... | ... đọc theo schema gen-1 của move_base_common_params.yaml
[move_base2] PlannerRunner: global planner đang dùng là '...'
[move_base2] ControllerRunner: local planner đang dùng là '...'
[move_base2] NavigationRuntime dựng xong: <toàn bộ config>
Trên rviz: /global_costmap/costmap/plan và /local_costmap/costmap/footprint có dữ liệu.
Chưa có: lưới costmap trên rviz. getGlobalData/getLocalData của move_base2 hiện điền plan
và footprint nhưng chưa chuyển costmap sang OccupancyGrid — xem @warning ở
NavigationServer::fillPlannerData. Path và footprint hiện được, costmap thì không.
Nếu treo ở lúc khởi động
amr_control.cpp:252-258 chờ vô hạn getFeedback()->is_ready sau khi gọi initialize():
do { r.sleep(); ros::spinOnce(); } while (ros::ok() && !move_base_ptr_->getFeedback()->is_ready);
NavigationRuntime::build() hỏng thì is_ready giữ nguyên false và vòng lặp này quay mãi. Triệu
chứng là amr_node im lặng không tiến thêm. Đọc log ngay phía trên nó — initialize() luôn in lý
do thất bại trước khi trả về:
[move_base2] initialize() thất bại: <lý do>
Nguyên nhân hay gặp: sai PNKX_NAV_CORE_CONFIG_DIR, thiếu library_path cho planner trong YAML,
hoặc .so của planner không có trong devel/lib.