Working with LEGO

Thanks to Calum Tsang, I’ve been able to play around with the LEGO
Mindstorms robotics kit without actually having to mess around with
anything that requires spatial visualization. I’ve never really gotten
the hang of getting gears and whatnot to work together. Fortunately,
Calum is absolutely brilliant when it comes to that sort of stuff, so
all I really need to worry about is just making sure that I produce
the right output given the input.

LEGO presents quite a challenge. We use Not Quite C (nqc) to program
the robot, and it _really_ is not quite C. I’ve run into the parser’s
limitations a gazillion times, from wondering why on earth some of the
binary operators don’t accept variables to wishing I could define a
function that returns a value instead of having to pass everything
around in global variables. It’s fun working within those constraints,
though.

Debugging is a mission, too. No println debugging here! Numbers and
beeps are all I have, and the compile-download-run cycle can be a bit
slow. We’re still having problems with the infrared communication
between two of the control modules, but Calum thinks it’s because I’m
flooding the communication buffer. We’ll try twiddling that on Friday
to see if we can get it to work before the competition on Saturday.

Maybe he can teach me how to put together some of the really simple
assemblies – the bumper, perhaps? I’m completely pfft when it comes to
spatial things, but that could be a way for me to ease into it. Just
as Kathy’s circus stuff helped me learn coordination and rhythm, maybe
LEGO can help me learn how to hold spatial structures in my head. In
the meantime, I actually enjoy working within the constraints of the
system.

It’s also a refreshing break from the kind of programming work I
normally like doing. As Calum pointed out earlier, I’m one of the
near-mythical programmers who actually prefers maintaining other
people’s code and (gasp) writing a little documentation here and
there. For these little LEGO contests, all I need to do is hack
together some code that will be thrown away afterwards. It feels more
like a logic puzzle than a proper program. I don’t have the feeling of
working on something that makes someone’s life easier and better, but
I do feel that it exercises my brain and keeps me limber.

So, yeah. LEGO is fun. =)

On Technorati:

It’s alive!

Today we finished the code for Calum’s robot. The robot’s job is to
give blocks to other robots, and it scores points based on the unique
colors of blocks it collects and the number of unique robots it gives
blocks to.

I’m proud of the robot because it’s pretty smart. It’s smart enough
not to shoot multiple blocks at the same robot unless desperation mode
kicks in. Quite slick, as Calum said.

Calum will no doubt post wonderful pictures on his blog sometime. I’ll
ask him for a copy of the source code and I’ll post it here. Whee!

On Technorati:

Random Japanese sentence:

ほら!台所に猫がいる。 Look! There’s a cat in the kitchen.

LEGO

I got the robot to do what I wanted to. It was a nifty program. Didn’t
work in the real world, but well, that’s life.

I don’t feel like much of a computer scientist, though. I’m supposed
to be thrilled that I got it to work, but now that it’s done, I find
that I don’t care about the program itself. I don’t care that I got it
to work. It exercised my brain, but so many things do…

Open source has gotten me hooked on making people happy. As a CS
person, I’m probably not even supposed to care about making people
happy, but I do. Hacking on the LEGO code was fun, but it wasn’t
something I would do by myself. I did it because it was fun to hang
out. I enjoyed the stories, the banter, the demonstrations of
particularly nifty things we’d gotten to work. I’m glad I had the
opportunity to help Calum breathe life into his machine. I’m glad I
got to meet Iain, Derek, Sandy, and the others.

Those who have known me since childhood know how far I’ve come. I find
it scary sometimes. Do I need people too much, now? But I do… I’m
glad that my friends at Graduate House now feel comfortable enough to
give me a hug without anyone worrying about improper intentions. I’m
glad that I can do nice things for people and make their day better.
I’m glad that I have the warmth and love of friends and family to keep
me going.

I’ve given myself enough time for fun. Tomorrow: work on my FIS paper.
If I need an emergency shot of warm-and-fuzzies, I’ve got my
collection of letters and good karma…

On Technorati:

Random Japanese sentence:

1匹の猫がカーテンの陰から現れた。 A cat appeared from behind the curtain.