Some work related to my research ...

Saturday, May 28, 2016

Inverse Kinematics for UR5 Robot Manpulator - C/C++ Codes




If you are looking for C/C++ codes for simulating (Universal Robot) UR5  Robot Manipulator, you can download the codes from this GIT repository.  It contains the codes for the following capabilities:


  • C++ interface: Classes / Objects
  • forward Kinematics, 
  • Inverse Kinematics - Pseudoinverse with null space optimization for joint limit avoidance, Jacobian Transpose method and PD controller for error minimization.
  • Analytic as well as Geometric Jacobian 
  • Few basic codes for Visual servoing.  
  • This code is integrated with GNUPLOT to directly plot the outputs.  For the code to work, you also need to download this gnuplot interface.   
  • Maxima source code for symbolic computation of various equations.

Some of the the screenshots of the plots generated by the codes are shown below:


 





Wednesday, July 24, 2013

Robot Versus Machine

People keep asking me this question all the time. Let me ask it here myself "What is the difference between a robot and a machine?"

At least we all know that a robot is definitely a machine but what is it that differentiates it from other machines?

I am sure there will be many answers to this questions and many of them would be better than the answer that I am going to give here. But in my opinion, a robot is a machine that exhibits certain aspect of sentient behaviour. Let me explain this.  When I say "sentient behaviour", I include the ability to make mistakes as well. So repeatability is not necessarily an important attribute of a robot. So while calculator is a machine it does not manifest any aspect of human behaviour, apart from the ability to compute with higher accuracy. 

Well it is very difficult to draw a very sharp line between a robot and a machine. But it is the behaviour which defines whether a machine is a robot or not. For instance, a camera in itself is a machine but a camera with a built-in face recognition algorithm may be considered as a robot. While machines are the extension of human faculties, robots exhibit behaviours.

To summarize, a machine may be called a robot if it has the following important attributes:
  1. Autonomy: Ability to take decisions without human interference. 
  2. Adaptibility: Ability to adapt to changes in the environment. 
  3. Learning: It should be able to learn on its own and hence its behaviour should improve over time. 
  4. Interact: Interact with other beings and with the environment. 
 These abilities may be available with a varying degree in different machines. In this aspect, we may safely say that a calculator is a simple machine and so is a motor cycle. However, a google car with autonomous navigation ability is a  robot and so is the roomba vacuum cleaner which can the clean the house on its own.


Monday, March 11, 2013

Stageros + roscpp + controlling robot through a C++ program


The objective is to control a simulated robot within the stage environment. This will help us in writing our own control algorithms for controlling the simulated robot. Please follow the steps given below:
#1 Follow the instructions on this page. This package demonstrates how one can run a stage simulation through stageros. Basically tells you to download the package stage_controllers.tar.gz and compile and build the package within a folder where ROS can find it.
$ rosmake stage_controllers
$ rospack find stage_controllers
$ rosrun stage stageros `rospack find stage_controllers`/world/roomba-wander.world
You should be able to see a robot moving around in a stage environment as shown in the picture.
#2 Now we want to stop this robot moving and write a C++ program to provide the necessary motion command.  In order to achieve this, open the file ‘/world/roomba-wander.world’ inside the stage_controllers folder and comment out the line that contains the word “wander” as shown below:
roomba
(              
  # can refer to the robot by this name
  name "roomba"
  pose [ -8 6 0 0 ]
  sicklaser()
#ctrl "wander"
)
If you now execute the above commands you will see a stationary robot within the stage environment. Now we need to write a C++ program to get the robot moving again.
#3 Create a file ‘robctrl.cpp’ inside ‘stage_controllers/src/’ folder that contains the following piece of code:

#include "ros/ros.h"
#include "std_msgs/String.h"
#include "geometry_msgs/Twist.h"
#include
int main(int argc, char **argv)
{
  ros::init(argc, argv, "RobCtrl");
  ros::NodeHandle n;
  ros::Publisher cmd_pub = n.advertise("cmd_vel",1);
  geometry_msgs::Twist cmd_msg;
  ros::Rate cycle(10.0);
  //Specify the velocity
  cmd_msg.linear.x = 0.1;
  cmd_msg.linear.y = 0;
  cmd_msg.linear.z = 0;
  cmd_msg.angular.x = 0;
  cmd_msg.angular.y = 0;
  cmd_msg.angular.z = 0.2;
  while(ros::ok())
  {
        cmd_pub.publish(cmd_msg);
        cycle.sleep();
  }
  return 0;
}


#4 Edit the stage_controllers/manifest.xml to reflect dependency on stage package.












#5 Add the following line to the end of the ‘CMakeLists.txt’ file
rosbuild_add_executable(stage_controllers src/robctrl.cpp)
#6 Build
$ rosmake stage_controllers stage_controllers
# Execute
$ roscore (on one window)
$ rosrun stage stageros `rospack find stage_controllers`/world/roomba-wander.world (on another window)
$ rosrun stage_controllers stage_controllers
You should see the robot rotating in a circle within the stage environment.
This program publishes the velocity values to the topic ‘/cmd_vel’. To know about the available topics where the data could be published, use ‘rostopic’ and ‘rxgraph’ command.
$ rostopic list -v
Published topics:
 * /base_scan [sensor_msgs/LaserScan] 1 publisher
 * /rosout [rosgraph_msgs/Log] 2 publishers
 * /tf [tf/tfMessage] 1 publisher
 * /clock [rosgraph_msgs/Clock] 1 publisher
 * /odom [nav_msgs/Odometry] 1 publisher
 * /rosout_agg [rosgraph_msgs/Log] 1 publisher
 * /cmd_vel [geometry_msgs/Twist] 1 publisher
 * /base_pose_ground_truth [nav_msgs/Odometry] 1 publisher
Subscribed topics:
 * /clock [rosgraph_msgs/Clock] 2 subscribers
 * /rosout [rosgraph_msgs/Log] 1 subscriber
 * /cmd_vel [geometry_msgs/Twist] 1 subscriber
$ rxgraph


ROSCPP + OpenCV Program


Basically, here I am demonstrating how you can start writing your own program with ROS.
Create ROS package. Follow the tutorial link here. I am assuming that ros_workspace folder is added into ROS_PACKAGE_PATH
$ cd ~/ros_workspace
$ roscreate-pkg tbsimctrl std_msgs roscpp opencv2 sensor_msgs cv_bridge image_transport
You may not all the dependencies mentioned above.
$ cd tbsimctrl
$ rospack profile
$ rospack find tbsimctrl
/home/turtlebot/ros_workspace/tbsimctrl
Now create a file “camera_test.cpp” under src folder. The file contains the following piece of code:

#include
#include    //may not be needed
#include  //may not be needed
#include  //may not be needed
#include
#include
#include
#include
using namespace std;
using namespace cv;
int main(int argc, char **argv)
{
  ros::init(argc, argv, "captureimg");
  ros::NodeHandle n;

  CvCapture* capture = cvCaptureFromCAM(-1);
  cvSetCaptureProperty(capture, CV_CAP_PROP_FRAME_WIDTH, 320);
  cvSetCaptureProperty(capture, CV_CAP_PROP_FRAME_HEIGHT, 240);
  IplImage *img = 0;
  img = cvQueryFrame(capture);
  int frameH = (int) cvGetCaptureProperty(capture, CV_CAP_PROP_FRAME_HEIGHT);
  int frameW = (int) cvGetCaptureProperty(capture, CV_CAP_PROP_FRAME_WIDTH);
  int fps = (int) cvGetCaptureProperty(capture, CV_CAP_PROP_FPS);
  cout << frameW << “\t” << frameH << “\t” << fps << endl;
  cvNamedWindow("Left", CV_WINDOW_AUTOSIZE);
  for(int n = 1; n= 30; n++)
  {
        img = cvQueryFrame(capture);
        cvShowImage("Left", img);  //show frames while capturing
        int c = cvWaitKey(20);               // wait 20 ms
        if(c == 27)
          break;
  }
  cvDestroyWindow( "Left" );
  cvReleaseCapture(&capture);
  return 0;
}

The above program captures video from a webcam. Save the file and insert the following statement inside the CMakeLists.txt file inside the tbsimctrl package folder. 
rosbuild_add_executable(${PROJECT_NAME} src/camera_test.cpp)
Now compile and build the package using rosmake
$ cmake .
$ rosmake
Make sure that the package is built with 0 failures. Once it is done, you can test the code as follows:
$ rosrun tbsimctrl tbsimctrl
You should be able to see the video from your webcam.



Monday, November 26, 2012

Robotics for HealthCare (R4H)

Robots are needed in healthcare to enhance quality, accessibility and efficiency of healthcare and making them more personalized and affordable for people. Use of Robots in health care is still limited due to several technological challenges involved. Some of the key innovation areas in this field are follows:

- Smart medical Capsules: micro or nano-robots in a capsule that can travel through the body parts carrying out highly precise and localized drug delivery or operations thereby minimizing the risks and increasing the success rates. No working prototype is available so far. People are looking into an application where nanorobots could be used for precision eye surgery. 

- Robotised surgery: Attributes of good surgery like precision, accuracy and repeatability could be enhanced by using robots and automating the surgical process. It is now possible to have a system that can facilitate minimally invasive surgery, remote tele-surgery, preoperative planning, surgical training, intra-operative navigation (image-guided surgery) and surgical simulation all from one place. One such example is "Da Vinci Surgical Robot" from Intuitive Surgical Systems (http://en.wikipedia.org/wiki/Da_Vinci_Surgical_System) , http://www.intuitivesurgical.com/products/davinci_surgical_system/ . 

-Intelligent Prosthetics: Advance control systems and mechatronics could be used for building artificial limbs which could be controlled through brain or the nervous system. It would be possible in future to regain full functionality with artificial limbs. One such example is "C-Leg" from Otto Bock Corporation (http://www.ottobockus.com/), (http://en.wikipedia.org/wiki/Otto_Bock). 

- Robotised Motor Coordination Analysis and Therapy: Robots could be used for providing physical therapy in the treatment of patients with traumatised motor control, for example following stroke. These robots could be programmed to provide different kinds of physical therapies which can improve the restoration of central motor coordination of the nervous system. One such example is the Lokomat System from Hocoma (http://www.hocoma.com/products/lokomat/).

- Robot assisted mental, cognitive and social therapy: Robots could be used for increasing the social interaction of people with mental, social or cognitive handicap (autistic children and elders with dementia) by enhancing their social skills through therapeutic exercises. The robots could be programmed to generative communicative reactions, participate in playing games or stimulate friendly face expressions. One such system is Kaspar (http://kaspar.herts.ac.uk/). There is a research group at University of Delaware which looks into developing robots that can be used for rehabilitating infants with disabled mobility. http://www.udel.edu/research/media/babiesrobots.html 

- Robotised patient monitoring system: There is a great need for robots which not only helps the elder people to carry out daily routines but also keeps monitoring the vitals of the patients. It can assist the person in walking, providing support in sitting, sleeping or getting up from bed, May assist in fetching things and can also interact through speech or vision. It can identify urgency situations and can inform nearby hospital. The doctors can also communicate with this robot remotely to collect or analyse the stored patient data etc. One example of such systems is Care-o-robot from Fraunhofer IPA (http://www.ros.org/wiki/Robots/Care-O-bot) (http://www.care-o-bot.de/english/). 


Reference: 
http://ec.europa.eu/information_society/activities/health/docs/studies/robotics_healthcare/robotics-in-healthcare.pdf
 

Thursday, October 11, 2012

Player/Stage on Ubuntu 12.04 LTS 64-bit

Player Installation: 

The instructions given on this link worked for me with some changes.Install the necessary dependencies:

$ sudo apt-get install linux-headers-generic autotools-dev build-essential cmake cpp libboost-signals1.46.1 libboost-signals1.46-dev libboost-thread1.46.1 libboost-thread1.46-dev libcv-dev libgdk-pixbuf2.0-0 libgdk-pixbuf2.0-dev libopencv-features2d-dev libopencv-calib3d-dev libgnomecanvas2-0 libgnomecanvas2-dev libgsl0-dev libgtk2.0-dev libjpeg-dev libtool libxmu-dev swig python2.7-dev libcv-dev libcvaux-dev libhighgui-dev
 
 
Download the source code:
 
$ wget http://sourceforge.net/projects/playerstage/files/Player/3.0.2/player-3.0.2.tar.gz
 
 
Build and install as usual. See this link for more information.  Now set the following two variables:

$ export PKG_CONFIG_PATH=/usr/local/lib64/pkgconfig
 
You may like to put this into your ~/.bashrc file to avoid repeating every time you log into your system.
 

Stage Installation: 
 
Install the dependencies:
 
$ sudo apt-get install freeglut3 freeglut3-dev libfltk1.1 libfltk1.1-dev libltdl7 libltdl-dev libpng12-dev libpng12-0
  
Usual building process should work, this link (same as given in the beginning) tells you to make some changes in the file 'CMakeLists.txt'. 
 

After the installation, you should be able to execute the following command without any error:

$ cd ~/Downloads/Stage-3.2.2-Source/worlds
$ player simple.cfg


You may get error if it fails to find the libstage plugin. Just 'locate' libstage library and add this folder into /etc/ld.so.conf and run 'ldconfig'.

While installing stage, make sure that the cmake command finds the Player Installation. You should be able to run the following command:
 
$ pkg-config playercore --libs 
 
and you should see something like this:
 
-L/usr/local/lib64 -lplayercore -lpthread -lltdl -ldl -lplayerinterface -lplayercommon


Tuesday, May 24, 2011

Player/Stage Not working on Debian Squeeze


Hi all!

I am trying to install Player/Stage on Debian 6.0. I followed the steps given here. I don't get any error during installation. However, I get error when I test it as shown below. If you have any idea to fix this, please do let me know.

-------------------------
$ player simple.cfg
Registering driver
Player v.3.0.2

* Part of the Player/Stage/Gazebo Project [http://playerstage.sourceforge.net].
* Copyright (C) 2000 - 2009 Brian Gerkey, Richard Vaughan, Andrew Howard,
* Nate Koenig, and contributors. Released under the GNU General Public License.
* Player comes with ABSOLUTELY NO WARRANTY.  This is free software, and you
* are welcome to redistribute it under certain conditions; see COPYING
* for details.

invoking player_driver_init()...
 Stage driver plugin init

 ** Stage plugin v3.2.2 **
 * Part of the Player Project [http://playerstage.sourceforge.net]
 * Copyright 2000-2009 Richard Vaughan, Brian Gerkey and contributors.
 * Released under the GNU General Public License v2.

success
 Stage plugin:  6665.simulation.0 is a Stage world*** glibc detected *** player: corrupted double-linked list: 0x0000000000ca2b10 ***
======= Backtrace: =========
/lib/libc.so.6(+0x71ad6)[0x7fee39168ad6]
/lib/libc.so.6(+0x71f4d)[0x7fee39168f4d]
/lib/libc.so.6(+0x74254)[0x7fee3916b254]
/lib/libc.so.6(__libc_malloc+0x70)[0x7fee3916d930]
/usr/lib/libstdc++.so.6(_Znwm+0x1d)[0x7fee399bb6bd]
/usr/local/lib/stageplugin.so(_ZN19InterfaceSimulationC1E14player_devaddrP9StgDriverP10ConfigFilei+0xd5)[0x7fee37cdd735]
/usr/local/lib/stageplugin.so(_ZN9StgDriverC1EP10ConfigFilei+0x279)[0x7fee37cdbaa9]
/usr/local/lib/stageplugin.so(_Z14StgDriver_InitP10ConfigFilei+0x34)[0x7fee37cdbd94]
/usr/local/lib64/libplayercore.so.3.0(_ZN10ConfigFile11ParseDriverEi+0x22c)[0x7fee3b0e9f70]
/usr/local/lib64/libplayercore.so.3.0(_ZN10ConfigFile15ParseAllDriversEv+0x4f)[0x7fee3b0e9d15]
player(main+0x498)[0x40267c]
/lib/libc.so.6(__libc_start_main+0xfd)[0x7fee39115c4d]
player[0x402129]
======= Memory map: ========
00400000-00404000 r-xp 00000000 08:06 222792                             /usr/local/bin/player
00604000-00605000 rw-p 00004000 08:06 222792                             /usr/local/bin/player
00c88000-00ca9000 rw-p 00000000 00:00 0                                  [heap]
7fee2c000000-7fee2c021000 rw-p 00000000 00:00 0
7fee2c021000-7fee30000000 ---p 00000000 00:00 0
7fee33b55000-7fee33b7b000 r-xp 00000000 08:06 212277                     /usr/lib/libexpat.so.1.5.2
7fee33b7b000-7fee33d7b000 ---p 00026000 08:06 212277                     /usr/lib/libexpat.so.1.5.2
7fee33d7b000-7fee33d7d000 rw-p 00026000 08:06 212277                     /usr/lib/libexpat.so.1.5.2
7fee33d7d000-7fee33d86000 r-xp 00000000 08:06 213529                     /usr/lib/libXrender.so.1.3.0
7fee33d86000-7fee33f86000 ---p 00009000 08:06 213529                     /usr/lib/libXrender.so.1.3.0
7fee33f86000-7fee33f87000 rw-p 00009000 08:06 213529                     /usr/lib/libXrender.so.1.3.0
7fee33f87000-7fee3400a000 r-xp 00000000 08:06 213498                     /usr/lib/libfreetype.so.6.6.0
7fee3400a000-7fee34209000 ---p 00083000 08:06 213498                     /usr/lib/libfreetype.so.6.6.0
7fee34209000-7fee3420f000 rw-p 00082000 08:06 213498                     /usr/lib/libfreetype.so.6.6.0
7fee3420f000-7fee34214000 r-xp 00000000 08:06 213517                     /usr/lib/libXdmcp.so.6.0.0
7fee34214000-7fee34413000 ---p 00005000 08:06 213517                     /usr/lib/libXdmcp.so.6.0.0
7fee34413000-7fee34414000 rw-p 00004000 08:06 213517                     /usr/lib/libXdmcp.so.6.0.0
7fee34414000-7fee34416000 r-xp 00000000 08:06 213515                     /usr/lib/libXau.so.6.0.0
7fee34416000-7fee34616000 ---p 00002000 08:06 213515                     /usr/lib/libXau.so.6.0.0
7fee34616000-7fee34617000 rw-p 00002000 08:06 213515                     /usr/lib/libXau.so.6.0.0
7fee34617000-7fee34619000 r-xp 00000000 08:06 213919                     /usr/lib/libXinerama.so.1.0.0
7fee34619000-7fee34818000 ---p 00002000 08:06 213919                     /usr/lib/libXinerama.so.1.0.0
7fee34818000-7fee34819000 rw-p 00001000 08:06 213919                     /usr/lib/libXinerama.so.1.0.0
7fee34819000-7fee3484c000 r-xp 00000000 08:06 213511                     /usr/lib/libfontconfig.so.1.4.4
7fee3484c000-7fee34a4c000 ---p 00033000 08:06 213511                     /usr/lib/libfontconfig.so.1.4.4
7fee34a4c000-7fee34a4e000 rw-p 00033000 08:06 213511                     /usr/lib/libfontconfig.so.1.4.4
7fee34a4e000-7fee34a62000 r-xp 00000000 08:06 213891                     /usr/lib/libXft.so.2.1.13
7fee34a62000-7fee34c61000 ---p 00014000 08:06 213891                     /usr/lib/libXft.so.2.1.13
7fee34c61000-7fee34c62000 rw-p 00013000 08:06 213891                     /usr/lib/libXft.so.2.1.13
7fee34c62000-7fee34c85000 r-xp 00000000 08:06 213831                     /usr/lib/libjpeg.so.62.0.0
7fee34c85000-7fee34e84000 ---p 00023000 08:06 213831                     /usr/lib/libjpeg.so.62.0.0
7fee34e84000-7fee34e85000 rw-p 00022000 08:06 213831                     /usr/lib/libjpeg.so.62.0.0
7fee34e85000-7fee34eaa000 r-xp 00000000 08:06 25872                      /lib/libpng12.so.0.44.0
7fee34eaa000-7fee350aa000 ---p 00025000 08:06 25872                      /lib/libpng12.so.0.44.0
7fee350aa000-7fee350ab000 rw-p 00025000 08:06 25872                      /lib/libpng12.so.0.44.0
7fee350ab000-7fee350c7000 r-xp 00000000 08:06 213519                     /usr/lib/libxcb.so.1.1.0
7fee350c7000-7fee352c6000 ---p 0001c000 08:06 213519                     /usr/lib/libxcb.so.1.1.0
7fee352c6000-7fee352c7000 rw-p 0001b000 08:06 213519                     /usr/lib/libxcb.so.1.1.0
7fee352c7000-7fee352cb000 r-xp 00000000 08:06 24160                      /lib/libuuid.so.1.3.0
7fee352cb000-7fee354ca000 ---p 00004000 08:06 24160                      /lib/libuuid.so.1.3.0
7fee354ca000-7fee354cb000 rw-p 00003000 08:06 24160                      /lib/libuuid.so.1.3.0
7fee354cb000-7fee354d5000 r-xp 00000000 08:06 214122                     /usr/lib/libdrm.so.2.4.0
7fee354d5000-7fee356d5000 ---p 0000a000 08:06 214122                     /usr/lib/libdrm.so.2.4.0
7fee356d5000-7fee356d6000 rw-p 0000a000 08:06 214122                     /usr/lib/libdrm.so.2.4.0
7fee356d6000-7fee356db000 r-xp 00000000 08:06 213909                     /usr/lib/libXfixes.so.3.1.0
7fee356db000-7fee358da000 ---p 00005000 08:06 213909                     /usr/lib/libXfixes.so.3.1.0
7fee358da000-7fee358db000 rw-p 00004000 08:06 213909                     /usr/lib/libXfixes.so.3.1.0
7fee358db000-7fee358dd000 r-xp 00000000 08:06 213915                     /usr/lib/libXdamage.so.1.1.0
7fee358dd000-7fee35adc000 ---p 00002000 08:06 213915                     /usr/lib/libXdamage.so.1.1.0
7fee35adc000-7fee35add000 rw-p 00001000 08:06 213915                     /usr/lib/libXdamage.so.1.1.0
7fee35add000-7fee35ae2000 r-xp 00000000 08:06 214124                     /usr/lib/libXxf86vm.so.1.0.0
7fee35ae2000-7fee35ce1000 ---p 00005000 08:06 214124                     /usr/lib/libXxf86vm.so.1.0.0Aborted

Thursday, March 10, 2011

Ubuntu on Beagleboard XM

Nearly after a year of hiatus, I started my work on robotics once again. I just finished the installation of Ubuntu 10.10 build on Beagleboard XM board. I will upload an image soon to make you believe that I really did it ;-)

I followed the instructions available at this wikipedia site and it worked for me without any hiccups. I collected few information before deciding to go for Ubuntu for Beagleboard. Even though it has a slow graphics compared to Angstrom or Android, Ubuntu is supported by a large repository of packages which makes life easier while installing softwares like opencv.  My next task is to install OpenCV on it.

When you first boot from the SD-Card image, you get a login prompt on the terminal. Use following login information:

login: ubuntu
password: temppwd

After you finish installing the desktop environment (xfce), it again presents you with a login prompt (GUI screen). This time click on the Demo User and type "temppwd" as the password.

One more thing: My ethernet lan port is detected as usb1 rather than eth0. In order to configure your network do the following:

$ sudo dhclient usb1

I think you need to execute this command every time you restart the system.

Monday, April 19, 2010

Testing Latex


\int_{0}^{1}\frac{x^{4}\left(1-x\right)^{4}}{1+x^{2}}dx
=\frac{22}{7}-\pi

Monday, March 8, 2010

My first SBC : RB-100 Vortex86DX

I recently got a single board computer (SBC) called RB-100 with a Vortex86DX from RobotShop. It can operated with a 6V - 24 V battery. I suggest you to get the RoBoard Starter Kit that includes a video card   (Mini PCI - VGA-Z9S) and cables necessary for connecting devices like mouse, keyboard and a monitor.  Video card is necessary for connecting a monitor to the board so that we can monitor the installation processes. Also download various manuals (hardware, software) from above links. The one tutorial which I found extremely useful and the one which worked for me is available here.  In case this link does not work, then try this. You also need to download the modified Debian kernel for Vortex86D processor from this link.  The adjacent image shows the picture of the RB-100 SBC board without a video card and without any peripherals.

The next figure shows the peripherals connected to this board. This includes an USB mouse, an USB keyboard, a terminal, a LAN terminal and a 6V battery. It also shows the graphics card connected to its MINI PCI slot. The complete set up in the last picture below. I hope these pictures give you a feel about how to get started with this SBC. Because, when I started I was confused about how to put things together. I suggest you to go through the hardware manual that is available at RobotShop's site.

Thursday, January 7, 2010

James McLurkin

Sunday, November 1, 2009

My First robot with Arduino


This is my first robot with Arduino Mega boards. The body of the robot is made with the components of RobotDesigner kit (Japan Robotech Ltd.) This includes wheels (motors), IR sensors and the body. Here we use an array of 6 IR sensors to avoid obstacles on its path. Arduino MEGA provides 16 Analog input pins and 13 PWM outputs which can be used to drive motors. We use Toshiba TA7291AP full-bridge driver to drive the dc motors. It can give an output current of 1A and can provide forward and reverse rotations. We use two battery supply for this robot. One for powering the Arduino board and the other one for driving the motors.
The one thing I must mention here is that I could assemble and program the entire thing only because of the help that I received from my labmate Mr. Asuki Kohno, who is a final year under-graduate student in our lab. He is very good at these things.

I recently modified the design. The new one makes use of a caterpillar track that enables it to move over things like wires, cotton, threads and other soft  objects lying on the ground. Putting caterpillar track on to the robot took some time. Its because we are not using an off-the-shelf caterpillar module. That would have saved our time, but these are not readily available. I mean you need to order from abroad. We could get hold of "Tamiya Track kit" to build our own caterpillar system. It costs only $10 to get one such kit. But one has to align the wheels and mount them on his robot properly so that the track does not slip over the wheel etc. A better one with its own frame to house caterpillar track may cost little higher. For instance, RP5 track chassis costs around $50.

Thursday, October 22, 2009

Swarm Robots and Data Mining

My current work is about extracting some "Higher Knowledge" using Data Mining on the log data collect from external sensors like a camera. Before going any further, let me tell you about the kind of robots I am using here.


  1. The price of one robot is around 20K JPY or US$ 200. 
  2. It runs on a 6V battery. It has two motors to control its motion.
  3. It uses only 3 IR sensors to detect obstacles.
  4. There is no way, we can store on-board signals (for instance, IR readings) and analyse it off-line using a computer. 
  5. It does not have any communication capabilities (like wireless, radio or blue tooth) with which it can communicate with other agents or with a central computer.
Hence the controller design completely depends on the designer who 'observes' the robot behaviour during its motion (say using his eyes, or a camera) and then based on his understanding, he modifies the controller to improve its performance  while achieving certain goals.

Now, our purpose is to build a system, where behaviour of several robots are analysed using data mining methods and useful hints are derived which could be used by the designer to improve the controller. The story is like this ...

A designer (a person) writes an algorithm for the swarm robots to perform a task and then goes away at night for sleep. During his absence, robot behaviour is recorded through an external sensory system (say multiple camera system in a building).  An autonomous data mining system (ADMS) analyses these logs and finds out if any robot manifested any kind of anomalous behaviour. It also enumerates the possible causes for such a behaviour and suggests some improvements that could be incorporated to overcome this anomaly. So in the morning, the designer comes back and analyses the results. He either incorporates the suggestion made by the ADMS in improving the controller or rejects its suggestions. 

This sounds more like science fiction at this stage. However, we have just started working on it ... Following video shows the motion of 4 robots which have been programmed to avoid obstacles (walls or other agents) while navigating the workspace. In this task, the robots are to be designed to increase the patrol rate which is the rate at which robot explores the workspace.

Tuesday, October 20, 2009

Making your own Swarm Robot ... where to start.

Many labs in big universities make their own robots. For instance, S-bot (Swarm-bot) is being developed and maintained by LIS at EPFL. Here I would list  few commercial companies which provide you cheaper ready-to-use components to build your own robots :

1. Lego Mindstorm Nxt 2.0. The third party C interface could be obtained easily. Mindstorm Nxt 2.0 provides advanced capabilities like bluetooth or wireless communication, color detection.

2. Robot Designer by Japan Robotech Ltd. One of the good thing about this product is that they provide an integrated development environment for writting codes in C which can transferred on to robot by serial port. So, complicated algorithms can be implemented on it.However, it can not support more than 5 sensor inputs.


With Arduino boards, the capabilities of your robot could be increased to a great extent.For instance, it can support nearly 50 sensors ( I need to check this one, though!)

With time, I would try to update this information ....

Installing Player/Stage on Ubuntu Jaunty64bit

My system:

$ uname -a
Linux swg-desktop 2.6.28-14-generic #47-Ubuntu SMP Sat Jul 25 01:19:55 UTC 2009 x86_64 GNU/Linux


First install following packages using synaptic packet manager:

python-gdal netcdfg-dev libpq-dev libhdf4g-dev libgeos-dev libatk1.0-0 lib3ds-dev freeglut3-dev

Apart from this, you would need following more packages:

1. Opencv
2. Gtk
3. libtool
4. libboost
5. GDKpixbuf
6. G++
7. Glut/OpenGL
8. GSL
9. libdevice
10. Gnomecanvas
11. imagemagick
12. Swig
13. Ruby
14. libstatgrab
15. libXmu
16. xmms

Don't forget to install development packages (-dev) for these packages.


In order to install xmms, follow the instructions given here .

I downloaded the player-3.0.0-rc1 and stage-3.1.0-Sources packages from sourceforge site .

Untar these packages and follow the instructions given in README.txt and INSTALL.txt files. Once you have installed the files correctly, you should check if you are able to execute simple commands as mentioned in the player/stage homepage. Instructions for installing Player is given here . Follow this link to find out if player/stage is installed correctly and instructions for Stage installing is given here .

Basically, you should be able to the run the following command successfully. Go to the stage source folder.

$ which stage
/usr/local/bin/stage

$ cd Stage-3.1.0-Source
$ stage worlds/simple.world

This should give you following animation screen :


In case you get an error saying shared library could not be loaded, you need to include the folder containing player/stage libraries (/usr/local/lib) into the file /etc/ld.so.conf and then run following command on terminal :

$ sudo ldconfig


for Stage 3.1.0, install libfltk1.1.x, libpng, libtool (libtdl) and opengl libraries. Read the INSTALL.txt file inside the source package.


I also tried installing it on a 32 bit Jaunty and it works fine. The configuration is as follows:

Linux swg-laptop 2.6.28-14-generic #47-Ubuntu SMP Sat Jul 25 00:28:35 UTC 2009 i686 GNU/Linux

I faced problem while installing this on Ubuntu Intrepid (8.10). While everything compiled properly, it gave me an error like "Insufficient GL support" when I tried to execute the stage command. The problem was allegedly with unsupported ATI drivers.

Real life robot applications

I just came across this amazing blog which posts the recent developments in robotics.


http://www.botjunkie.com/

It has some amazing robot videos ... starting from squeezing robot to dish-washer to wagging tails ....

Saturday, September 13, 2008

Jargon

Since several terms are in use, it is better to get familiar with the some of the commonly used jargon in this domain:
  1. Visual-motor coordination (VMC) basically makes use of techniques that try to establish a map between the end-effector position (or pose) with the joint angle vector (theta). In this aspect, it can be considered as a static mapping between the task space and the configuration space. Most of the time, it makes use of forward kinematics map of the manipulator.

  2. Visual Servoing (VS): Visual servoing tries to establish a map between the end-effector velocities and the joint angle velocities. It necessitates the knowledge manipulator Jacobian and in some cases may involve manipulator dynamics as well.

  3. Task space (workspace) of the manipulator is the 3-dimensional Cartesian, real world space or volume where the manipulator is supposed to move about and carry out the task.

  4. Configuration space (or joint angle space) of the manipulator is the set of all valid joint angle vectors that would lead to a end-effector position and orientation within the workspace.

  5. Pose of a manipulator is the end-effector position and orientation with respect to a global reference frame. Usually, base frame of manipulator is taken as the global reference frame for all kinds of measurements.

Friday, August 15, 2008

Introduction

It is the coordination between the motors of a robot manipulator and the vision system. Just recall how our eyes are indispensable when we move around or do various things with our limbs. The idea is to get the real world coordinates using a stereo-camera and then feeding these coordinates to the robot so that it can move to the desired target (viewed by camera). Technically speaking this entire field of integrating of vision with robot motion is known as Visual Servoing. A nice introduction in this regard is available here.

We can divide entire problem into two parts:
  1. First extracting useful features from the camera images that gives a description of the manipulator workspace.
  2. Once the workspace description is available, how to guide the manipulator to carry out a desired task in this workspace.

When a camera model is used to convert the features obtained in image plane or space are converted to some useful quantities in Cartesian space and then the second problem is solved, we call it PBVS (position-based visual servoing). But most of the times it is useful to solve the problem directly in the image plane itself obviating the need for a precise camera model. This leads to image-based visual servoing (IBVS).


Another distinction can be made based on the location of camera relative to robot base.

  1. Eye-to-hand configuration: Cameras are mounted over the workspace so that its position relative to robot base is always fixed through out the operation.
  2. Eye-in-hand configuration: If the cameras are mounted on the manipulator end-effector itself, so that its relative position changes with respect to the robot base the manipulator moves.