Fun with Lego Mindstorm NXT
While I was getting confused on what to code on the quarterly hack day, our senior manager brought a Lego Mindstorm NXT programmable robotics kit for some fun. The moment I saw his mail, I ran to his cube to grab it. This was my one chance to enjoy some building and coding fun together in the name of hack.
So I spent the whole Saturday figuring what to make, and suddenly this idea struck me. In this age of social networking mania on the web, why not make an intelligent picture taker which can roam among people in a room and take some cool shots.
This is by far the best toy I ever handled. I always wanted to make toys with servo motors, and the kit has 3 of them. So 2 of them went to the wheel and the last one became a concoction to trip the shutter. Give the right amout of power and it will press just like a human finger. Woot.
Other than the motors, there are 4 sensors - ultrasonic (to “see” like bats), sound (mic), touch and light. Am having a ball of time to develop code in NXC on my Mac. A major part of the fun is in multithreaded event programming, using mutex and semaphores. Downloaded a very convenient compiler from Bricxcc and it is a breeze to compile and send the binary program to the robot over bluetooth. Here are the commands:
$ nbc prog.nxc -O=prog.rxe
$ nxtcom -v -S=/dev/tty.NXT-DevB-1 prog.rxe
To generate the tty for the bluetooth, I followed the instructions here:
http://juju.org/articles/2006/10/22/bluetooth-serial-port-to-nxt-in-osx
I am targetting to have these features for demo on Monday:
1. Front bumper hits something => move back a bit and take a picture.
2. Some obstacle comes in front and stays there for a few seconds => take a picture.
3. Explore the room intelligently.
More photos here.


April 23rd, 2008 at 1:19 am
Joy,
As always, intuitive and awesome stuff!
May 16th, 2008 at 5:05 pm
Neat stuff. Me likey !