This commit is contained in:
2026-07-30 09:24:47 +07:00
parent 4762a3032c
commit d8babff20b
50 changed files with 3280 additions and 119 deletions

View File

@@ -0,0 +1,66 @@
<?xml version="1.0"?>
<!--
Nav stack chạy trên move_base2. Bản độc lập, viết theo mẫu `amr_startup/launch/amr_control.launch`
nhưng KHÔNG include nó — để đổi thứ gì ở đây cũng không đụng vào đường chạy của move_base cũ.
Khác biệt so với bản gốc đúng hai chỗ:
1. `PNKX_NAV_CORE_CONFIG_DIR` trỏ vào cây overlay của move_base2 (xem config/runtime/README).
2. Không cần `export` thủ công nữa — launch tự đặt.
Mọi tham số PHÍA ROS (footprint, costmap, localization, mqtt) vẫn đọc từ `amr_startup/config`,
đúng như bản gốc: đó là cây config của phía ROS, không phải của nav core.
-->
<launch>
<arg name="robot_type" default="T800" doc="T800 | imr | hook_150 | APM" />
<arg name="local_planner" default="pnkx" doc="dwa | dwb | eband | base | teb | pose | pnkx" />
<arg name="global_planner" default="custom" doc="sbpl | two_points | custom" />
<arg name="global_plan_msg_type" default="vda5050_msgs::Order" doc="nav_msgs::Path | vda5050_msgs::Order" />
<arg name="primitive_filename" default="$(find amr_startup)/config/mprim/unicycle_highcost_5cm.mprim" />
<arg name="prefix" default="" doc="Prefix cho tf frame của robot" />
<!--
ĐIỂM KHÁC BIỆT DUY NHẤT của cả đường chạy: nav core đọc config từ đây.
Cây overlay là symlink tới toàn bộ `pnkx_nav_core/config/`, trừ đúng một file thật
`move_base_common_params.yaml` với `MoveBase: library_path: libmove_base2`.
-->
<env name="PNKX_NAV_CORE_CONFIG_DIR" value="$(find move_base2)/config/runtime" />
<param name="rosconsole_config_file" value="$(find amr_startup)/rosconsole.config" />
<rosparam file="$(find amr_startup)/config/mqtt_general.yaml" command="load" />
<node pkg="amr_control" type="amr_control_node" respawn="false" name="amr_node" output="screen" clear_params="true">
<rosparam param="footprint" if="$(eval robot_type == 'imr')">
[[0.412, -0.304], [0.412, 0.304], [-0.412, 0.304], [-0.412, -0.304]]
</rosparam>
<rosparam param="footprint" if="$(eval robot_type == 'hook_150')">
[[0.511,-0.1955],[0.511,0.1955],[-0.511,0.1955],[-0.511,-0.1955]]
</rosparam>
<rosparam param="footprint" if="$(eval robot_type == 'T800')">
[[0.583,-0.48],[0.583,0.48],[-0.583,0.48],[-0.583,-0.48]]
</rosparam>
<rosparam param="footprint" if="$(eval robot_type == 'APM')">
[[1.65,-0.4],[1.65,0.4],[-0.35,0.4],[-0.35,-0.4]]
</rosparam>
<param name="primitive_filename" value="$(arg primitive_filename)" />
<param name="global_plan_msg_type" value="$(arg global_plan_msg_type)" />
<rosparam file="$(find amr_startup)/config/maker_sources.yaml" command="load" />
<rosparam file="$(find amr_startup)/config/move_base_common_params.yaml" command="load" />
<rosparam file="$(find amr_startup)/config/$(arg global_planner)_global_params.yaml" command="load" />
<rosparam file="$(find amr_startup)/config/$(arg local_planner)_local_planner_params.yaml" command="load" />
<rosparam file="$(find amr_startup)/config/costmap_common_params.yaml" command="load" ns="global_costmap" subst_value="true" />
<rosparam file="$(find amr_startup)/config/costmap_global_params.yaml" command="load" />
<rosparam file="$(find amr_startup)/config/costmap_global_params_plugins_no_virtual_walls.yaml" command="load" />
<rosparam file="$(find amr_startup)/config/costmap_common_params.yaml" command="load" ns="local_costmap" subst_value="true" />
<rosparam file="$(find amr_startup)/config/costmap_local_params.yaml" command="load" subst_value="true" />
<rosparam file="$(find amr_startup)/config/costmap_local_params_plugins_no_virtual_walls.yaml" command="load" />
<rosparam file="$(find amr_startup)/config/localization.yaml" command="load" />
<remap from="map" to="/map" />
<remap from="marker" to="move_base_node/markers" />
</node>
</launch>