
如果没有建好的地图,建图指令:
bash
#【1】下载源代码
cd ~/catkin_ws/src
git clone https://github.com/6-robot/wpr_simulation.git
#若github超时,试试从gitee下载:
git clone https://gitee.com/s-robot/wpr_simulation.git
cd wpr_simulation/scripts/
./install_for_noetic.sh
cd ~/catkin_ws/
catkin_make
cd ~/catkin_ws/src
git clone https://github.com/6-robot/wpb_home.git
#若github超时,试试从gitee下载:
git clone https://gitee.com/s-robot/wpb_home.git
cd wpb_home/wpb_home_bringup/scripts/
./install_for_noetic.sh
cd ~/catkin_ws/
catkin_make
bash
#【2】建图指令
roslaunch wpr_simulation wpb_gmapping.launch
rosrun wpr_simulation keyboard_vel_ctrl
rosrun map_server map_saver -f map
建图完成后需要将.png和.yaml地图文件放入wpr_simulation/maps 中。
bash
#【3】创建软件包
catkin_create_pkg nav_pkg roscpp rospy move_base_msgs actionlib
#【4】参考代码
wpr_simulation/launch/wpb_demo_nav.launch
bash
#【5】导航运行
roslaunch wpr_simulation wpb_stage_robocup.launch
roslaunch wpr_simulation wpb_demo_nav.launch
