Information

Documentation

Get OpenRDK at SourceForge.net. Fast, secure and Free Open Source software downloads

edit SideBar

Your first run with Player/Stage

This is the tutorial about how to use OpenRDK together with Player/Stage, in order to have a simulated robot in a 2D world on your own PC.

How to install Player/Stage

In order to run this tutorial, you should have installed the Player/Stage suite. Some distributions (e.g., Ubuntu/Kubuntu), have packages for them, so (if you are on a Ubuntu/Kubuntu), you can write:

  $ sudo apt-get install robot-player-dev robot-player libstageplugin1

And everything should be installed. In any case: you should use only Player and Stage versions 2.0.x, not the new version 3.0, since OpenRDK is not tested with them. There is a bug in the code of the Stage plugin (the version 1 of the Stage 2 plugin: libstageplugin1), to correct it, download this file Attach:rgb.txt and put it in /etc/X11 and in /etc/X11R6/lib/X11. You need to be root to do this (ignore errors about directory already existing):

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

Anyway, after the installation of Player/Stage, you have to reissue the command

  $ cmake .

from the src directory of the OpenRDK, because the build system need to be made aware of the presence of Player/Stage (if you already installed Player/Stage before the first compilation, you can skip all these steps).

You have another choice: download the tarball from the Player/Stage website and use that one. The example explained in this tutorial has been tested with Player/Stage 2.0.3 and 2.0.4.

Running Player with a simulated 2D world

In the directory ${OpenRDK}/data/playerstage, you can find some configuration files for Player. Some of them (e.g., freespace.cfg) use the Stage plugin to load a simulated world. In order to run this simulated world, you have to write in a console:

  $ robot-player freespace.cfg

You should see now the simulated robot (red) in the simulated environment.

Running the RAgent with a module that connects to Player

As for RAgent, we will use a configuration that works as shown in the figure to the right, in which the RDK Agent, thanks to the PlayerClientModule, is able to communicate to the Player server, that, in its turn, is connected to the Stage 2D simulator. Since the RDK Agent is a RConsole, we are able to inspect its properties and act on them.

As you can see, the modules of the GUI are in the same agent of the task-related modules. This can be used as a simple solution when you are testing your algorithms. When you want to deploy your application, all you need to do is to remove the GUI modules from the agent. You can create another agent with only the GUI modules and connect with the first one.

Go in $RDK_ROOT/data/config/examples/player and run (in a different console, not the same of Player: you need to keep Player running, of course):

  $ rconsoleqt -c rqra-player-randomMotion.config

The agent that is running now has inside also some more interesting modules. You can open the robot controller from the "Tools" menu and start moving the robot in the simulated world. If you open the property /mapper/out/map you will see the map created by the module mapper while the robot moves. You can enable the module randomMotion to make it moving randomly around the environment. To enable a module, you can either right-click on the module name, or you can set by hand the property enabled that each module has.

© 2004-2009 RoCoCo Laboratory Powered by PmWiki
Edit - History - Printable View - Recent Changes - Search
Page last modified on May 04, 2010, at 01:52 PM