Player/Stage: Getting Started Guide

Player/Stage has been installed for you on the Hydra and Arc machines. You can also install it on your own laptop, if you like (although it isn't necessarily trivial.) The instructions below are for the shared version available on our EECS Hydra Linux machines.

It should be possible to remotely login, although you might have problems if you are working over a wireless network. In any case, if you login remotely using ssh, make sure to enable X11 forwarding with the -X option so that the simulation window can be displayed on your screen. Depending on your system, you may need to also use the -Y option to enable trusted X11 forwarding. For example:

ssh -XY <username>@hydra15.eecs.utk.edu

If you're using a Windows machine to login remotely, you won't be able to run the simulator unless you've installed an X server. Windows users: note that the latest version of Stage uses 3D GL which may cause issues when X forwarding in Windows; the Xming server application for Windows has been tested and should work.

The following instructions show you how to set up your shell environment, start the Player/Stage simulator, and run an example program.

  1. The Player binary (called "player") is located at /pkgs/player-svn/bin/player, so be sure this is in your PATH environment variable.

  2. When we start Player, it will try to load the Stage plugin module. We tell it where to look with the PLAYERPATH and LD_LIBRARY_PATH environment variables.

    For .bashrc or .zshrc:
    export PLAYERPATH="/pkgs/player-svn/bin"
    export LD_LIBRARY_PATH="/pkgs/player-svn/lib:/pkgs/stage-git/lib64"

    For .cshrc or .tcshrc:
    setenv PLAYERPATH /pkgs/player-svn/bin
    setenv LD_LIBRARY_PATH /pkgs/player-svn/lib:/pkgs/stage-git/lib64

  3. Most commonly, we use C++ to program the robots, although you are welcome to use other languages if you can get them to interface properly to Player/Stage. If you plan to write your program in Python, you need to tell it where to find Player's Python modules by modifying PYTHONPATH. If you will be using Java, the location of Player's Java class files needs to be added to CLASSPATH.

    For .bashrc or .zshrc:
    export PYTHONPATH="$PYTHONPATH:/usr/local/lib/python2.4/site-packages"
    export CLASSPATH="$CLASSPATH:/usr/local/src/javaclient/classes:."

    For .cshrc or .tcshrc:
    setenv PYTHONPATH $PYTHONPATH:/usr/local/lib/python2.4/site-packages
    setenv CLASSPATH $CLASSPATH:/usr/local/src/javaclient/classes:.

  4. We have some sample code for you, to help you get started. Download this file of examples to your own directory and unpack it ("tar xvf Sample-Player-Stage.tar"). You will find two subdirectories:

    worlds: This contains the maps and configuration files for various examples.

    examples: This contains example programs in C++.

  5. Let's verify that we can start the Player/Stage simulator and get the Stage window to show up on the screen. Player should be run from the worlds directory since it requires a configuration file on startup. So go to the worlds directory and type the following command:
    player simple.cfg

    This should open a Stage simulator window with a robot in the lower left of the map.

  6. At this point, the Player server running on the simulated robot is waiting for a client program to connect and begin accessing the sensor data and sending movement commands. For now, we'll use the client program in the examples directory. In another terminal window, go to this directory and run the executable:
    ./simple-robot

    If you see the robot moving in a cirle in an environment with several rooms, then everything is set up correctly.