Skip to content

A New Toy

September 17, 2010

When I was a child, I had more fun disassembling my toys to build different stuff than actually playing with them. For this reason, the most beloved and memorable toys I had in my childhood were a few LEGO kits (too expensive in Brazil) and an electronic kit with which I could create radio transmitters, receivers, amplifiers and other assorted devices.

So, it was a sort of a natural decision to go for computer science when choosing an undergraduate course to apply for. I wasn’t ready to leave my family home yet, and that was the closest thing from the dream career for me, and that happen to be a very good choice.

However, I’ve always been attracted to robotics, and I’ve never had the chance to work seriously in this field. Fortunately, it happens that LEGO has a relatively new product line (dating back to 2006) named MINDSTORMS, which is an amazing tool for introducing several robot design concepts.

Firstly, it’s a LEGO toy, so you are free to design and build the structures by using static and movable bricks and parts. Those familiar with the TECHNICS product line know how complex those designs can grow.

However, the MINDSTORMS sets are a complete framework for robotics design, composed of the following parts:

  1. A nice collection of static an movable bricks, gears, wheels and other pieces (619 in the new NXT 2.0 set);
  2. A fully programmable 32 bit microprocessor;
  3. A range of plugable sensors (ultrasonic distance, color and light perception, touch, among others that are optional);
  4. Servo-motors with attached rotation detectors for precise control;
  5. A visual programming environment (blocks of pre-defined functions and fluxograms);

I’ve been dreaming about getting one of those sets for a while now, and that was precisely what I did the very first day I came to Boston: ordered a NXT 2.0 kit from Amazon. The package arrived last night and these are the photos of the first test robot I’ve built:

Lego NXT robot

My first Lego NXT robot

Lego NXT robot and pieces

Test robot and complete set of parts

The kit comes complete with an installation CD for the visual programming environment, which is good for kids, USB cables and Bluetooth connectivity. The Bluetooth capacity is useful both to transfer the programs from the computer to the NXT microprocessor and to possibly handle communication among several robots (if you buy more kits of processor bricks).

Although the possibilities are enormous for robot design enthusiasts, I’m actually interested in the programming part. So, I started to explore the open-source options for overriding the limitations of the original visual programming environment. For the object orientation inclined ones, there’s a functional JVM implementation that does a pretty good job, being a lot faster than the original framework, but it requires a firmware update.

Instead, I chose NBC/NXC, a compiler tool that generates the type of machine code that the original firmware recognizes and executes. This way, programs written in NBC/NXC can coexist with programs from the original programming environment. NBC is a type of assembly language, while NXC (Not eXactly C) is a higher level one, with a complete API to dealing with all the sensors, servos and communication.

I just wrote and tested my first programs in this framework, but I’m so happy with it that I’m not even considering going back to the visual environment. The advantages are enourmous, such as being able to freely declare variables, complex types (arrays and structs), threads and functions.

To concentrate on the programming, I chose to build the Multi-Bot design, from the excelent The Multi-Bot is a vehicle that enables the use of all sensors at the same time. The sensors are positioned at the front of the Bot, and this design is ideal to experiment with different methods of perception and awareness of the environment surrounding the robot. The extra servo-motor can be used for a ball-launcher gun or another side mounted device.

My long-term plans are to use this design in a robotics workshop when I get back to IFPI, where I’ll focus on the AI programming challenges involved in navigation software.

PS. 1: I’m accepting suggestions for this future workshop.

PS. 2: Today I had my first group meeting at MIT and I’m already impressed by how thing work here. The most important thing is that the majority of daily work does not involve much money, equipments or extra synapses, being just a matter of focusing on the work to be done. I’ll talk more about that in a latter post.

PS. 3: I do not own one…:)

No comments yet

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: