安装ros,这点参考我前一篇博客。https://blog.youkuaiyun.com/weixin_42652125/article/details/84284231
安装后,先建立一个catkin_ws的工作环境,然后记住命令每次执行前都要重复两部
source devel/setup.bash
export TURTLEBOT3_MODEL=burger
或
export TURTLEBOT3_MODEL=waffle
然后运行,以下命令:
roslaunch turtlebot3_gazebo turtlebot3_empty_world.launch #空的世界
roslaunch turtlebot3_gazebo turtlebot3_world.launch #很多柱子的世界
roslaunch turtlebot3_gazebo turtlebot3_house.launch #house世界
随后看到图上有车,
roslaunch turtlebot3_teleop turtlebot3_teleop_key.launch #用键盘控制车行动
roslaunch turtlebot3_gazebo turtlebot3_simulation.launch #雷达自动避障驾驶
roslaunch turtlebot3_gazebo turtlebot3_gazebo_rviz.launch #雷达检测图
补充一下,没有下载该图模型的,用该方式下载:
1.首先我们需要有一个工作空间,如果没有的话参考我之前的学习笔记,然后我们进入到工作空间的src目录下面:
cd ~/catkin_ws/src/
2.下载turtlebot3的源文件:
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
3.回到工作空间主目录下面对其make一下:
cd ~/catkin_ws
rosdep install --from-paths src -i -y
catkin_make
source ./devel/setup.bash