Player/Stage: Getting Started Guide

You don’t need to (and should not!) install Player/Stage yourself. A shared version is available on our UTK CS Linux machines (e.g., in Hydra and Cetus). 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>@cetus15.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.

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 robot-player in our new Ubuntu installation) is located in /usr/bin, so be sure this is in your PATH environment variable. (Note: There is also a version of player in /research/playerstage, but this is an older version. Please use the version in /usr/bin.)

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

    For .bashrc or .zshrc:
    export PLAYERPATH=”/usr/bin”

    For .cshrc or .tcshrc:
    setenv PLAYERPATH /usr/bin

  3. [For this class (Autonomous Mobile Robots), you must use C or C++. So, this information is included only for your information, in case you want to work with Player/Stage on your own later. That is, skip this step for this class.]

    [Note: These Python/Java instructions might need updating under our new Ubuntu installation. Let me know if you know of changes that should be made.]

    If you don’t plan to use Python or Java, you can skip this step. 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. Now copy the examples to your home area, so that you can experiment with them. These examples come from within the "share" directory in /usr/share (in particular the "player" and "stage" subdirectories). To make it easier for you to begin with, I have packaged these files together in the tar file here: Player/Stage examples. This package also includes an example Makefile that helps you compile your Player/Stage programs. Download this file to your own directory and unpack it ("tar xvf P-S-examples.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:
    robot-player simple.cfg

    (Note: on most installations of Player/Stage, the executable is called "player" instead of "robot-player". However, our EECS Ubuntu installation of Player/Stage automatically renamed the executable "robot-player", to prevent some naming conflicts. Just be aware of this naming difference, should you install Player/Stage on your own personal computer (in which case the binary might end up being named "player")).

    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/libplayerc++ directory. In another terminal window, go to this directory and run the executable:
    ./laserobstacleavoid

    If you see the robot moving through the environment, everything is set up correctly.