Friday 15 October 2010

Install Player-Stage Robot Simulator under Linux

Make sure to install the necessary packages (particularly for graphics output)

sudo aptitude install libfltk-dev libfltk
sudo aptitude install autoconf automake

If someting fails during ''autoreconf -i'' later, fire up Synaptic and check whether the **latest** version is installed!


It's worth installing Player/Stage locally in your home!

This example will assume the PATH from below

cd
mkdir player-stage
cd player-stage

NOTE after installation, you'll end up with folders 'bin', 'include' and 'lib' here, which represents the local installation tree.


Check out the sources for player-stage from their SVN

I recommend version 2.1, as it is the most stable so far.

svn co https://playerstage.svn.sourceforge.net/svnroot/playerstage/code/player/branches/release-2-1-patches/ player-2.1
svn co https://playerstage.svn.sourceforge.net/svnroot/playerstage/code/stage/branches/release-2-1-patches/ stage-2.1


Install Player

INSTALL PLAYER FIRST! Stage is a module to Player and is compiled afterwards.

cd player-2.1
autoreconf -i
./configure --prefix=$HOME/player-stage/ps-2.1
make install

NOTE after running "autoreconf", insert the following line into "Makefile.am":
ACLOCAL_AMFLAGS = -I m4,

and the following one into "configure.ac":
AC_CONFIG_MACRO_DIR([m4])


Install Stage

Set the player/stage environment variables:

export PKG_CONFIG_PATH=$HOME/player-stage/ps-2.1/lib/pkgconfig
export PATH=$PATH:$HOME/player-stage/ps-2.1/bin
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$HOME/player-stage/ps-2.1/lib

Configure and install stage:

cd stage-2.1
./bootstrap
./configure --prefix=$HOME/player-stage/ps-2.1
make install

NOTE after running "autoreconf", insert the following line into "Makefile.am":
ACLOCAL_AMFLAGS = -I m4,

and the following one into "configure.ac":
AC_CONFIG_MACRO_DIR([m4])

Now you should be good to go using Player/Stage



Tweaks & Error Messages During Install and how to Resolve Them


* glibc detected * ./stage_prob_controller: double free or corruption (!prev): 0x093e46d0 *

This is an old glibc++ error, which can be solved by setting the environment variable:

export MALLOC_CHECK_=0


Compile your own STAGE module: stage_test.cpp:21: error: ‘VERSION’ was not declared in this scope

You need to copy a config header file from the stage directory:

cp $HOME/player-stage/stage-2.1/config.h $HOME/player-stage/include/stage-2.1/
cp $HOME/player-stage/player-2.1/config.h $HOME/player-stage/include/player-2.1/


Stage is running and you want to know which TCP port it is listening on?

netstat --inet --tcp -lp

will tell you on a Linux box


In case of an error "unable to open color database"

sudo mkdir /usr/X11R6/lib/X11
sudo cp /etc/X11/rgb.txt /usr/X11R6/lib/X11/rgb.txt



Running a simple example from the include examples


Start the world simulator

player $HOME/player-stage/stage-2.1/worlds/simple.cfg


Start an example player (robot) from the included C++ examples

$HOME/player-stage/player-2.1/examples/libplayerc++/randomwalk



How to compile and run your own examples


Set the player/stage environment variables:

export PKG_CONFIG_PATH=$HOME/player-stage/lib/pkgconfig
export PATH=$PATH:$HOME/player-stage/bin
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$HOME/player-stage/lib


Compile the demos

make OR
make files


Run Stage (check the Makefile for commands)

make start


Run your player (controller), for example

./prob_controller

No comments:

Post a Comment