Download and Install
Full Software Listings
In this tutorial we will assemble a simple robotic system and connect it to the 3D Player/Gazebo simulator. The system diagram is the same as in the this tutorial A bigger system with Player/Stage simulator (with Stage replaced by Gazebo). It is recommended to do the Stage tutorial first because the simulator setup is simpler. Here we assume that you've done that and so all the prerequisites are already met.
Player/Gazebo must be installed before we begin. Debian installation instructions are found here orca_doc_installdebian_gazebo. It's also useful to understand how Player/Stage/Gazebo works.
Start IceGrid Registry and IceStorm server as described in the Quick-Start Guide
We'll be using sample configuration files which are distributed with Orca and Gazebo. As a general rule, you shouldn't work or run programs from the distribution. So we'll create a separate directory and copy config and world files into it. After going through the quickstart guide, you would have created a
$ mkdir -p ~/sys/tutegazebo; cd ~/sys/tutegazebo $ cp [GAZEBO_SRC]/worlds ./
One of the most important things that you should make sure of is that Gazebo runs by itself. Please see Gazebo installation instructions, Gazebo user guide, and the Gazebo mailing lists before anything else. Note that some of the instructions on the Gazebo website are out of date. These issues are hopefully addressed as we come across them below.
After Gazebo has been installed, run it from the
$ gazebo ./worlds/example.world
for the non-graphical version or
$ wxgazebo ./worlds/example.world
for the graphical version.
You may find that some graphics cards report the following error when running Gazebo:
rendering: [GLX offscreen] direct [no] RGBA [5 6 5 0] depth  X Error of failed request: GLXUnsupportedPrivateRequest Major opcode of failed request: 144 (GLX) Minor opcode of failed request: 16 (X_GLXVendorPrivate) Serial number of failed request: 35 Current serial number in output stream: 36
For more information about OpenGL rendering methods see the Gazebo documentation. It is suggested to try all rendering methods to see which gives the best results because it is highly dependent on the video card, video card driver and xserver.
Select the most appropriate rendering method by changing the renderMethod tag in
You also need to add this to the Sony camera's configuration:
<model:SonyVID30> ... <renderMethod>glx</renderMethod> </model:SonyVID30>
Once Gazebo is running, you will need to stop it and change the
<model:SickLMS200> ... <rangeCount>361</rangeCount> <rayCount>361</rayCount> ... </model:SickLMS200>
You can see the laser rays by clicking on the Controls (lefthand corner) of the guicam window and clicking the check box "Display Rays". You can also control the vehicle by clicking the check box "Pioneer2DX : position: robot1" and using the slide bars in the new window.
We will now use Player as an intermediary between Orca and Gazebo (this similar to how Orca works with Stage).
Copy the following lines into a new file called
driver ( name "gazebo" provides ["simulation:0"] plugin "libgazeboplugin" server_id "default" ) driver ( name "gazebo" provides ["position2d:0"] gz_id "robot1" ) driver ( name "gazebo" provides ["power:0"] gz_id "robot1" ) driver ( name "gazebo" provides ["laser:0"] gz_id "laser1" )
Start up Player using the
$ player example.cfg
We'll now make Orca talk to Gazebo through Player. Firstly, copy a few standard component configuration files distributed with Orca.
$ cd ~/sys/tutegazebo $ cp [ORCA_INSTALL]/cfg/laser2d.cfg ./ $ cp [ORCA_INSTALL]/cfg/robot2d.cfg ./ $ cp [ORCA_INSTALL]/cfg/faithlocaliser.cfg ./ $ cp [ORCA_INSTALL]/cfg/teleop.cfg ./ $ cp [ORCA_INSTALL]/cfg/orcaview2d.cfg ./
From here on, each component will need a separate terminal.
Tell the component to use the gazebo driver by modifying the
... Laser2d.Config.DriverLib=libHydroLaserScanner2dPlayerClient.so Laser2d.Config.PlayerClient.Driver=gazebo ...
Note that if you want to change the configuration of the laser or other hardware components, see the Gazebo models page.
Now run the Laser2d component.
We're now going to set up the low level control to the actuators for the simulated robot using the Robot2d component. No modifications to the
To display the robot in the GUI we need a localisation component. Here we'll use the simplest one possible:
To view the world and the robot we use
... OrcaView2d.Config.Element2.Detail=localise2d@local/faithlocaliser ...
Start the GUI component
You should now see the the robot and laser scan. If it is partially off the screen, drag it with the left mouse button so that you can view the full scan.
To tell the robot to move we can use the
As the robot moves through the world, compare the display of the OrcaView and the Gazebo world window: they should be showing similar reports.
If everything works, check out more Orca Tutorials.
Webmaster: Tobias Kaupp (tobasco at users.sourceforge.net)