Friday, May 28, 2010

Bye,Bye Aria - Welcome Carmen

After a long week of reading and small quick and dirty python scripts to visualize RADISH data format, by just plotting the laser readings using the odometry of the robot ( I used the MIT court data-set). Rolf came back from vacation and told me about Grisseti's GridSlam GMapping approach.

I installed Ubuntu 10.04 LTS
uname -a
Linux ubuntu 2.6.32-22-generic #33-Ubuntu SMP Wed Apr 28 13:28:05 UTC 2010 x86_64 GNU/Linux

I got Carmen from SVN
svn co https://carmen.svn.sourceforge.net/svnroot/carmen --username anonymous

I had to install a bunch of things to get it to compile, see
https://wiki.ubuntu.com/carmen

Last time i tried to build it on my older ACER laptop failed ( I think i used the .gz file as it says in the docs), but this time i got it all working.
kris@ubuntu:~/Downloads/carmen/carmen/src$ ./configure
Using $CC as gcc...
Found processor x86_64.
Congratulations. You are running Linux.
Found kernel 2.6.32-22-generic.
This doesn't look like SuSE!
Searching for linux kernel headers... found at /usr/src/linux-headers-2.6.32-22-generic
Searching for canlib... Found canlib header at /usr/include/canlib.h
Searching for GTK... found, version 2.20.0
Searching for joystick... found at /usr/include/linux/joystick.h

It looks like this is a system include, so I won't add it to the standard
include path. Adding partial system include paths is usually a recipe for
disaster. If this is the wrong thing to do, you could add the following
line to Makefile.vars:
JOYSTICK_INCLUDE = -I/usr/include/linux/joystick.h

Searching for tcpd.h... found
Looks like your system supports access control. Very good.
Searching for jpeglib.h... found
Searching for zlib.h... found
Searching for ImageMagick (Wand)... not found
Searching for Java... not found
Searching for doxygen... found
Searching for SWIG... found
Should IPC run in silent mode by default: [Y/n]
Should the C++ tools be installed for CARMEN: [Y/n]
Should Python Bindings be installed: [y/N]
Should the old laser server be used instead of the new one: [y/N]

Type the install prefix to use for public installs, or hit enter to keep the
default as /usr/local. (This prefix is not currently used by any rules.)

Install path [/usr/local/]:

You must have Linux kernel 2.0.20 to compile:
Nomadic Technologies XR4000

These are the robot types CARMEN currently supports:
1. ActiveMedia Pioneer I
2. ActiveMedia Pioneer II
3. iRobot ATRV
4. iRobot ATRV-JR
5. iRobot B21R
6. Scout
7. OrcBoard v.4
8. OrcBoard v.5 (Experimental)
9. Segway RMP
10. *

Please select which robots you wish to compile base modules for.
e.g., 1, 2, 6 would compile support for both Pioneer types and a Scout.
Hit enter to compile them all, or type "none" to compile no base module
support, for example, if you will be working exclusively in simulation.

Robot numbers [*]: 1,2

Compiling base support for: pioneer

I ran all binary files and found the docs somewhat useful
http://carmen.sourceforge.net/doc/

Running ./vasco was a pleasant surprise [you can get .log data from RADISH database]

Next I got GMapping
svn co https://svn.openslam.org/data/svn/gmapping
I don't think i had big troubles compiling it, then I ran the ./gfs_simplegui

it worked really fast on the MIT data, but it had some kinks.

Today I showed all that to Rolf and tried to make Carmen control the physical robot. Rolf bought a generic USB joystick after i told him we can navigate the robot manually and collect data in CARMEN format using Carmen's framework.

I connected the Serial -> USB box to my Ubuntu laptop, then looked at the /dev
ls /dev
you will see that serial ports from the USB box are named as
/dev/ttyUSB0
/dev/ttyUSB1
/dev/ttyUSB2
/dev/ttyUSB3
Changed the parameters in the ../../carmen.ini file (the parameter server) to set laser_laser_dev to /dev/ttyUSB3

then when you run ./laser will show

kris@ubuntu:~/Downloads/carmen/carmen/bin$ ./laser
CARMEN - Carnegie Mellon Robot Navigation Toolkit - Version 0.8.0

This instance of laser will use the lasers with the ids: [1 2 3 4 5]

--------------------------------------------------
Laser id ........................... 1
Requested baud rate ................ 38400 kbps
Checking requested configuration ... see below
Requested laser configuration:
type ............................. SICK_LMS
remission_mode ................... none
resolution ....................... 1.00 deg
max range ........................ 81.900 m
fov .............................. 180 deg
start angle ...................... -90.00 deg
Initialization device .............. done

Connecting device .................. connected
Querying baudrate ................ 9600 . success
Detected baudrate ................ 9600 kbps
Setting new baudrate ............. done (reconnect needed)

Reconnecting device ................ connected
Querying baudrate ................ 9600 ........ failed
19200 ........ failed
38400 . success
Detected baudrate ................ 38400 kbps
Baudrate is already correct ...... done
Connection to laser device succeded

Configuring laser device ........... see below
Querying configuration ........... ok
Setting the config mode .......... done (laser light is red)
Setting range and remission ...... config accepted
Setting variant .................. accepted
Switching to monitorning mode ... done
Configuration of laser device succeded

Initializing of laser with 0 successfully completed!

--------------------------------------------------
Info: Starting thread for laser 1
Info: The laser 2 is not used in this instance of laser
Info: The laser 3 is not used in this instance of laser
Info: The laser 4 is not used in this instance of laser
Info: The laser 5 is not used in this instance of laser

--------------------------------------------------
Timestamp calibration for laser 1, please wait a few seconds (100 scans)
N.....................................................................................................Estimated frequency of laser 1 is 9.4697 Hz
status: send-queue: 0 msg(s), laser-msg freqency: 9.709 Hz (globally)
After you make sure you get the laser working, you change the base_dev parameter in the parameter server (carmen.ini) to point to where you have connected the robot's serial, mine was in /dev/ttyUSB2

I spend a good amount of time before i found that i need to use, either
p2d8 or p2d8+dual as robot names, even though my robot is AT3.
I had to add several parameter, which are not included by default in the carmen.ini

[p2d8+dual]

# Parameters for Pioneer 2-DX8 Plus
base_type pioneer
base_model p2d8+
base_dev /dev/ttyUSB2
base_relative_wheelsize 1.0
base_relative_wheelbase 1.0

If all is good you will get a message that the robot connected

To control the robot make sure you know what device you have your joystick on, mine was /dev/input/js0

Then we took the robot for a short laser-scan-walk around the Temple CIS dept, 3rd floor.

Then plotted the collected data using vasco and gmapping




















Wednesday, May 5, 2010

Connecting ARIA with Pioneer Robot

Today was the first time I managed to connect and run ARIA using the Pioneer robot, not the simulation.

I mounted the SICK Laser scanner using adhesive and connected its serial to the BOX (I will add the correct name later). Then connected the robot's serial to the serial of the BOX.

BOX description:
port 1 - still waiting for the Arm
port 2 - still waiting for the LRU
port 3 - Robot
port 4 - Laser

Then installed the windows drivers for the BOX and saw that it maps the ports to COM13-17
After spending 2 hours the previous day, trying to figure out why ARIA can't connect to the robot, even thought i was specifying the ports ( -rp COM17) when running the .java

Rolf discovered the problem. Windows is not happy when the port number is greater than 9.
So today I went into the Device Manager -> Advanced and choose ports 1,2,3,4. Some were showing In USE, but do not worry just choose and confirm.

First found the Robot and then the laser, there is a soft restart for the laser each time ARIA connects to it, so waiting for 10-15 sec.
I was able to log the laser reading using ArLasserLogger() - it takes the robot instance, filename, start_angle, end_angle, see Docs for more explanation.

I was not able to get the robot to wander, not relying on the sonar sensors, but I got it working on the Aria Simulator and I want to try if the recorder map can be read by MobilEyes.

For now I am using my 6 years ACER Laptop running Windows XP, SP3, the battery is bad and It heats up a lot. I am looking forward to the new laptops as well as for 2D Robotic Arm and LRU.

Tuesday, May 4, 2010

Building Aria in Java ++

I thought building the java examples would be a 5 min task, but it turned out that in NetBeans creating a library and including the library path is different than adding the jar as library ?!.

The other obstacle was having 64 bit Windows 7, I tried forcing Windows 7 to run NetBeans as Windows XP, but Java is too smart and still used the 64 bit, where Aria's jar is 32 bit.
To solve this problem I tried 2 things:
-recompile aria's jar to 64 bit - FAILED
-force NetBeans to use 32 bit - GOT too LAZY

so my solution was to switch to my other computer (32 bit Windows XP SP3)
There was no problem there. To save time, if you see any of these errors please read above !!!

java.lang.UnsatisfiedLinkError: C:\Program Files\MobileRobots\Aria\bin\AriaJava.dll: Can't find dependent libraries

Sunday, May 2, 2010

update

Today i spend significant time trying to install CARMEN, until i found that my Feisty Fox Ubuntu, has to be updated, but that was not possible since the repository was bad, hence i decided to install the newest ubuntu on top.

Thanks to:

for the Amazing step by step guide.

I also read
Merging maps of multiple robots¤
Nagesh Adluru, Longin Jan Latecki, Marc Sobel, Rolf Lakaemper