Tuesday 7 December 2010

DABBLING WITH THE I-BOT

I-BOT@BIT RANCHI

At BIT, Ranchi there are 11 I-Bot Robot.
 

These robots are made by triindia and build on a Philips 8051 microcontroller. However much to my annoyance, each robot is merely equipped with 2 sets of light sensors and can only be used for very simple experiments (viz.obstacle avoidance and line following).


The programming is done in C


These experiments are often included as a introductory robotics lab for postgraduate engineering students. 



Monday 1 November 2010

2 CARTOONS

2 CARTOONS 
 
I came across 2 cartoons while documenting various different algorithms for mobile robot path planning. Both these cartoons makes an agile researcher of this field squint and follow it up with a smirk (or script a LOL !) .

The first one is from willowgarage .
While the second one is from Arkin's book .
Both these cartoons succinctly illustrate the issues in the 'apparently simple' philosophy of path planning.

Thursday 19 August 2010

MAPS AFTER VACATION

MAPS AFTER VACATION

Back from vacation and time to pick were my work was left off ..

Using player log to create a map ..... never knew that player/stage comes with inbuilt utility pmap utility.

on running the command $pmaptest -g
"logname" -g non gui mode  

this produces a pretty neat map make sure pmaptest is built and linked and give a log file ... there are other options too 


I used writelog driver to generate the log

driver

(
name "writelog"
log_directory "/home/iis-tainee/Downloads/logs"
basename "mydata"
requires ["laser:0" "position2d:0"]
provides ["log:0"]
alwayson 1
autorecord 1
)

Monday 16 August 2010

WALL-E & EVA - 2.0

WALL-E & EVA - 2.0 

If robots could have romantic mushy chit-chat, how would it be ? The idea is given a comical angle with a python script utilising the random module and the time module.

A script which gives output as the following, 









and on other times as,







.... still other occasions,





Guess romance has its own odds !

Many thanks Luke, this mushy program works nice ! 

The Python script is available here.

Saturday 24 July 2010

WALL-E LOOKS FOR EVA

SPEECH IN PLAYER-STAGE 

We had met WALL-E@PLAYER-STAGE earlier this month. Now, WALL-E looks for EVA as he roams around.
Using the speech.cc file found in player installation files at player-3.0.0/examples/libplayerc++/speech.cc, modifying that file so slightly !

Using this script while WALL-E is set to 'wander' (Stage Controller) creates a fair animation, nicely combining the 2 behaviours; wandering and speech.







Lets hope WALL-E meets EVA soon ! :)

Monday 5 July 2010

WALL-E

WALL-E@PLAYER-STAGE

While going through the stage installations files, I found a walle include file at Stage-3.2.0-Source/worlds/walle.inc.

Marrying walle.inc file with the 'usual'
simple.world, simple.cfg and sick.inc files I got wall-e to move around in the 'caves' environment !





Somehow this appealed to the child in me ! :) 


The following video is by talk2aswin;



Thursday 27 May 2010

MULTIPLE SENSORS FOR A MOBILE ROBOT

SUBSUMPTION ARCHITECTURE

In a seminal paper in AI which introduced a the paradigm of 'Subsumption Architecture', 'Robust Layered Control System for a Mobile Robot' by Rodney Brooks; Brooks argues that a mobile robot should be equipped with multiple sensors as that adds to the robustness of the control of the robot. The robot can respond efficiently to a dynamic environment thus the behaviours are apparently more 'smoother'.

Fig.1 Control schematics for multiple sensors, from Brooks
To come up with examples to illustrate Brook's theory led me to this simple experiment in Player-Stage.

I. A robot with sonars, STUCK !



II. Introducing lasers, VOILA it is unstuck and on its way





WHAT IS HAPPENING ? 

Here the simulation starts off with a robot equipped with long-ranged sonars, the robot is stuck.

 
Introducing a short-ranged laser (SICK LASER) unstuck the robot.

Obviously, other solutions can be by modifying the code (sonarobstacleavoid.cc) or changing the geometry of the placement of the sonars. However, the idea of this demonstration is to illustrate the robustness gained by the use of two sensors.

REFERENCES
(2) 6 Architectures

Saturday 15 May 2010

PLAYER STAGE: PLAYERV

PLAYERV  
playerv is a GUI tool in stage which enables to the field of view of the robot.


 
Playerv is to be used when player stage is operating, however a different terminal window has to be used.





Monday 3 May 2010

PLAYER STAGE : HELLO WORLD

Every programming paradigm has a 'Hello World' program. I try out something similar in Player-Stage and in process acquaint myself with various newer aspects of Player-Stage. After trying out player simple.cfg to check out Player-Stage installation, here I try to understand the involved working principles.

'HELLO WORLD'

Files needed to create the hello world (copied from Stage-3.2.0-Source/worlds and modified) are;
These 6 files contains information and configuration of the simulation.

1. cave.png 

This file contains the 'picture' of the environment.


2. map.inc

This file contains a floor plan and is included (.inc file) in simple.world.

3. pioneer.inc

This file contains the information about the robot model, the geometry, wheels etc of the robot. This file is included in simple.world

4. sick.inc

This file contains SICK LMS 200 configurations, factory settings and geometry. This file is included in simple.world



5. simple.cfg

The configuration (.cfg) file tells the player that there is a driver called stage in stageplugin library. This file enables player to 'talk' to the driver.


For real robots the drivers are build into player, for a simulation the driver is always stage.

6. simple.world

It contains the environment details,


and also the robot coordinates and robot behaviour


The 'pose' is the robot coordinates (x,y,z) and the heading angle (also called yaw). 'wander' is the default behaviour (this is new plugin API to Stage, earlier versions did not have it).


Any robot (or autonomous vehicle) navigation can be defined completely by the 3 coordinates and the heading a angle.




ON RUNNING THE SIMULATION 

Before the screen with the little red robot pops up, loads of command flashes across the terminal window.




2 important aspects ;

(a) wander
the wander is the default behaviour, via the simple.world file. There are other Stage controllers which can be used to obtain other behaviours and informations.

(b) port 6665
port 6665 is the default port for Player and Stage.Player and Stage communicate through this port.

Tuesday 13 April 2010

SNAIL : MY FIRST ROBOT

MY FIRST ROBOT 

My first robot got made not due to a sense of creativity, but rather for securing good grades. SNAIL, my first robot was the first part of Group Design Project at King's College London and it got made in Nov-Dec 2007. It was a simple line follower which was made from LEGO Mindstorms RCX 1.0 & Robotics Invention System software.

Fig 1. SNAIL

SNAIL was not quiet the snail when it came to speed ! and could complete a square of 100 cm (25cm x 4) in 4-5 seconds.
Fig 2. SNAIL'S flowchart

It would be unfair not to mention my group and people who made it happen. Rest of my team mates were, Boubacar Barry (Abu), Aparajithan Sivanathan (Siva), Vasileios Lahanas (Vaz) and Preetanat Kewcharoenwong (Kang).

Monday 29 March 2010

INSTALLING PLAYER-STAGE : WHAT WORKED FOR ME


PLAYER/STAGE INSTALLATION GUIDE ON UBUNTU 9.04, 10.04 LTS AND 12.04 LTS



















Player-Stage or as it is now know, Player Project is a very versatile software for robot simulation and hardware control interface. It primarily uses FLTK and OpenGL.

After trying various means and hopelessly failing, I successfully installed Player-Stage in Ubuntu 9.04 (and much later also on Ubuntu 10.04 - scroll down for that).

The following is a succinct of my efforts. 

INSTALLING PLAYER/STAGE IN UBUNTU 9.04 AND UBUNTU 10.04 LTS

The post primarily deals with installation in Ubuntu 9.04, for installation in Ubuntu 10.04 LTS and 12.04 LTS scroll down, close to the end of this post.  

THE INSTALLATION : IN 8 SIMPLE STEPS

#1.Update Ubuntu

A fresh installation of the OS (Ubuntu 9.04 ) is preferred.

Update Ubuntu 9.04 completely using sudo apt-get update and sudo apt-get upgrade. (Do not do a distribution update to Ubuntu 9.10 or higher)

#2.Install the dependencies

Dependencies for installation in Ubuntu 9.04;

sudo apt-get install autotools-dev build-essential cmake cpp libboost-signals1.35.0 libboost-signals1.35-dev libboost-thread1.35.0 libboost-thread1.35-dev libcv1 libcv-dev libgdk-pixbuf2 libgdk-pixbuf-dev libgnomecanvas2-0 libgnomecanvas2-dev libgsl0-dev libgtk2.0-dev libjpeg62-dev libtool libxmu-dev swig
freeglut3 freeglut3-dev libfltk1.1 libfltk1.1-dev libltdl7 libltdl7-dev libpng12-0-dev libpng12-0

Make sure all these packages (or any alternative packages (hardly one or two) offered by Ubuntu 9.04 repositories, i.e. in case If libpng12-dev or any such package is not installed by apt-get, then install it manually) are installed. Run the above commands 2 to 3 times to confirm that these packages are indeed installed.

#3.Download the sources

Download Player-3.0.0 and Stage-3.2.0-Source and extract the files. Restart the computer for dependencies to come to effect.

#4.Configure and install player and stage in the $usr/local directory

Do not try to install Stage before installing Player. Stage installation script 'looks for' player installation

Installing Player

execute each of these commands (5 in total) one at a time in the same order as shown

cd player-3.0.0

mkdir build

cd build

cmake ../

make
sudo make install

Installing Stage

An Error in Stage files : Before installation, there is an error in Stage files that should be corrected,
in the source code in the file Stage-3.2.0-Source/libstageplugin/p_driver.cc closer to the end of the file, Change the line : "world->Update();" to "Fl::wait();" . This error has been rectified in later versions of Stage (i.e. Stage-3.2.2 etc).

Now install, much like Player,
execute each of these commands (4 in total) one at a time in the same order as shown.

cd Stage-3.2.0-Source

mkdir build
cd build

cmake ../

make
sudo make install

#5.Confirming the installation

#6.Setting the 'PATH'

In the 'home' folder enable 'show hidden files' and locate the .bashrc file.

At the end of the .bashrc file append the following.
PATH=$PATH:/usr/local/bin
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib
PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig
export PATH
export LD_LIBRARY_PATH
export PKG_CONFIG_PATH

Then run the command source ~/.bashrc from the terminal, restart the computer

#7. Check !  

In the Stage installation files

cd Stage-3.2.0-Source/worlds

Start the simulation with,  player simple.cfg

If the following screen with a little red robot, pops up then everything is set up nicely !

#8. Check for compilation

In Player installation files, cd player-3.0.0/examples/libplayerc++ 

compilation command for sonarobstacleavoid.cc

g++ -o laserobstacleavoid `pkg-config --cflags playerc++` laserobstacleavoid.cc `pkg-config --libs playerc++` 

If it compiles without any errors then all is good ! .....


SMORGASBORD FOR PLAYER-STAGE

(i) 2.5 Dimension

To see your robot do a 2.5 Dimension, press 'R' (Perspective Camera) while the 2 Dimensional simulation is on !


(ii) Command line check for version

Simple command lines, to confirm the versions of Player and Stage;

(iii) robot-player from ubuntu repositories

In Ubuntu 10.04, one can install robot-player (sudo apt-get install robot-player) from the repositories and the package has been updated for recent versions of Ubuntu, however I faced C++ compilation issues with it.

(iv) Working with a virtual OS

If you are working in a virtual box virtual machine then there may be issues in controlling the robot hardware as hardware layer abstraction is not fully supported. However, simulation in stage is fine.

If you are working on Virtual Box then do Install Guest Additions (This will help to maximise the screen and seamlessly integrate the guest OS with host OS).

(v) 'flickering' in Stage

If Stage starts to flicker too much, then put the 'Visual Effects' in Ubuntu 9.04 to None.


(vi) Recording a video of the simulation


If required, the simulation may be recorded as a video using tools as Record MyDesktop, and then converting the ogg files to to to avi using MEncoder .

(vii) Mailing list and support 



As Player-Stage newbie, one may consider joining the official mailing list and/or the facebook page. 

(viii) Any other success story ? 

This installation also works with Player-3.0.1 and Stage-3.2.0.

I recently tried an overwrite of the player with the latest svn, revision 8767 (3.1.0-svn) and that worked.

However, do not try an overwrite of Stage. 

(ix) Gazebo installation

I have got a few enquiries about Gazebo ! .... and here is my response ! 

I could not install Gazebo, few attempts with version 0.10.0 conflicted with my Stage installation.

I installed ROS in order to work with Gazebo (version 0.9.0). ROS is a another Robotics suite and it uses Stage, Gazebo and a host of other softwares. However the working and command structure are much different from that of Player-Stage.

ROS is a way to use Gazebo without the hassles of bindings etc. A word of advice, ROS recommends Ubuntu 9.10 for installation. So this installation (recommended for Ubuntu 9.04) of Player-Stage may not work in tandem with ROS.

 
In Ubuntu 10.04 LTS, ROS can be installed side by side with Player/Stage without any issues of conflict etc.


For more on ROS and Gazebo - see my article on using gazebo.
 
(x) New drivers

For the adventurous coders, who plans to design new player drivers - have a look at these tutorials,




(xi) New home for the project at github

The project has found a new home at github. Stage 4.0.0 was released on 26 November 2010.


It is worth noting that Stage 4.X.X has back compatibility issues with Stage 3.X.X. Have a look at, Moving from Stage 3 to Stage 4: laser and ranger .

(xii) Installation on Ubuntu 10.04 LTS 

I was able to install Player-3.02 and Stage-3.2.2 on Ubuntu 10.04 LTS, I used the following tutorials;

#. Tutorial 1 - in German

#. Tutorial 2 - more suited to Ubuntu 10.10, but some tips well apply to Ubuntu 10.04

#. Tutorial 3 
 



The major change from installation in 9.04 is the dependencies; rest of the installation is same as that for 9.04.
Dependencies for installation in Ubuntu 10.04;

sudo apt-get install autotools-dev build-essential cmake cpp libboost-python1.40.0 libboost-python1.40-dev libboost-thread-dev libboost-signals1.40.0 libboost-signals1.40-dev libcv4 libcv-dev libgdk-pixbuf2-ruby libhighgui-dev libgnomecanvas2-0 libgnomecanvas2-dev  libgsl0ldbl libgsl0-dev libjpeg62-dev libtool libxmu-dev swig freeglut3 freeglut3-dev libfltk1.1 libfltk1.1-dev libgtk2.0-dev libltdl7 libltdl7-dev libpng12-0 libpng12-dev libcvaux4 libcvaux-dev libltdl-dev libguile-ltdl-1 fluid glutg3-dev freeglut3 freeglut3-dev libart-2.0-2 libatk1.0-0 libboost-thread1.40.0 libboost-thread1.40-dev libc6 libcairo2 libcv4 libcv-dev libcvaux4 libfontconfig1 libfreetype6 libgcc1 libgl1-mesa-glx libglib2.0-0 libglu1-mesa libglu1 libgnomecanvas2-0 libgsl0ldbl libgsl0-dev libgtk2.0-0 libhighgui4 libjpeg62 libjpeg62-dev liblodo0 libltdl7 libpango1.0-0 libplayerc++2 libplayerc2 libplayercore2 libplayerdrivers2 libplayererror2 libplayertcp2 libplayerxdr2 libpmap0 libstdc++6 zlib1g libxmu-dev


(xiii) A vmdk FOR PLAYER/STAGE AND ROS

I have recently made available a vmdk which has Player 3.0.2, Stage 3.2.2 and ROS (Electric) pre-installed.


http://mobotica.blogspot.in/2012/09/a-vmdk-for-ros-electric.html


(xiv) Installation on Ubuntu 12.04

Using Kevin's article I was able to install Player 3.0.2 and Stage 3.2.2 on Ubuntu 12.04 LTS (32 Bit). 


Note for installation in Ubuntu 12.04

Kevin has mentioned that, for installation in Ubuntu 12.04 if Stage compilation gives the following error;

To correct this error you need to make the following changes in 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)

Needs to be changed 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)






 
REFERENCES AND INSTALLATION GUIDES FOR OTHER OS