写在前面
本文默认已经装好ROS-melodic。因为ROBOTIS上的教程还是kinetic(ubuntu 16)的,所以,搬运过来并修改成melodic版本, 也算是记录了我的安装过程。
1. 安装依赖
在终端中执行
sudo apt-get install ros-melodic-joy ros-melodic-teleop-twist-joy\
ros-melodic-teleop-twist-keyboard ros-melodic-laser-proc\
ros-melodic-rgbd-launch ros-melodic-depthimage-to-laserscan\
ros-melodic-rosserial-arduino ros-melodic-rosserial-python\
ros-melodic-rosserial-server ros-melodic-rosserial-client\
ros-melodic-rosserial-msgs ros-melodic-amcl\
ros-melodic-map-server ros-melodic-move-base\
ros-melodic-urdf ros-melodic-xacro\
ros-melodic-compressed-image-transport\
ros-melodic-rqt-image-view ros-melodic-gmapping\
ros-melodic-navigation ros-melodic-interactive-markers
2. 从github安装Turtlebot3核心包
cd ~/catkin_ws/src/
git clone https://github.com/ROBOTIS-GIT/turtlebot3_msgs.git
git clone -b melodic-devel https://github.com/ROBOTIS-GIT/turtlebot3.git
git clone -b melodic-devel https://github.com/ROBOTIS-GIT/turtlebot3_simulations.git
cd ~/catkin_ws && catkin_make
3. 从github安装Turtlebot3_sim仿真环境
cd ~/catkin_ws/src/
git clone -b melodic-devel https://github.com/ROBOTIS-GIT/turtlebot3_simulations.git
cd ~/catkin_ws && catkin_make
4. 指定Turtlebot3型号
Turtlebot3目前有三种型号,仿真时需要环境变量中存在TURTLEBOT3_MODEL=${MODEL}
,其中${MODEL}
可以是burger
, waffle
, waffle_pi
。将其加入~/.bashrc
文件中方便日后使用。
以burger
为例:
echo "export TURTLEBOT3_MODEL=burger" >> ~/.bashrc
5. Hello World
1) 空空如也的世界:
roslaunch turtlebot3_gazebo turtlebot3_empty_world.launch
空空如也的世界
1) TurtleBot3自带的世界:
roslaunch turtlebot3_gazebo turtlebot3_world.launch
TurtleBot3自带的世界