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




















1 comment:

  1. hi its very good tutorial thanks for sharing but if you highlight some details for example how to link qt 3.x with gmapping since i installed qt but gmapping is unable to find it secondly after configuring carmen gmapping gives some error i.e

    ./configure: ./build_tools/generate_shared_object: /bin/tcsh: bad interpreter: No such file or directory

    ReplyDelete