先建一个新的工作空间
mkdir -p turtlebot_ws/src
然后进入到src文件内下载turtlebot的功能包
cd turtlebot_ws/src
git clone https://github.com/ROBOTIS-GIT/turtlebot3_msgs.git
git clone https://github.com/ROBOTIS-GIT/turtlebot3.git
git clone https://github.com/ROBOTIS-GIT/turtlebot3_simulations.git
下载完后给工作空间安装相关依赖项,并编译
cd ../
rosdep install --from-paths src -i -y
catkin_make
编译完成后,我们还需要将工作空间添加到环境变量,这里直接将其设为永久的环境变量并更新
echo "source ~/turtlebot_ws/devel/setup.bash" >> ~/.bashrc
source ~/.bashrc
然后开始进行模拟,先运行选择一个gazebo环境下的机器人,
export TURTLEBOT3_MODEL=burger # burger型机器人
export TURTLEBOT3_MODEL=waffle # waffle型机器人
再运行gazebo
roslaunch turtlebot3_gazebo turtlebot3_world.launch