dLife Home Page

Package dlife.robot.player

Classes and interfaces that support interaction with the Player (v 2_0_3/4) / Stage (v 2_0_4/5) simulation system.

See:
          Description

Class Summary
PlayerDeviceConfiguration This is an abstract class for creating a PlayerDeviceConfiguration.
PlayerDeviceConfiguration.PlayerDeviceType A very simple class the specify a player device type.
PlayerRobot This is an abstract class to represent a PlayerRobot.
PlayerServerProcess A PlayerServer is used to launch a player server using a given location of the system's 'player' command and location of a .cfg file.
PlayerSimulation A PlayerSimulation object is a helpful object to create a Player simulation and all necessary configuration files.
StagePositionData A simple object to hold position data returned from a Stage simulation.
StageSimulationControl A StageSimulationControl object allows direct access to robots within the Stage simulation.
 

Exception Summary
InvalidPlayerDeviceException Exception that is thrown when attempting to add a device to a PlayerRobot that is not valid.
NoMatchingSonarInterfaceException Exception that is thrown when attempting to find a Sonar interface from Player based on the number of sensors in the Sonar array.
PlayerColorInformationException Exception that is thrown when an error reading the 'rgb.txt' file that Player/Stage stores its color information in.
PlayerConfigurationDataException Exception that is thrown when an error occurs while attempting to write the configuration files for Player.
 

Package dlife.robot.player Description

Classes and interfaces that support interaction with the Player (v 2_0_3/4) / Stage (v 2_0_4/5) simulation system. Player/Stage is an open source robot control interface (Player) and simulator (Stage). dLife uses Player and Stage together to control simulated robots. dLife does not use Player to communicate with physical robots. Instructions for setting up Player/Stage and interacting with Player/Stage are given below. Also below are brief descriptions of some of the useful classes in this package and pointers to examples of their use. Finally, information is provided on how to create new simulated robots for use with dLife and Player/Stage.

Player/Stage Setup

  1. Complete the Basic dLife Installation.
  2. Install the Player/Stage System

Player/Stage Quick Start

  1. Complete the Player/Stage Setup (once only).
  2. Open a terminal window.
  3. Change into the dLifeDist/UserScripts directory.
  4. Enter the following commands:
  5. Choose a directory in the dialog that appears. The program will create a new sub-directory named HemiSampleSimulation in the chosen location that will contain the simulation files.
  6. Launch the dlife.robot.gui.controlcenter
  7. Select dlife.robot.hemisson.HemissonPlayer in the "Robot:" drop down list.
  8. Click "Controller"
  9. Navigate to and choose dLifeDist/examples/dlife/robot/hemisson/HemiWander.class in the File Chooser dialog that appears.
  10. Click the "Start Up" button.
  11. Click the "Browse" button in the dialog that appears.
  12. Navigate to the HemiSampleSimulation directory created above and choose the HemiSampleSimulation.dlp file.
  13. Click on the drop-down labeled "Select Robot..." and choose "7000:hemi1 - HemissonPlayer"
  14. Click "Connect"
  15. A Player/Stage simulation window should appear.
  16. Click "Run" in the ControlCenter. The simulated Hemisson should wander around the environment without bumping into the walls.

Additional Resources

Using a Simulation

Interacting with Player/Stage simulations via dLife is very similar to interacting with physical robots. Once a simulation is created, the simulated robot can be controlled via the dlife.robot.gui.controlcenter in the same way that physical robots are controlled. For an example of controlling a simulated Hemisson see the PlayerSimulationHemiWander example.

Creating Simulations

The PlayerSimulation class can be used to create Player/Stage simulations for use with dLife and the ControlCenter. The BuildDlifePlayerSimulation example illustrates how this class can be used to construct and save a Player/Stage simulation for use with the dLife ControlCenter. Two other examples (PlayerSimulationHemiWander and PlayerMultipleRobots) also use the PlayerSimulation class to build simulations, but do not save the simulation to a file and do not use the ControlCenter.

Adding Noise to Simulations

The dlife.robot.player.noise package provides a mechanism for adding noise to robot sensors in Player/Stage simulations. See the documentation in the dlife.robot.player.noise for more information and examples.

The StageSimulationControl

The StageSimulationControl class provides the ability to interact directly with the Stage simulation. This class can be used to reposition robots within the simulation (i.e. jump them directly to a new location) and to find out the amount of simulation time that has elapsed. The EvolvedObstacleAvoidance example uses a StageSimulationControl to reposition the simulated robot to the center of the world before each individual's fitness is evaluated.

The PlayerServerProcess

The PlayerServerProcess class provides the ability to start and stop the Player/Stage simulation system programatically. In many applications direct use of the PlayerServerProcess will not be necessary because the Player/Stage system is automatically started when a simulated robot is started (either by the ControlCenter or by invoking its startup method). However, in some applications it may be necessary to have the ability to start/stop/terminate the the Player/Stage system manually.

One such application is when evolving robot controllers. Doing so requires the execution of a large number of simulations. Inevitably, Player/Stage system will hang or crash at some point. Using a PlayerProcessServer to start Player/Stage provides the tools necessary to cope with this situation. In particular, the PlayerServerProcess.Monitor class can monitor the Player/Stage process and terminate it after a specified period of time. See the PlayerServerProcessExample for some sample code that illustrates the use of a StageSimulationControl.

Developer Information:

Need to write this.


dLife Home Page