Search This Blog

Thursday, June 30, 2011

Configuring the CMU Cam

This post is slightly off topic. This is because CMU-Cam is all together a very different platform. It has a video camera interfaced through serial ports.Its own image processing tools are available(of which I don't know anything right now).Also it has support for 4 servo motors.So,it can be used for making a simple bot.
As far as I have learnt that it can be programmed using C and the program has to be compiled for the ARM processor for which the CMU-cam people provide their own compiler.

So,here we go:
  • First of all make sure that you have following installed :
    • make(usually by default installed in linux systems)
    • Openssh(though I haven't understood its use yet)
    • Subversion
  • Now download the following from this page.
    • Linux ARM-gcc compiler
    • Linux LPC-ISP Installer
  • You will have to install these in a sub-folder of your home directory as root.You can add these locations to the $PATH variable or you will have to manually type their location(I did  manual thing because $PATH has to be modified every time the PC restarts.) 
  • Download the cc3 source by typing this :  svn co https://cc3.svn.sourceforge.net/svnroot/cc3/trunk cc3
  • Now we will Install gcc (the one developed by CMU people)
    • bunzip2 arm-200xqx-xx-arm-none-eabi-i686-pc-gnu.tar.bz2
    • tar -xvf  arm-200xqx-xx-arm-none-eabi-i686-pc-linux-gnu.tar
    • Add: /arm-200xqx/bin to your $PATH variable (rather I typed it manually)
  • Install LPC-ISP 
    • unzip lpc21isp_unix.zip
    • cd lpc21isp_unix
    • make
    • now add the directory with lpc21isp to your path variable as usual I used it manually
  • Now open a new terminal
    • go to cc3
    • type make
  • Start the camera in programming mode.(Hold the push button while powering on to start it in programming mode)
  • Load the com piled hex file
    • goto cc3/projects/cmucam2/
    • Assuming you have used a serial to usb-converter type
      ./lpc21isp cmucam2_lpc2106-cmucam3.hex /dev/ttyUSB0 115200 14746
      (instead of ./lpc21lisp you may have to type its location if you have not modified the $PATH variable )
  • Open the terminal
    • Power cycle the board(i.e. turn it off and again turn it on)
    • A green LED should turn on
    • If the code is running correctly,the blue and yellow LEDs will dimly illuminate
  • Now open minicom
    • Configure it as describe here .
    • Restart the board 
    • You should see the following 
      CMUcam2 v1.00 c6
      :
    • try typing "gv"(don't expect anything to be printed on screen) to see if two way serial communication is working

Tuesday, June 28, 2011

Configuring COM-3 and COM-4 ports on RB-100

RB-100 comes with 4 COM ports(These are the predecessor to serial ports and are still being used on SBCs. For knowing more,see this ).Basically the linux kernel identifies only 2 COm/Serial ports.So only COM0 and COM1 work initially.To make other COM ports work you have to configure them.

The Ro-Board people provide the documentation required for configuring COM3 and COM4 ports.But they have installed Debian-5 along with GRUB-1.
Since I installed Debian-6 and it comes with GRUB-2 I had to struggle a little to configure those ports.Here is the GRUB-2 version of configuration documents:
  • on terminal type /etc/default
  • gedit grub or mousepad grub or vi grub
  • On the 9th line or the line that contains  GRUB_CMDLINE_LINUX_DEFAULT="quiet" add 8250.nr_uarts=4 under the quotes
  • now close the document
  • type update-grub on terminal
  • now reboot
  • on typing dmesg | grep ttyS you should be able to see 4 serial ports.
  • rest of setserial stuff is as usual in the documentation.
But the sad rather amusing part is that I am still not able to use COM-3 and COM-4 ports. If someone does this please tell me how to do this.

Installing OpenCV on RoBoard

Hello again,in this post I am going to describe how to Install OpenCV on RoBoard. If you have ever installed it on a linux platform you needn't read this post.
I followed this link for installation.
Though I think that I can save you from some ridiculous amount of typing.Follow the following steps:
  • make a text file ins.sh
  • copy all the sudo-apt get stuff from the page with -y appended at each line.
  • now in the terminal type chmod +x ins.sh(I suppose that your current location is the location of file)
  • now execute ./ins.sh
Everything will be installed easily.What we did just now is shell scripting.

Now on "cmake" if it shows that some packages are missing you have to sudo-apt them.

Sunday, June 5, 2011

Installing Debian6 on RB-100

So here I am with tutorial on installing Debian6 on RB-100. You may ask why debian? why not windows or ubuntu?
Because first of all debian is much more stable than either of them and second of all I found tutorial to install debian much easier.
I followed Joorie Overgoore's method to install debian(I hope it works for ubuntu also but never tried it).

Let's begin it now.

First of all get a 12V DC power source(it should be able to deliver 300mA of current for 4 hours continously),a lot of jumper,an ethernet cable, a pendrive(4 GB or more),a memory card(preferably 8 GB but 4 will work) and of course a card reader.Don't forget to install "Gparted" on your linux system. Use it to convert your memory card into an ext4 filesystem.

Prepare the Ro-Board i.e. attach the peripherals to it following this guide.

Now download following files
  • Debian 6 iso(the link)
  • The kernel for RoBoard (the link)

Afterwards I followed this tutorial to install debian on my RoBoard.

Now as for the installation of GUI  goes you can select the option to install "standard desktop environment" while installing the operating system.(This will install minimal gnome3 desktop but I personally recommend xfce4 desktop as the later is lighter on resources.)

For installing xfce4 you have to modify your sources list first using vi editor(sorry can't do anything about it).Basically you have to list out the web-address from where apt-get will fetch the files.Modify it using this.

Afterwards you can install xfce4 by typing this
apt-get install xserver-xorg-core xorg alsa-base alsa-utils hal udev gdm xfce4 thunar-archive-plugin

Now type this
dpkg-reconfigure xserver-xorg

now you have to reboot or type gdm to see the xfce gui installed.
You should get the screen like this.

Sunday, May 22, 2011

Robotics Stuff

Movies like Terminator, I-Robot and not to forget the "chitti" Robot have always fascinated me. I was always all ears for news relating to Asimo and QRIO. After being an IITian my first encounter with Robotics Club was a disaster all the techno stuff was enormously overflowing.My sordid affairs with academics didn't help either.


All these changed when I was summoned to IITJ Robotics Lab for my Summer Internship.Now I am working on an SBC(Single Board Computer) RB-100.Though I have not made a rapid progress but I am in love with this board. I have already installed Debian Operating-System with Xfce GUI.I will soon post details regarding my work once I get hold of the photographs.

Right now I am trying to run servo motor with it but a motor is burnt right now.Watch out this space for installation tutorial which I think will be effective as I have failed 42 times.

Friday, February 25, 2011

Assignment Blues


2:00 a.m.
Damn the god!!This programming assignment is taking my toll. Its the fifth day of the loop as:
gcc -g -lpthread progassignment.c -o program
error 1 : something missing here
error 2 : something missing there
error 3 : something not valid
........
and the list goes on .
"Welcome to the coding world".This is the message I could decipher. Struggling for last 5 hours and 4 days , I am unable to write this program without errors. If written without errors, it will not work properly and come with some creeps like segmentation fault and will not work properly.
4:00 a.m.
me: OK! Mr. Compiler , let me see what you get this time.

Hell! was the prompt reply.

Again a failure.Why am I such a loser?And the Megamind comes to rescue
"There is a benefit to losing.You get to learn from your mistakes."Fine! I'll go on learning forever.But not at expense of my daily life.I am missing my breakfast and morning classes because of this assignment. Who the hell cares? Even the bloody partner of mine is sleeping soundly right now.
I want to write a story,listen to music and shout right now.Not doing this piece of code.

Should I go to sleep? or may be take a walk and enjoy the cool breeze outside?

6:00 a.m.
Mr. Compiler! See the code now.Whatever the hell you say about it, I am not going to review it again.At least not now.If something creeps up I'll look in the evening.

And the reply was surprising. The code worked perfectly and drowsiness loomed over me.Finally I am free from the cacophony of multi-threading,client-server etc.A perfect happy sleep. Ok ! one more day of missed breakfast and classes but it doesn't matter.

Wednesday, August 19, 2009

Maths Tutorial

Tuesday's Matha tutorial .I went therejust to see who the new tutor is?Anyawy it was supposed to 1 hour business only.As I was free afterwards.To my surprise it was a lady tutor replacing the old psycho who always used to brag about his busy schdule.Here is how I felt during that tutorial session.


"Another waste of an hour .If not it will be wasted in another 20 mins.This maths really makes a foul smelling curd out of my mind.This is a stinky subject for me .I can't decipher a single line what she says.Though she is solving all the problems but her voice is too feeble to be heard.Damn I can't hear a single word of her.
Can't she be
Yeah she is pretty but equally boring like maths.I got a D last sem.

Can't she be blessed with a louder voice?

Can't she teach any other interesting subject leaving maths for that old psycho?
What is she writing on the blackboard with a cute smile?

Ok leave it .Yesterday also I encountered a beauty in H.C.
God!!!!
I can't forget the glow of her face.Her smile was simply stunning. But she was phisically devoid of 1 hand.I really felt dismal for her,but this is what we call life"

Tin-tin-tin-tin-tin

"Oye kahan kho gaya class khatm ho gayi hai." Amit patel shouted at my ears.