Recent Changes - Search:


Project X 2010

MCP III.5 2009

2008 Docs

Old Docs

2007 Docs

Who And What

edit SideBar


Player/Stage overview Player 2.1 C++ Reference

Useful notes on Stage

Building Player/Stage from source (versions 2.1.3/2.1.1, respectively)(RECOMMENDED!)

  • In Ubuntu, install the build-essential package that includes compilers and libraries.
  • Get the source files from sourceforge (
  • Use Synaptic Package Manager and ensure you have libgtk2.0-dev and libltdl-dev
  • To enable multithreading and signaling, use Synaptic to install libboost-1.40-all-dev. For python bindings, install swig.
  • Unpack the source archives, and within each directory, run the following commands:
    • ./configure
    • make
    • sudo make install
  • After both have installed: sudo ldconfig
By default, Player/Stage will be installed to /usr/local/share/player or /usr/local/share/stage. Test the install by running >player /usr/local/share/stage/worlds/simple.cfg (which starts up player with stage simulation), and then >/usr/local/share/player/examples/libplayerc++/laserobstacleavoid (a player client program, the 'brain' of the robot).
Now you need to make sure you can build player client programs:
  • First, check the /usr/lib/pkgconfig directory to see if playercore.pc exists. If it does not, return to the player source directory, go into the libplayercore directory, and copy all the .pc files into the /usr/lib/pkgconfig directory.
  • Check the PKG_CONFIG_PATH variable to make sure it points to the /usr/lib/pkgconfig directory. Check using echo $PKG_CONFIG_PATH and set it (if necessary) with export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/lib/pkgconfig (works for bash, if you have another shell, you're on your own).
  • Go to the /usr/local/share/player/examples/libplayerc++ directory and run

sudo g++ -o laserobstacleavoid `pkg-config --cflags playerc++` `pkg-config --libs playerc++`
If you can build a basic client program and run it, you're pretty much good to go. I think there are more intricacies to building a shared driver object, but it would be best to look at the player/stage on-line manuals for that.

Testing your install

Assuming you've already managed to compile/install Player and stage (or found a system with them already installed), here's how you get the simple robot running around the simple little world.

  1. Find where Stage installed its .world and .cfg files (default: /usr/local/share/stage/worlds )
  2. Give yourself write permission for
  3. Find the line "gui_disable 1" in, change it to "gui_disable 0"
  4. Command line: "player simple.cfg" You should now have a window with a world and a stationary robot.
  5. To manually control the robot, run "playerv" from another terminal.
  6. If you want to run the sample code they provide for you, you're going to have to hunt it down.
  7. Find the directory you unzipped the player installer into (should be named "player-2.1.2" or some such, depending on version)
  8. From there, go to "examples/libplayerc++"
  9. While you have the stage world running, and do not have playerv running, run ./laserobstacleavoid

Quick trick for compiling

Command to compile:

	g++ -o outfile `pkg-config --cflags playerc++` `pkg-config --libs playerc++`

If this is annoying to remember, or copy/paste every time, you can use a little bash script to do it for you:

	g++ -o $1 `pkg-config --cflags playerc++` $ `pkg-config --libs playerc++`
Edit - History - Print - Recent Changes - Search
Page last modified on February 04, 2010, at 07:51 PM