Print

Intallation Player Stage using ubuntu packages

Player

sudo apt-get install gcc robot-player robot-player-dev libplayerc++2-dev libplayercore2-dev libplayerdrivers2-dev libplayererror2-dev libplayerjpeg2-dev libplayertcp2-dev libplayerxdr2-dev

Stage

sudo apt-get install  stage libstage2-dev libstageplugin1
Copy configs into your home
mkdir ~/projects/
mkdir ~/projects/robot
mkdir ~/projects/robot/robot-player
cp -r /usr/share/player/config ~/projects/robot/robot-player/
mkdir ~/projects/robot/robot-stage
cp -r /usr/share/stage/worlds ~/projects/robot/robot-stage/
rm ~/projects/robot/player
ln -s ~/projects/robot/robot-player ~/projects/robot/player
rm ~/projects/robot/stage
ln -s ~/projects/robot/robot-stage ~/projects/robot/stage
sudo rm /usr/include/player
sudo ln -s /usr/include/player-2.0 /usr/include/player

Test

Start player with stage simulation

robot-player ~/projects/robot/stage/worlds/simple.cfg
OR Start player with the pioneer connected on the serial port
robot-player ~/projects/robot/player/config/pioneer.cfg
Control robot via player Open a new terminal
robot-playerv

  1. Device > position2d:0 > Subsribe
  2. Device > position2d:0 > Enable
  3. Device > position2d:0 > Command
  4. Now you can move the red cross and the robot moves in the stage simulation

Problems

RGB.TXT

On some distributions there is no rgb.txt and you will get the following errorl

err: unable to open color database /usr/X11R6/lib/X11/rgb.txt : No such file or directory (stage.c stg_lookup_color)
Segmentation fault

Solution
  1. create the folder /usr/X11R6/lib/X11
  2. copy the file rgb.txt into it

Datamode

The player server prints the following messages if a client is connected via TCP

warning : tried to push onto a full message queue
error   : tried to push 1/1 from 6:0
warning : tried to push onto a full message queue
error   : tried to push 1/1 from 6:0

Solution

Chane to PLAYER_DATAMODE_PULL mode and have a look at http://playerstage.sourceforge.net/doc/Player-2.1.0/player/grouplibplayercdatamodes.html

  • To change the mode in c++ use the following code:

try {
  m_pPlyRobot->SetDataMode (PLAYERC_DATAMODE_PULL);
} catch (PlayerCc::PlayerError e) {
  std::cerr << e << std::endl;
  return;
}
try {
  m_pPlyRobot->SetReplaceRule ( true, PLAYER_MSGTYPE_DATA, -1, -1);
} catch (PlayerCc::PlayerError e) {
  std::cerr << e << std::endl;
  return;
}



Contributors to this page: Markus Bader .
Page last modified on Tuesday 26 of May, 2009 10:49:13 CEST by Markus Bader.