1. Installation (player 3.0.2) Reference: https://sites.google.com/site/syahps/installation
# Create src directory to put the source files
cd ~
pwd
mkdir src
cd src
# Download Player and Stage source code, put them into src folder
http://sourceforge.net/projects/playerstage/files/Player/3.0.2/player-3.0.2.tar.gz/download
http://sourceforge.net/projects/playerstage/files/Stage/3.2.2/Stage-3.2.2-Source.tar.gz/download
# Update Ubuntu installation
sudo apt-get update
sudo apt-get upgrade
# Install Player dependencies (do not know if all are necessary, but at least they are sufficient)
# Does not pose problems of version numbers
sudo apt-get install autotools-dev build-essential cmake cpp
# Might pose problems of version numbers Note:Different with reference page (version numbers)
sudo apt-get install libboost-signals1.46.1 libboost-signals1.46-dev libboost-thread1.46.1 libboost-thread1.46-dev libcv2.3 libcv-dev libgdk-pixbuf2.0-0 libgdk-pixbuf2.0-dev
# Does not seem to pose problems of version numbers
sudo apt-get install libgnomecanvas2-0 libgnomecanvas2-dev libgsl0-dev libgtk2.0-dev libjpeg62-dev libtool libxmu-dev swig
# Install python-dev bindings (apparently required by Player) Note:Different with reference page (version numbers)
sudo apt-get install python2.7-dev
# Install dependencies for problems with make later (libcv-dev might already been installed, see above!)
sudo apt-get install libcv-dev libcvaux-dev libhighgui-dev
# Update Ubuntu installation (again, just checking!) -
sudo apt-get update
sudo apt-get upgrade
# Extract the Player source files
tar xzvf player-3.0.2.tar.gz
# Configure and install Player in the $usr/local directory (other prefixes can be used)
cd player-3.0.2
mkdir build
cd build
pwd
cmake ../
make
sudo make install
cd ~
pwd
# Update database of local files, for use by locate (optional!)
sudo updatedb
# Checking Player installations
# Should get something like: -L/usr/local/lib -lplayercore -lpthread -lltdl -ldl -lplayerinterface -lplayercommon
pkg-config --libs playercore
# Need to set dynamic library path, and others..
# Better append these into ~/.bashrc file, e.g.:
# LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
# export LD_LIBRARY_PATH
# Then:
# source ~/.bashrc
export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
# Print dynamic library path, should get something like: /usr/local/lib:
echo $LD_LIBRARY_PATH
# Checking Player version
pkg-config --modversion playercore
pkg-config --modversion playerc++
pkg-config --modversion playerc
# Checking which Player
which player
# Test Player
player
2. Installation (stage 3.2.2) Reference page: http://2s22.ing.ula.ve/rafael/paquetes-requeridos-para-instalar-player-stage-en-ubuntu-11-10/ (French)
# Install Stage dependencies (do not know if all are necessary, but at least they are sufficient)
sudo apt-get install freeglut3 freeglut3-dev libfltk1.1 libfltk1.1-dev libltdl7 libltdl-dev libpng12-dev libpng12-0
# Extract the Stage source files
tar xzvf Stage-3.2.2-Source.tar.gz
Notes:
If Stage compile the following error and the like:
main.cc: (. text.startup +0 x34b): undefined reference to `Fl :: run () ' libstage.so.3.2.2: undefined reference to `Fl_File_Chooser :: value (int) ' libstage.so.3.2. 2: undefined reference to `fl_alert (char const *, ...) ' libstage.so.3.2.2: undefined reference to `Fl_Shared_Image :: get (const char *, int, int) ' ...
To correct this error you need to add the-Wl,-not-as-needed to compiler options. This is done in the file CMakeLists.txt
where lines
SET (CMAKE_CXX_FLAGS_RELEASE " -O3 -DNDEBUG ${WALL} " CACHE INTERNAL "C Flags for release" FORCE) SET (CMAKE_CXX_FLAGS_DEBUG " -ggdb ${WALL} " CACHE INTERNAL "C Flags for debug" FORCE) SET (CMAKE_CXX_FLAGS_PROFILE " -O3 -ggdb -pg ${WALL} " CACHE INTERNAL "C Flags for profile" FORCE)
changed by:
SET (CMAKE_CXX_FLAGS_RELEASE " -O3 -DNDEBUG -Wl,--no-as-needed" CACHE INTERNAL "C Flags for release" FORCE) SET (CMAKE_CXX_FLAGS_DEBUG " -ggdb -Wl,--no-as-needed " CACHE INTERNAL "C Flags for debug" FORCE) SET (CMAKE_CXX_FLAGS_PROFILE " -O3 -ggdb -pg -Wl,--no-as-needed " CACHE INTERNAL "C Flags for profile" FORCE)
cd Stage-3.2.2-Source/
mkdir build
cd build/
cmake ../
make
sudo make install
3. Test Reference page: http://yorkroboticist.blogspot.co.uk/2011/10/installing-playerstage-in-ubuntu-natty.html
The stage source code has some handy code that should work if you've got everything installed. To test your install in your terminal go to the /worlds directory in the source code folder(stage source code folder). Type player simple.cfg into the terminal. In the unlikely event that that works you've successfully installed Player/Stage!
I got the following error:
- player: error while loading shared libraries: libplayerdrivers.so.3.0: cannot open shared object file: No such file or directory.
To fix this open up your .bashrc file (go to Home folder and press Ctrl+h)
Write the following line IF YOU'RE USING A 32-BIT INSTALL at end of the file:
- export LD_LIBRARY_PATH+=/usr/local/lib
If you changed CMAKE_INSTALL_PREFIX whilst installing player and or stage then do this:
- export LD_LIBRARY_PATH+="whatever install prefix you made"
Now retest your install IN A NEW TERMINAL. I got the following error:
Registering driver Player v.3.0.2
* Part of the Player/Stage/Gazebo Project [http://playerstage.sourceforge.net].
* Copyright (C) 2000 - 2009 Brian Gerkey, Richard Vaughan, Andrew Howard,
* Nate Koenig, and contributors. Released under the GNU General Public License.
* Player comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to redistribute it under certain conditions; see COPYING for details.
error : Failed to load plugin stageplugin.
error : libtool reports error: file not found
error : plugin search path: /home/robotlab/playerstage/Stage-3.2.2-Source/worlds:.:/usr/local/lib/
error : failed to load plugin: stageplugin error : failed to parse config file simple.cfg driver blocks
This is most likely caused by the computer not being able to find Stage. Back to the .bashrc....
- change export LD_LIBRARY_PATH+=/usr/local/lib64 to...
- export LD_LIBRARY_PATH+=/usr/local/lib64:/usr/local/lib
4. Run test program
open terminal : playerv --position2d --laser
open a new terminal : player ~/src/Stage-3.2.2-Source/worlds/simple.cfg