Wednesday 5 February 2014

10-STEP PROCESS TO INSTALL PLAYER/STAGE/GAZEBO IN UBUNTU

Hi Friends

Lets get into installing player project in the ubuntu system in a very easy process of 10 steps.

Note:Please make sure the system has no version of opencv installed,if present make sure to remove it completely from the system libraries.You can install it after this process is complete.Also for  Ubuntu 12.10,13.04 or 13.10 the process remains same,but the library names/versions of dependencies we are going to install may differ.

Let's get started:-

Step 1:-

Create a directory named src in /home directory

In the terminal,type the following
a)mkdir src
b)cd src

Step 2:-

Download player and stage tar files and store in src
LINKS:
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

Step 3:-

Install pre-requisites/dependencies

in the terminal,type the following

a)sudo apt-get update
b)sudo apt-get upgrade
c)sudo apt-get install autotools-dev
d)sudo apt-get install build-essential
e)sudo apt-get install cmake
f)sudo apt-get install cpp
g)sudo apt-get install libboost-signals1.46.1
h)sudo apt-get install libboost-signals1.46-dev
i)sudo apt-get install libboost-thread1.46.1
j)sudo apt-get install libboost-thread1.46-dev
k)sudo apt-get install libcv2.3
l)sudo apt-get install libcv-dev
m)sudo apt-get install libgdk-pixbuf2.0-0
n)sudo apt-get install libgdk-pixbuf2.0-dev
o)sudo apt-get install libgnomecanvas2-0
p)sudo apt-get install libgnomecanvas2-dev
q)sudo apt-get install libgsl0-dev
r)sudo apt-get install libgtk2.0-dev
s)sudo apt-get install libjpeg62-dev
t)sudo apt-get install libtool
u)sudo apt-get install libxmu-dev swig
v)sudo apt-get install python2.7-dev
w)sudo apt-get install libcv-dev
x)sudo apt-get install libcvaux-dev
y)sudo apt-get install libhighgui-dev
z)sudo apt-get install freeglut3

a)sudo apt-get install freeglut3-dev
b)sudo apt-get install libfltk1.1
c)sudo apt-get install libfltk1.1-dev
d)sudo apt-get install libltdl7
e)sudo apt-get install libltdl-dev
f)sudo apt-get install libpng12-dev
g)sudo apt-get install libpng12-0

a)sudo apt-get update
b)sudo apt-get upgrade

Step 4:-

Install player-

In the terminal,type the following
a)tar xzvf player-3.0.2.tar.gz
b)cd player-3.0.2
c)mkdir build
d)cd build
e)cmake ../
f)sudo make

*****************************************************************************

NOTE:-Error bugs for make(if errors dont appear in 'make',please skip this part)

--error bugs while installation(if no errors skip this part)
1)cmake stopped with errors in timer.cpp
:- add #include <unistd.h> in timer.cpp

2)artoolkitplus error
:- install artoolkitplus
--$ cd Downloads
$ wget https://launchpad.net/artoolkitplus/trunk/2.3.0/+download/ARToolKitPlus-2.3.0.tar.bz2
$ tar xvjf ARToolKitPlus-2.3.0.tar.bz2
$ cd ARToolKitPlus-2.3.0
$ mkdir build
$ cd build
$ cmake ..
$ make
$ sudo make install

3)cmake stopped with readlog.cc error
:-make changes in readlog.cc
change line 668  -->  ret = gzseek(this->file,0,SEEK_SET);
TO -->                ret = gzseek((gzFile)this->file,0,SEEK_SET);
change line 714  -->  ret = (gzgets(this->file, this->line, this->line_size) == NULL);
TO -->                ret = (gzgets((gzFile)this->file, this->line, this->line_size) == NULL);

4)assembler message error
:- do "sudo make" instead of "make"

5)link cxx error-(cannot find opencv and other bullshits)(STILL A PROBLEM)
--
a)changes in .bashrc file of build
$cd
$gksudo gedit ./bashrc
add the following to it
$ export PATH=~/usr/local/bin:$PATH
$ export CPATH=~/usr/local/include:$CPATH
$ export LD_LIBRARY_PATH=~/usr/lib:$LD_LIBRARY_PATH

b)change the CMAKE_CXX_FLAGS variable in /player-3.0.2/build/CMakeCache.txt.
Change the line
CMAKE_CXX_FLAGS:STRING=
To
CMAKE_CXX_FLAGS:STRING=   -lboost_system
c)install all libdc files
d)install libpq-dev libpqxx-dev

****************************END OF ERROR BUGS*******************

g)sudo make

h)sudo make install

i)sudo updatedb

Step 5:-

Open a new terminal and type

a)gksudo gedit ./bashrc

When the file opens,add the following to the end of it

PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/home/USER/src/player-3.0.2/build/libplayercore
PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/home/USER/src/player-3.0.2/build/libplayerinterface
PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/home/USER/src/player-3.0.2/build/libplayercommon
PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/home/USER/src/player-3.0.2/build/
PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/home/USER/src/player-3.0.2/build/client_libs/libplayerc++
PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/home/USER/src/player-3.0.2/build/client_libs/libplayerc
export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
export PKG_CONFIG_PATH
export PATH=$PATH:"/usr/local/lib64"
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:"/usr/local/lib":"/usr/local/lib64"
export PLAYERPATH="/usr/local/lib":"/usr/local/lib64"
export STAGEPATH="/usr/local/lib":"/usr/local/lib64"

Step 6:-

Checking installation

in the treminal : $ pkg-config --libs playercore
(output: -L/usr/local/lib64 -lplayercore -lpthread -lltdl -ldl -lplayerinterface -lplayercommon)
In the terminal : $ pkg-config --cflags playercore
(output: -I/usr/local/include/player-3.0)

Step 7:-

Install Stage

In the terminal,type the following

a)sudo apt-get update
b)sudo apt-get upgrade
c)tar xzvf Stage-3.2.2-Source.tar.gz
d)cd Stage-3.2.2-Source/
e)mkdir build
f)cd build/
g)cmake ../
h)sudo make

*****************************************************************************************

NOTE:-Error bugs for make(if errors dont appear in 'make',please skip this part)

--error bugs while installation(if no errors skip this part)

--error with undefined reference to various libs and functions

In the same terminal,type
a)cd ..
c)sudo gedit CMakeLists.txt

Note:-This CMakeListestxt file will be in the folder Stage-3.2.2-Source,make sure to do the changes in the correct one if you open a new terminal
change the three 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)

TO:

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)

(save and close the file)

********************* END OF ERROR BUGS*******************************

i)cd build

j)sudo make

k)sudo make install

Step 8:-

Testing installation
open a new terminal
a)cd src/Stage-3.2.2-Source/worlds
b)player simple.cfg

Step 9:-

Installing gazebo(1.9.1)
open a new terminal

a)sudo sh -c 'echo "deb http://packages.osrfoundation.org/gazebo/ubuntu precise main" > /etc/apt/sources.list.d/gazebo-latest.list'
b)wget http://packages.osrfoundation.org/gazebo.key -O - | sudo apt-key add -
c)sudo apt-get update
d)sudo apt-get install gazebo

Step 10 :-

Testing gazebo
open a new terminal

a)gazebo
(for the first run it takes time to open the gui,keep patience)

NOTE:-to add models manually to gazebo
open a terminal and type
a)cd ~/.gazebo/models
b)wget -R *index.html*,*.tar.gz --cut-dirs=1 --no-parent -r -x -nH http://gazebosim.org/models/HERE YOU ENTER THE MODEL NAME/

You have now succeeded in installing player/stage/gazebo.

For any further queries please let me know in the blog or mail me at "abhishek4273@gmail.com".

############CHEERS############3

1 comment:

  1. thanks for tuto it's the very helpful but i have a problem istalling player-3.0.2...I followed the steps then i had theis error message
    #############################

    [ 80%] Built target playerdrivers
    Linking CXX executable player
    libplayerdrivers/libplayerdrivers.so.3.0.2: undefined reference to `PQresultErrorMessage'
    libplayerdrivers/libplayerdrivers.so.3.0.2: undefined reference to `PQstatus'
    libplayerdrivers/libplayerdrivers.so.3.0.2: undefined reference to `PQsetdbLogin'
    libplayerdrivers/libplayerdrivers.so.3.0.2: undefined reference to `PQgetvalue'
    libplayerdrivers/libplayerdrivers.so.3.0.2: undefined reference to `PQbinaryTuples'
    libplayerdrivers/libplayerdrivers.so.3.0.2: undefined reference to `PQclear'
    libplayerdrivers/libplayerdrivers.so.3.0.2: undefined reference to `PQgetlength'
    libplayerdrivers/libplayerdrivers.so.3.0.2: undefined reference to `PQntuples'
    libplayerdrivers/libplayerdrivers.so.3.0.2: undefined reference to `PQexecParams'
    libplayerdrivers/libplayerdrivers.so.3.0.2: undefined reference to `PQfinish'
    libplayerdrivers/libplayerdrivers.so.3.0.2: undefined reference to `PQexec'
    libplayerdrivers/libplayerdrivers.so.3.0.2: undefined reference to `PQresultStatus'
    collect2: ld a retourné 1 code d'état d'exécution
    make[2]: *** [server/player] Erreur 1
    make[1]: *** [server/CMakeFiles/player.dir/all] Erreur 2
    make: *** [all] Erreur 2

    #########################################

    I using:
    ubuntu-12.04.4-desktop-i386 via VirtualBox

    ReplyDelete