Manual-5

From jderobot
Jump to: navigation, search

This is the manual for jderobot-5. The most updated release of the documentation for this experimental release is this mediawiki. The API documentation can be found here.

Contents

Introduction

What is this Manual for?

This manual is intended to describe the Jderobot 5.0 software, its design and its components. It is oriented to Jderobot users and developers. For developers it includes descriptions for each piece of software in this experimental distribution.

This is the official most up to date documentation of Jderobot 5.0. It is written in the Mediawiki tool because reading a Mediawiki is more handy than reading a manual in paper and because videos can be included, enhancing the descriptions.

What is JDErobot 5.0?

JDErobot 5.0 is a collection of components that communicate between them through ICE. These components use a set of defined interfaces to interact with each other, being this the only coupling mechanism between components. This way we can achieve what we were trying with older versions of JDErobot, a components based architecture, but without the drawbacks of trying to program middleware related code.

JDErobot 5.0 SVN folder organization

Under 5.0 repository, the following folders are available:

Installing JDErobot 5.X

Tables of components/libraries/tools and their dependencies

In these tables you can see components/libraries/tools and their dependencies, in addition to its cmake (if it's tuned or not) and if it is documented in the mediawiki.

Drivers

Component Dependencies Cmake tuned Documented in mediawiki
cameraserver colorspaces, gearbox, jderobotinterfaces, ice, opencv Ubuntu 10.04 Cameraserver
cameraview_icestorm colorspaces, gearbox, gstreamer, gtkmm 2.4, ice, jderobotinterfaces, libglademm 2.4, opencv Ubuntu 10.04, Debian Wheezy NO
gazeboserver colorspaces, gazebo 1.X, gearbox, ice, jderobotinterfaces, opencv Ubuntu 10.04 / Debian Wheezy GazeboServer
giraffeServer NO
naobody (same as alarmgenerator) + gtk+, gtkgl, gsl, jderobotice, jderobotutil, colorspaces, libjderobotinterfaces, libprogeo, libpioneer NO
naoserver NO
kinectServer cminpack 1, eigen3, gearbox, ice, jderobotice, jderobotinterfaces, jderobotutil, libusb 1.0, ni, opencv, openni, pcl 1.6, vtk Debian Wheezy KinectServer
openniServer colorspaces, gearbox, gsl, ice, jderobotice, jderobotinterfaces, jderobotutil, libglademm 2.4, opencv, nit2 + openni2, progeo Ubuntu 12.04 / Debian Wheezy (+independent) OpenniServer
openniServer-kinect colorspaces, gearbox, gsl, ice, jderobotice, jderobotinterfaces, jderobotutil, libglademm 2.4, opencv, nite + openni 1.5.4, progeo Ubuntu 12.04 / Debian Wheezy (+independent) OpenniServer
playerserver gearbox, ice, jderobotice, jderobotinterfaces, jderobotutil, player Debian Wheezy Playerserver
playerserver2.0 gearbox, ice, jderobotice, jderobotinterfaces, jderobotutil, player Debian Wheezy Playerserver
wiimoteServer cwiid, gearbox, ice, jderobotice, jderobotinterfaces, jderobotutil Debian Wheezy WiimoteServer

Libraries

Library Dependencies Cmake tuned Documented in mediawiki
bgfgsegmentation NO
colorspaces NO
colorspacesice NO
fuzzylib Fuzzylib
jderobotice NO
jderobotutil NO
pioneer NO
progeo Progeo
visionlib (same as alarmgenerator) + jderobotice, jderobotutil, libprogeo Visionlib

Tools

Tool Dependencies Cmake tuned Documented in mediawiki
alarmgenerator opencv, gtkmm, libglademm, gthread, libgnomecanvas, libgnomecanvasmm, gtkglextmm, jderobotinterfaces NO
bgfglab bgfgsegmentation, gearbox, gtk 2.0, gtkmm 2.4, ice, jderobotice, jderobotinterfaces, jderobotutil, libglademm 2.4, opencv Debian Wheezy NO
basic_component colorspaces, gearbox, gthread 2.0, gtk 2.0, gtkmm 2.4, ice, jderobotice, jderobotinterfaces, jderobotutil, libglademm 2.4, opencv Ubuntu 10.04 / Ubuntu 12.04 / Debian Wheezy (+independent) Basic Component
basic_component_qt colorspaces, gearbox, ice, jderobotice, jderobotinterfaces, jderobotutil, opencv, qt Ubuntu 10.04 / Ubuntu 12.04 / Debian Wheezy (+independent) Basic Component
calibrator colorspaces, gearbox, gsl, gtkglextmm 1.2, gtkmm 2.4, ice, jderobotice, jderobotinterfaces, jderobotutil, libglademm 2.4, opencv, progeo Ubuntu 10.04 / Ubuntu 12.04 / Debian Wheezy Calibrator
calibratorKinect (+independent) CalibratorKinect
cameraview colorspaces, gstreamer, gtkmm 2.4, ice, jderobotinterfaces, libglademm 2.4, opencv Ubuntu 10.04 Cameraview
kinectViewer colorspaces, gearbox, gtkglextmm 1.2, gtkmm 2.4, ice, jderobotice, jderobotinterfaces, jderobotutil, libglademm 2.4, opencv, pioneer, progeo Debian Wheezy (+independent) KinectViewer
colortuner colorspaces, gearbox, gtkmm 2.4, ice, jderobotice, jderobotinterfaces, jderobotutil, libglademm 2.4, opencv Debian Wheezy ColorTuner
giraffeclient colorspaces, gearbox, gsl, gtk+ 2.0, gtkmm 2.4, ice, jderobotice, jderobotinterfaces, jderobotutil, libglademm 2.4, opencv, progeo Debian Wheezy NO
introrob colorspaces, gearbox, gthread 2.0, gtk+ 2.0, gtkgl 2.0, gtkglextmm 1.2, gtkmm 2.4. gsl, ice, jderobotice, jderobotinterfaces, jderobotutil, libglademm 2.4, libgnomecanvas 2.0, libgnomecanvasmm 2.6, opencv, pioneer, progeo Debian Wheezy (+independent) Introrob
introrob_qt colorspaces, gearbox, ice, jderobotice, jderobotinterfaces, jderobotutil,opencv, pioneer, progeo, qt Debian Wheezy (+independent) Introrob
motiondetection (same as alarmgenerator) + gtk+, gtkgl, gsl, jderobotice, motiondetection, jderobotutil, colorspaces, gearbox, fireware, pcl, player, xerces NO
mobileTeleoperator Mobile Teleoperator
naooperator colorspaces, gearbox, gtkmm 2.4, ice, jderobotice, jderobotinterfaces, libglademm 2.4, opencv Debian Wheezy NO
opencvdemo colorspaces, gearbox, gtk 2.0, gtkgl 2.0, gtkmm 2.4, ice, jderobotice, jderobotinterfaces, jderobotutil, libglademm 2.4, opencv Ubuntu 10.04 / Debian Wheezy OpencvDemo
recorder cminpack 1, colorspaces, eigen3, gearbox, gsl, ice, jderobotice, jderobotinterfaces, jderobotutil, libusb 1.0, opencv, pcl, pioneer, progeo, vtk Debian Wheezy (+independent) Recorder
replayer colorspaces, eigen3, gearbox, gsl, ice, jderobotice, jderobotinterfaces, jderobotutil, opencv, pcl Debian Wheezy (+independent) Replayer
teleoperatorPC colorspaces, gearbox, gthread 2.0, gtk 2.0, gtkmm 2.4, ice, jderobotice, jderobotinterfaces, jderobotutil, opencv Debian Wheezy TeleoperatorPC
wiimoteClient gearbox, gthread, gtk 2.0, gtkgl 2.0, gtkglextmm 1.2, gtkmm 2.4, ice, jderobotice, jderobotinterfaces, jderobotutil, libglademm 2.4, libgnomecanvas 2.0, libgnomecanvasmm 2.6, opencv Debian Wheezy WiimoteClient
VisualHFSM gdk, gdk-pixbuf, gtk 2.0, gtk+ unix print 2.0, gtksourceview 2.0, libglade 2.0, libgnomecanvas 2.0, libxml 2 Debian Wheezy VisualHFSM

Installing JDErobot 5.1 on Linux Ubuntu 12.04 LTS x86 and Debian Wheezy x86 with .deb packages

If you have an Ubuntu 12.04 or Debian Wheezy, both of them of 32 bits, you can install it directly from packages. Otherwise, you have to install jderobot 5.1 in a manual way.

On Ubuntu 12.04 Precise Pangolin

  • Edit your jderobot.list file
sudo nano /etc/apt/sources.list.d/jderobot.list
  • Inside your jderobot.list, write
deb http://jderobot.org/apt/ precise jderobot
  • Save your file
  • Update your repositories
sudo apt-get update
  • And that's it! Now you can install jderobot-teaching package
sudo apt-get install jderobot-teaching 

On Debian Wheezy

  • Edit your jderobot.list file
sudo nano /etc/apt/sources.list.d/jderobot.list
  • Inside your jderobot.list, write
deb http://jderobot.org/apt/ wheezy jderobot
  • Save your file
  • Download and add the authentication key
wget http://jderobot.org/apt/jderobot.asc
sudo apt-key add jderobot.asc
  • Update your repositories
sudo apt-get update
  • And that's it! Now you can install jderobot-teaching package
sudo apt-get install jderobot-teaching

JDErobot Dependencies

This alternative is most appropriate for experienced users.

Installing previous recommended libraries

Some extra libraries are required to compile, link or run JDErobot 5.0. Just type the following "aptitude install" commands:

Basic libraries:

sudo aptitude install build-essential libtool cmake g++ gcc

OpenGL libraries:

sudo aptitude install libglut3 libglut3-dev freeglut3 freeglut3-dev glutg3-dev libgl1-mesa-dev libglu1-mesa libglut3 libglut3-dev

GTK libraries:

sudo aptitude install libgtk2.0-0 libgtk2.0-bin libgtk2.0-cil libgtk2.0-common libgtk2.0-dev libgtkgl2.0-1 libgtkgl2.0-dev libgtkglext1 libgtkglext1-dev libglademm-2.4-dev
 libgtkmm-2.4-dev libgtkextra-x11-2.0-1 libgtkextra-x11-2.0-dbg libgtkextra-x11-2.0-dev  libgnomecanvas2-dev libgtkglext1 libgtkglext1-dev libgtkglext1-doc

Gazebo-1.X

The Gazebo 3D robot simulator was a component in the Player Project from 2004 through 2011. Gazebo is a multi-robot simulator for outdoor environments, integrated the ODE physics engine, OpenGL rendering, and support code for sensor simulation and actuator control. In 2011, Gazebo became an independent project support by Willow Garage.

Gazebo was originally designed to aid in the development process of algorithms for robotic platforms. By realistically simulating robots and environments code designed to operate a physical robot can be executed on an artificial version. This helps to avoid common problems associated with hardware such as short battery life, hardware failures, and unexpected and dangerous behaviors. It is also much faster to spin up a simulation engine than continually run code on robot, especially when the simulation engine can run faster than real-time.

The physics, sensor, and rendering libraries will support plugins. These plugins will provide users with access to the respective libraries without using the communication system.

Installing Gazebo

Depending on the version you have downloaded of Gazebo, you will need to follow a few steps or other. Please, pay attention reading them. They are detailed in the following links:

Now try running gazebo:

gazebo

Or you can launch it with a world specially prepared for jderobot:

gazebo /usr/local/share/gazebo-jderobot/plugins/pioneer2dxJde/pioneer2dxJde.world

If you need more information about the installation process or something related with Gazebo simulator, please visit this page.

Stage 4.0.0

Stage simulates a population of mobile robots moving in and sensing a two-dimensional bitmapped environment. Various sensor models are provided, including sonar, scanning laser rangefinder, pan-tilt-zoom camera with color blob detection and odometry.

Now is posible to simulate robot with the last version of Stage. The sintax of the configuration file is the same.

To install stage 4.0.0


cd Player-4.0.0
mkdir build
cd build
cmake ..
make
sudo make install

Player 3.2.2

Player provides a network interface to a variety of robot and sensor hardware. Player's client/server model allows robot control programs to be written in any programming language and to run on any computer with a network connection to the robot. Player supports multiple concurrent client connections to devices, creating new possibilities for distributed and collaborative sensing and control.

Now is posible to use the last version of Player.


cd Player-3-2-2
mkdir build
cd build
cmake ..
make
sudo make install

Gazebo 1.0 allow to control the robot with Player using the tools playerv.

For example, if you simulate Pioneer in gazebo with a similarconfiguration file:


   <?xml version="1.0"?>

    <gazebo version="1.0">

      <world name="default">

        <!-- Ground -->

        <include filename="ground_plane.model"/>

        <!-- Pioneer2dx model -->

        <include filename="pioneer2dx.model"/>

        <!-- A global light source -->

        <include filename="sun.light"/>

      </world>

    </gazebo>

Ad Player with this:

  driver

    (

      name "gazebo"

      provides ["simulation:0"]

      plugin "libgazebo_player"

      # The name of a runnign Gazebo world, specified in a .world file

      world_name "default"

    )
 
    driver

    (

      name "gazebo"

      provides ["position2d:0"]

      # This name must match the name of a model in the "default" world

      model_name "pioneer2dx"

    )

Run the Gazebo server

    
gzserver position.world 

Run Gazebo GUI

    gzclient 

Run Player

    player position.cfg 

Run playerv

    playerv 

Now subscribe playerv with the encoders or the laser and start to move the robot or show the data from the sensor.

ICE Documentation

Installing GStreamer development framework

GStreamer is a streaming media framework, based on graphs of filters which operate on media data. Applications using this library can do anything from real-time sound processing to playing videos, and just about anything else media-related. Its plugin-based architecture means that new data types or processing capabilities can be added simply by installing new plug-ins.

This framework is used for Camera component interface impletentations. JDErobot 5.0 Components, such us cameraserver requieres this libraries and development packages.

First, install libgstreamer0.10-dev package for developing environment.

>$ sudo apt-get install libgstreamer0.10-dev libgstreamer-plugins-base0.10-dev

Installing GearBox development package

GearBox has to be also installed. At the moment of this documentation, there isn't a Debian package yet. Installation instructions can be read at http://gearbox.sourceforge.net/gbx_doc_getting.html

  • Install CMake software:
sudo apt-get install cmake
  • Follow the rest of configuration, compilation and installation steps for Debian/Ubuntu [1]

Include GearBox libraries path to LD_LIBRARY_PATH environment variable. It'll be required for later references during compilation. Type or include to $HOME/.profile, the following line:

echo "export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib/gearbox/" >> ${HOME}/.profile && . ${HOME}/.profile

It's possible to make it avaible system wide using the following two lines (ubuntu way, as user):

 $ echo "/usr/local/lib/gearbox/" | sudo tee /etc/ld.so.conf.d/gearbox.conf && sudo ldconfig

Or (debian way, as root):

 # echo "/usr/local/lib/gearbox/" > /etc/ld.so.conf.d/gearbox.conf && ldconfig

When you are compiling gearbox if you have problem with "libboost_python-mt.so" or "libboost_python-mt.a" you can create the next simbolic link:

 $ sudo ln -s /usr/lib/libboost_python.so /usr/lib/libboost_python-mt.so
 $ sudo ln -s /usr/lib/libboost_python.a /usr/lib/libboost_python-mt.a

Point cloud library

The PCL framework contains numerous state-of-the art algorithms including filtering, feature estimation, surface reconstruction, registration, model fitting and segmentation, as well as higher level tools for performing mapping and object recognition.

To instal pcl in Ubuntu distribution, type this in a terminal:

sudo add-apt-repository ppa:v-launchpad-jochen-sprickerhof-de/pcl
sudo apt-get update
sudo apt-get install libpcl-all

To install pcl in others Linux distributions, visit the official PCL's Downloads page for Linux.

Installing OpenCV

Building JDErobot 5.0 with CMake

What is CMake?

CMake is an open-source build system designed to build, test and package software. This tool is used to control the software compilation process using simple platform and compiler independent configuration files. To do this, CMake generates native makefiles (which we can invoke with "make") that can be used in the compiler environment of your choice.

How do I use CMake?

CMake uses "CMakeLists.txt" as configuration files. There are two "CMakeLists.txt" types:

+ the "main", where you need to define the project name and cmake version.

+ the "forks", allocated in subdirectories and invoked by the "main".

In the "main" CMakeLists.txt is usually defined global variables and other dependencies rules while in "fork" files are defined particular rules to compile particular sources.

CMake & JDErobot

To understand how CMake works, the next image shows the JDErobot directories structure:

NOTE: some directories have been ignored because they are not important to understand CMake.

First of all, is needed to know that JDErobot can be built in two different ways:

1. From "trunk/build": This way is used to genereate ALL components, libraries and interfaces contained in JDErobot.

2. By components: If you don't want to build ALL components, because you only need one component, you can choose this way.

[1] FROM trunk/build

To build JDErobot we just have to go to "/trunk/build" directory and enter:

cd trunk/build
cmake ..

With this, CMake will be launched and will search all dependencies needed to build components, libraries and interfaces. If some dependency is not installed in your pc, CMake will show an info message with this dependency in order to help you to know what library you need install.

If all is correct, CMake will have generated own configuration files (CMakeFiles, CMakeCache.txt, ...) and the next command you have to enter is:

make

Now, the sources files contained in "trunk/src" are compiled and linked in order to create the libraries and executables.

Finally, if you want to install JDErobot in your PC, you can use:

sudo make install

[1] BY COMPONENTS

If you prefer compile only one component, you can do it as easy as the previous way. You have to open the comoponent what you want in "trunk/src/components/componentX/build" and enter:

cmake .

NOTE: The command is the same, but the argument is not because now the "main" CMakeLists.txt is in the "build" directory and when you launch CMake you have to indicate where is the "main" CMakeLists.txt

Then, enter:

make

And finally, if you want to install this component with the interfaces and libraries that it needed:

sudo make install

When the component is ready to use, and the libraries and interfaces have been created, if we want to compile other component that uses same libraries o same interfaces, these interfaces or libraries are not compiled again because CMake has been implemented to know when the library has been generated previously. This is very usefull to save your time if you want to compile several components.

Interfaces

Drivers

Tools

Libs

Programming a component for JDErobot 5.0

Programming style

JDErobot code is documented using doxygen. You can find more information here.

Cmake for developers

Running JDErobot

Personal tools