ROS——A brief introduction to gazebo simulation

Overview

Simulation/simulation generally refers to the establishment of a model of the original system, transaction or process based on the purpose of experiment or training to characterize its key characteristics (Key Characteristics) or behavior/function, and systematize and formulate it in order to Key features are simulated. This article mainly provides a simple understanding of gazebo physical environment simulation.

1. Gazebo simulation features

Gazebo is a powerful 三维物理仿真平台;

  • Has a powerful physics engine;
  • High-quality graphics rendering;
  • Convenient programming and graphical interface;
  • Open source and free

The robot model in azebo is the same as the model used by rviz, but the physical properties of the robot and the surrounding environment, such as mass, friction coefficient, and elasticity coefficient, need to be added to the model. The sensor information of the robot can also be added to the simulation environment in the form of a plug-in, and displayed in a visual manner.

Its typical application scenarios include:

  • Testing the robot algorithm;
  • Robot design
  • Back-testing in real-world scenarios

Gazebo is an excellent open source physics simulation environment, which has the following characteristics:
Dynamic simulation : supports a variety of high-performance physics engines, such as ODE, Bullet, SimBody, DART, etc.
Three-dimensional visualization environment : supports displaying realistic three-dimensional environment, including light, texture, and shadow.
Sensor simulation : Supports the simulation of sensor data, and can simulate sensor noise at the same time.
**Extensible plug-ins: **Users can customize the development of plug-ins, expand the functions of gazebo, and meet individual needs.
Multiple robot models : Officially provide robot models such as PR2, Pioneer2 DX, TurtleBot, etc. Of course, you can also use your own robot models.
TCP/IP transmission : Gazebo can realize remote simulation, background simulation and foreground display communicate through the network.
Cloud simulation : Gazebo simulation can be run on Amazon, Softlayer and other clouds, or on a cloud server built by yourself.
Terminal tools : Users can use the command line tools provided by gazebo to realize simulation control in the terminal.

Gazebo's community maintenance is very active. Since 2013, there have been major version changes almost every year. As shown in the figure below, you can see the gazebo version iteration and the gazebo version corresponding to the recent ROS versions.
Insert picture description here

gazebo的版本变化虽然较大,但是兼容性保持的比较好,indigo中2.2版本的机器人仿真模型,在Kinetic的7.0版本中运行依然不会有问题。

Two, install & run gazebo

Like rviz, if you have already installed the full version of ROS on the desktop, you can skip this step directly, otherwise, please use the following command to install:

sudo apt-get install ros-kinetic-gazebo-ros-pkgs ros-kinetic-gazebo-ros-control

After the installation is complete, use the following commands in the terminal to start ROS and gazebo:

roscore
rosrun gazebo_ros gazebo

Insert picture description here
Insert picture description here
If an error is reported as shown in the figure, enter the following command

export SVGA_VGPU10=0

Insert picture description here
It will be fine afterwards.
The interface of gazebo after successful startup is as shown in the figure below: The
Insert picture description here
main interface mainly contains the following parts:

3D view area
Toolbar
Model list
Model attribute items
Time display area

Three, verify the successful connection

To verify whether gazebo is successfully connected to the ROS system, you can view the ROS topic list. If the connection is successful, you should see the following topic list published/subscribed by gazebo:

rostopic list

Insert picture description here
List of services provided by gazebo

rosservice list

Insert picture description here

Fourth, build a simulation environment

Before simulation, a simulation environment needs to be constructed. There are two ways to create a simulation environment in gazebo

1. Insert the model directly

In the model list on the left of gazebo, there is an insert option, which lists all available models. Select the model you want to use and place it in the main display area, then you can add simulation examples such as robots and external objects in the simulation environment:
Insert picture description here

To load the model, you need to connect to a foreign website. In order to ensure the smooth loading of the model, you can download the model file in advance and place it under the local path ~/.gazebo/models. The download address of the model file:
https://bitbucket.org/osrf/gazebo_models /downloads/ .

2、Building Editor

The second method is to use the Building Editor tool provided by gazebo to draw the map manually.
Select in the gazebo menu bar Edit --> Building Editorto open the Building Editor interface. Select the one on the left 绘制选项, and then use the mouse to draw in the upper window, and the drawn simulation environment can be displayed in the lower window in real time.
Insert picture description here

After the model is built, the robot model can be loaded and simulated.

Five, summary and reference materials

1. Summary

This article is mainly a brief introduction to gazebo, as well as a simple physical environment.

2. Reference materials

ROS technology bit-Gazebo physical simulation platform .
VMware: vmw_ioctl_command error invalid parameter .

Guess you like

Origin blog.csdn.net/QWERTYzxw/article/details/115019603