Navigation
方块代表节点,椭圆是节点中的组件
输入:
map_server 加载地图会提供
sensor sources 传感器节点 由(仿真)机器人提供
odometry source 里程计节点 由(仿真)机器人提供
sensor transforms 传感器的tf节点 由(仿真)机器人提供
amcl 定位节点 由自己运行
下载工程源代码
//下载仿真源码
git clone https://github.com/6-robot/wpr_simulation.git
//下载工程源码
git clone https://github.com/6-robot/wpb_home.git
cd wpb_home/wpb_home_bringup/scripts/
./install_for_noetic.sh
cd ~/catkin_ws/
catkin_make
将上一个学习笔记的map.pgm和map.yaml文件放入/home/xtark/catkin_ws/src/wpr_simulation-master/maps
cd ~/catkin_make/src/
catkin_create_pkg nav_pkg roscpp rospy move_base_msgs actionlib
cd ~/catkin_make/src/nav_pkg
mkdir launch
cd launch
gedit nav.launch
nav.launch
<launch>
<!--- Run move_base -->
<node pkg="move_base" type="move_base" name="move_base">
<rosparam file="$(find wpb_home_tutorials)/nav_lidar/costmap_common_params.yaml" command="load" ns="global_costmap" />
<rosparam file="$(find wpb_home_tutorials)/nav_lidar/costmap_common_params.yaml" command="load" ns="local_costmap" />
<rosparam file="$(find wpb_home_tutorials)/nav_lidar/global_costmap_params.yaml" command="load" />
<rosparam file="$(find wpb_home_tutorials)/nav_lidar/local_costmap_params.yaml" command="load" />
<param name="base_global_planner" value="global_planner/GlobalPlanner" />
<param name="base_local_planner" value="wpbh_local_planner/WpbhLocalPlanner" />
</node>
<!-- Run map server -->
<node pkg="map_server" type="map_server" name="map_server" args="$(find wpr_simulation)/maps/map.yaml"/>
<!--- Run AMCL -->
<node pkg="amcl" type="amcl" name="amcl"/>
<!--- Run rviz -->
<node name="rviz" pkg="rviz" type="rviz" args="-d $(find slam_pkg)/rviz/slam.rviz"/>
</launch>
cd ~/catkin_make
catkin_make
roslaunch wpr_simulation wpb_stage_robocup.launch
roslaunch nav_pkg nav.launch