RSS RSS feed | Atom Atom feed
Popular Articles: Tom Riddle's Magical Diary | AJAX Lego Robot | AJAX CAPTCHA | SQL Multisets

AJAX Remote Controlled Lego Robot

AJAX taking control of the real world

For those of you who haven’t seen Virtuosity, it's about a computer program finding a way to enter the real physical world and start killing real physical people.
This article describes how AJAX can be used to control a real physical Lego robot in real-time.
Although my little innocent Lego car is far off from coming close to being a serial killer, it will be fascinating to see how killer apps will be able to control and remote control things through AJAX and other web technologies in a couple of years

AJAX Robot #1

Sorry, I don't have any flashy name for it, it's simply AJAX Robot #1 (not to be confused with Johnny #5).

The setup is all pretty simple.

  • A gumstix connex computer running Linux and a webserver with CGI (Common Gateway Interface).
  • Some low level c code to do input mixing and giving control outputs to the Lego motors.
  • A static HTML page as an AJAX control panel.
  • A compact flash 802.11b wireless card.
Anyone with an AJAX enabled browser can remote control the robot by simply loading the static page hosted on the robot's webserver and using the control panel to control it in real-time!

AJAX Control Panel

This is how the control panel looks like on the page hosted on the robot. Try moving your mouse pointer over the square (no worries the AJAX request has been disabled). If the control panel is not intuitive enough, here's how to control it
  1. At the center, radius = 0, motors stops
  2. Increase distance to center, r > 0, motor(s) moves
  3. 0 < atan2(y,x) < PI/2, go forward
  4. -PI/2 < atan2(y,x) <0 , go backwards
There is also some mixing based on the angle atan2(y,x). For example, moving the mouse cursor to atan2(y,x) = 0, r=1, will yield a full forward on the left tracks and full backwards on the right track with a continues mixing based on the following formula with adjustments (+/-) depending on quadrant.
double f(double x) { return cos(2*(x-PI/2)); }


 

Maiden Voyage

This is how the Maiden Voyage looked like. The video is kind of lame but is truly the Maiden Voyage!
For any potential police officer watching, those are vanilla soda cream bottles in the background and not beer bottles. I would never drink and drive :) This is photo of the little bugger resting after all that driving

AJAX Robot #2 Coming soon

As a heads up, if time allows I'm planning to attach an onboard camera and make the #1's webserver accessable through the internet for EVERYONE TO AJAX REMOTE CONTROL. Stay tuned!

AJAX Robot #3 Planned

Also a #3 is planned which is gonna be waaaaaay cool! Stay double tuned!
slashdot digg del.icio.us technorati [more]



Re: AJAX Remote Controlled Lego Robot

So cool :) Thanx

Re: AJAX Remote Controlled Lego Robot

"Anyone with an AJAX enabled browser" <- now this is just going TOO far >_< "Ajax" is a marketing buzzword. Are you a marketing drone?

Re: AJAX Remote Controlled Lego Robot

I wish I was, they make all the money while we engineers do the slaving :)

Re: AJAX Remote Controlled Lego Robot

Hi, Ide like to know more of the technical side of how u interfaced the vumstix to the lego motors and such. Thanks Mathew

Re: AJAX Remote Controlled Lego Robot

Hi Mathew, I'll try adding that for robot #2

Re: AJAX Remote Controlled Lego Robot

hi, Can you please get in touch, Im totally stuck on how I interface my gumstix into the real world and its killing me lol . my email address is mathew@mathewjenkinson.co.uk Thanks

Re: AJAX Remote Controlled Lego Robot

Hey Wael, Could you tell me where the robot is? I want to tidy up the area and make sure it's ready before you make it accessible to everyone.

Re: AJAX Remote Controlled Lego Robot

wooow looks cool

Re: AJAX Remote Controlled Lego Robot

woow!!cool!:)

Re: AJAX Remote Controlled Lego Robot

Very cool. Nothing new about the hardware, but the Ajax interface is REALLY sweet! my only problem with it is that putting a lot of requests on a low-MHz system is a) latent and b) can slow the other tasks. How delayed does the ajax interface feel? Once again, very cool. Congrats, and don't get /.ed!

Re: AJAX Remote Controlled Lego Robot

Nice job Wael!!! I like it!!!

Re: AJAX Remote Controlled Lego Robot

Awesome work Wael! I have a few questions regarding the implementation of your AJAX robot input interface. Could I get your email address so I could ask you a few questions? Nate

Re: AJAX Remote Controlled Lego Robot

I am launcing a website soon called RC-XBot
Here
Which will have a publicly accessible internet controlled lego robot on it. Admitadly it isn't based on this tutorial, I used Python and Java with a Flash front end but its still fun to play with. The site will hopefully be on-line by March 2009.

Add a comment Send a TrackBack