1.安装Gazebo
sudo apt-get install ros-noetic-gazebo-*
2.安装Turtlebot3功能包:
sudo apt install ros-noetic-turtlebot3
sudo apt install ros-noetic-turtlebot3-simulations
3.启动仿真环境:
export GAZEBO_MODEL_PATH=$GAZEBO_MODEL_PATH:'ros pkg \prefix turtlebot3_gazebo \'/share/turtlebot3_gazebo/models/
注意其中的路径需要自己根据实际情况修改;
命令:
export TURTLEBOT3_MODEL=burger
roslaunch turtlebot3_gazebo turtlebot3_world.launch
如图所示:
4.启动rviz:
export TURTLEBOT3_MODEL=burger
roslaunch turtlebot3_gazebo turtlebot3_gazebo_rviz.launch
5.启用gmapping
roslaunch mbot_navigation gmapping_demo.launch
效果如图:
6.测试:
可以运行键盘控制节点进行建图了。。