Home
FAQ
Player
Utilities
Stage
Gazebo
Contrib
Documentation
Publications
Contributors
Users

Project
Download
Bugs/Feedback
Mailing lists

Radish

Old news
Old stuff

Working with Player

The Player device server treats Gazebo in exactly the same way that it treats real robot hardware: as a device that is a source of data and a sink for commands. A key advantage of this approach is that users may mix Player abstract drivers with simulation drivers. Thus, for example, drivers such as VFH (Vector Field Histogram) and AMCL (adapative Monte-Carlo localization), will work equally well with simulated and real robots. In the following sections, we describe some basic scenarios that demonstate this interaction.

Setting up the Simulation

The basic steps for setting up and running a combined Player/Gazebo simulation are as follows.

  • Write the Gazebo world file.
  • Start Gazebo.
  • Write the corresponding Player configuration file(s).
  • Start Player(s).
  • Start client program(s).

Note that Gazebo must be started before the Player server, and that the Player server must re-started whenever Gazebo is re-started.

Example: Using a Single Robot

Consider the case of a single robot with a scanning laser range-finder. The following Gazebo world file snippet will create a Pioneer2DX robot with SICK~LMS200 laser.

  <model:Pioneer2DX>
    <id>robot1_position</id>
    <xyz>0 0 0.40</xyz>
    <rpy>0 0 45</rpy>
    <model:SickLMS200>
      <id>robot1_laser</id>
      <xyz>0.15 0 0.20</xyz>
      <rpy>0 0 0</rpy>
    </model:SickLMS200>
  </model:Pioneer2DX>

The corresponding snippet of the Player 0.5 configuration file should look like this:

  driver
  (
    name "gz_position"
    provides ["position:0"]
    gz_id "robot1_position"
  )

  driver
  (
    name "gz_laser"
    provides ["laser:0"]
    gz_id "robot1_laser"
  )

To run this simulation, start Gazebo with:

  $ gazebo <myworld>

where <myworld> is the name of the Gazebo world file, and start Player with

  $ player -g 0 <myconfig>

where <myconfig> is the name of the Player configuration file. Client programs can connect to the simulated devices devices on the default Player port 6665.

Example: Using a Single Robot with the VFH driver

Abstract devices can be mixed freely with simulated devices in the Player server. Thus, for example, it is possible to use the VFH (Vector Field Histogram) driver with a simulated robot. The following Gazebo world file snippet will create a Pioneer2DX robot with SICK~LMS200 laser.

  <model:Pioneer2DX>
    <id>robot1_position</id>
    <xyz>0 0 0.40</xyz>
    <rpy>0 0 45</rpy>
    <model:SickLMS200>
      <id>robot1_laser</id>
      <xyz>0.15 0 0.20</xyz>
      <rpy>0 0 0</rpy>
    </model:SickLMS200>
  </model:Pioneer2DX>

The corresponding snippet of the Player configuration file should look like this:

  driver
  (
    name "gz_position"
    provides ["position:0"]
    gz_id "robot1_position"
  )

  driver
  (
    name "gz_laser"
    provides ["laser:0"]
    gz_id "robot1_laser"
  )

  driver
  (
    name "vfh"
    provides ["position:1"]
    <vfh driver settings>
  )

Note that the configuration file is exactly as per the first example; we have simply added another device to the Player server. The VFH driver will use the simulated robot chassis and laser exactly as it would a real robot chassis and laser.

To run this simulation, start Gazebo with:

  $ gazebo <myworld>

where <myworld> is the name of the Gazebo world file, and start Player with

  $ player -g 0 <myconfig>

where <myconfig> is the name of the Player configuration file. Client programs can connect to the server on the default Player port 6665.

Example: Using Multiple Robots

There are a number of ways to work with multiple robots. The simplest way is to use multiple instances of the Player server (one for each robot being simulated). The following Gazebo world file snippet will create a pair of Pioneer2DX robots with SICK~LMS200 lasers.

  <model:Pioneer2DX>
    <id>robot1_position</id>
    <xyz>0 0 0.40</xyz>
    <rpy>0 0 45</rpy>
    <model:SickLMS200>
      <id>robot1_laser</id>
      <xyz>0.15 0 0.20</xyz>
      <rpy>0 0 0</rpy>
    </model:SickLMS200>
  </model:Pioneer2DX>

  <model:Pioneer2DX>
    <id>robot2_position</id>
    <xyz>0 0 0.40</xyz>
    <rpy>0 0 45</rpy>
    <model:SickLMS200>
      <id>robot2_laser</id>
      <xyz>0.15 0 0.20</xyz>
      <rpy>0 0 0</rpy>
    </model:SickLMS200>
  </model:Pioneer2DX>

Since there will be two instances of the Player server, two different configuration files are required. For the first robot:

  driver
  (
    name "gz_position"
    provides ["position:0"]
    gz_id "robot1_position"
  )

  driver
  (
    name "gz_laser"
    provides ["laser:0"]
    gz_id "robot1_laser"
  )

and for the second robot:

  driver
  (
    name "gz_position"
    provides ["position:0"]
    gz_id "robot2_position"
  )

  driver
  (
    name "gz_laser"
    provides ["laser:0"]
    gz_id "robot2_laser"
  )

Note that these files are identical apart from the gz_id property. In general, however, the simulated robots may be heterogeneous, in which case the Player configuration files will differ substantially.

To run this simulation, start Gazebo with:

  $ gazebo <myworld>

where <myworld> is the name of the Gazebo world file, and start two instances of Player with

  $ player -p 7000 -g 0 <myconfig1>

and

  $ player -p 7001 -g 0 <myconfig2>

where <myconfig1> and <myconfig2> are the two Player configuration files. Client programs can connect to the robots robot1 and robot2 through ports 7000 and 7001, respectively.

Example: Using Multiple Robots with --gazebo-prefix

When the simulated robots are homogeneous, one may simplify the process somewhat by employing the --gazebo-prefix flag with Player. The following Gazebo world file snippet will create a pair of Pioneer2DX robots with SICK~LMS200 lasers.

  <model:Pioneer2DX>
    <id>robot1_position</id>
    <xyz>0 0 0.40</xyz>
    <rpy>0 0 45</rpy>
    <model:SickLMS200>
      <id>robot1_laser</id>
      <xyz>0.15 0 0.20</xyz>
      <rpy>0 0 0</rpy>
    </model:SickLMS200>
  </model:Pioneer2DX>

  <model:Pioneer2DX>
    <id>robot2_position</id>
    <xyz>0 0 0.40</xyz>
    <rpy>0 0 45</rpy>
    <model:SickLMS200>
      <id>robot2_laser</id>
      <xyz>0.15 0 0.20</xyz>
      <rpy>0 0 0</rpy>
    </model:SickLMS200>
  </model:Pioneer2DX>

Since the robots are identical, we can write one Player configuration file for both:

  driver
  (
    name "gz_position"
    provides ["position:0"]
    gz_id "_position"
  )

  driver
  (
    name "gz_laser"
    provides ["laser:0"]
    gz_id "_laser"
  )

Note that the gz_id values are incomplete; we will add {prefix} to these values when the Player server is started.

To run this simulation, start Gazebo with:

  $ gazebo <myworld>

where <myworld> is the name of the Gazebo world file, and start two instances of Player with

  $ player -p 7000 -g 0 --gazebo-prefix robot1 <myconfig>

and

  $ player -p 7001 -g 0 --gazebo-prefix robot 2 <myconfig>

where <myconfig> is the common Player configuration file. Client programs can connect to the robots robot1 and robot2 through ports 7000 and 7001, respectively.



Last updated $Date: 2004/12/21 01:49:15 $
Generated on Sun May 22 18:39:09 2005 for Gazebo by doxygen 1.4.2