Gazebo是一款3D仿真器,支持机器人开发所需的机器人、传感器和环境模型,并且通过搭载的物理引擎可以得到逼真的仿真结果。Gazebo是近年来最受欢迎的三维仿真器之一,并被选为美国DARPA机器人挑战赛7的官方仿真器。
1、启动Gazebo
gazebo
2、启动虚拟机器人空世界仿真
cd ~/catkin_ws
export SVGA_VGPU10=0
source ./devel/setup.bash
export TURTLEBOT3_MODEL=burger
roslaunch turtlebot3_gazebo turtlebot3_empty_world.launch
注意: export SVGA_VGPU10=0
3、启动虚拟机器人有环境的仿真
(1)
cd ~/catkin_ws
export SVGA_VGPU10=0
source ./devel/setup.bash
export TURTLEBOT3_MODEL=burger
roslaunch turtlebot3_gazebo turtlebot3_world.launch
(2) 键盘控制
cd ~/catkin_ws
export SVGA_VGPU10=0
source ./devel/setup.bash
export TURTLEBOT3_MODEL=burger
roslaunch turtlebot3_teleop turtlebot3_teleop_key.launch
(3)仿真控制
在Gazebo中自动避障行驶的TurtleBot3
cd ~/catkin_ws
export SVGA_VGPU10=0
source ./devel/setup.bash
export TURTLEBOT3_MODEL=burger
roslaunch turtlebot3_gazebo turtlebot3_simulation.launch
(4)调用rviz
cd ~/catkin_ws
export SVGA_VGPU10=0
source ./devel/setup.bash
export TURTLEBOT3_MODEL=burger
roslaunch turtlebot3_gazebo turtlebot3_gazebo_rviz.launch
注意:可以通过修改size来变化激光扫描边缘的粗细