6.28 Gazebo basis robot simulator

gazebo based learning

Foreword

  • Before the simulation algorithms have developed algorithms can be used in real machine
  • Learn the basic use of the robot physical simulator, including the creation of a scene, ROS production control interface

table of Contents

TOC

reference

gazebo_ros_pkgs
ROS Intergration with gazebo
gazebo tutorials
SDF File Specification
plugins 101
ROS exploration summary (24) - the use of plug-in gazebo

Learning Record

basis

Installation gazebo7 (ubuntu 14.04)

  • Note: ros-indigo-desktop-full with gazebo2 codependent libsdformat1, installation gazebo7 need to uninstall gazebo2, will unload ros-indigo-desktop-full, but also to continue with the installation ros-indigo-desktop after the note to ensure that other packages will not be autoremove out
  • Note: this will not be using sudo apt-get autoremove
sudo apt-get remove gazebo2
sudo apt-get install ros-indigo-desktop
sudo apt-get install gazebo7
sudo apt-get install 
liballegro4.4 liballegro4.4-plugin-alsa libcegui-mk2-0.7.6 libcegui-mk2-dev
  libdevil-dev libdevil1c2 libfltk1.1 libfltk1.1-dev liblcms1 liblcms1-dev
  liblcms2-dev liblodo3.0 liblua5.1-0-dev libmng-dev libois-1.3.0 libpmap3.0
  libreadline-dev libreadline6-dev libsilly robot-player
  ros-indigo-driver-base ros-indigo-stage ros-indigo-stage-ros

Installation ROS communications package

sudo apt-get install ros-indigo-gazebo7-ros-pkgs ros-indigo-gazebo7-ros-control

ros-kinetic comes gazebo7 not normally open

  • Since the gazebo should not be automatically downloaded to the success of some models
  • Copy the downloaded model to ~ / .gazebo / models in can
  • Troubleshooting Tips -gazebo --verbose

cs architecture

  • gazebo actually running two executables, one gzserver, one is gzclient. gzserver operation of the sensor data generator and physics engine updates, it is possible from the graphical interface independent operation, one example is gzserver running on the cloud computer; gzclient running a QT-based user interface, as a simulation of visual and some simulation parameters set.
  • When each running gzserver and gzclient, you can run multiple instances gzclient.

World Files File Environment

  • Simulation environment description file contains all the elements, including robots, light, and still other sensors. This has the SDF file format to * .world extension
  • sdf file is an xml file format used to describe a robot simulator objects and environments, after years of development SDF has become a stable, robust format, and has been described in various forms of robots, static or moving objects, light barriers, even physical attributes.

Model Files Model files

  • Model file and the environment file has the same file syntax SDF, but only contain a Yes, the purpose of this document is to reuse the model file, you can use the following syntax model file
<include>
  <uri>model://model_file_name</uri>
</include>

Environment Variables

GAZEBO_MODEL_PATH
GAZEBO_RESOURCE_PATH    # 其他搜索资源,如环境和媒体文件的路径 # gzserver,gazebo目标文件位置相对路径的起点
GAZEBO_MASTER_URI
GAZEBO_PLUGIN_PATH    # 放置插件的路径
GSZEBO_MODEL_DATABASE_URI    # 在线下载模型的网络地址
  • The default is stored in setup.bash
source <install_path>/share/gazebo/setup.sh
  • Open the sample plug-in method
gzserver -s <plugin_filename> <world_file>
gzclient -g <plugin_filename>

Model building

Construction of a single model

Create a basic model sdf

Add the mechanical properties: Inertia

Add movement joints

Add Sensor

Adding Appearance

  • Use freecad, blender, using intermediate format dae
  • Also possible to use solidworks

Model topology

  • .config file a statement sdf file, sdf file contains .world content and content robot parts sdf, sdf file contains dae, model and mechanical properties of the content

Use meshes

  • That is, sdf file Defined with And so on

Model textures and patterns

  • slightly

Definition and sensor noise

Display sensor data

Add Noise

  • Add in the sdf file And other parameters

Write plug-ins to use this sensor

  • It is a cpp file
  • Add CMake support, generate a plug-in name and a .so library file
  • Add some of the world declared in the document, and plug-in bindings

Load the source file and plug-in model

  • Edit the source file, add the sensors, i.e., to create the interface API send messages and receive channels
  • test

Connected with the ROS

  • Add ROS transport layer, edit the source file
  • Modify CMakeLists.txt, compiled
  • finished

Guess you like

Origin www.cnblogs.com/lizhensheng/p/11117519.html