NEXT ENTRY »
SMS pornbots

Lego robot that solves Rubik’s Cube

J.P. Brown is an archaeological conservator at the Field Museum in Chicago. But in his spare time, he builds some of the most dementedly advanced robots you’ve ever seen, using Lego Mindstorms. That robot above? It can solve a Rubik’s Cube puzzle. If you check out his site, you can see Brown’s complex descriptions of the engineering difficulties he faced — not the least of which was creating Lego robot grips strong enough to manipulate the cube. He’s also posted mindblowing videos of the robot in action.

Briefly, the software sends a message to the top RCX asking it to present one face of the cube to the video camera. The computer captures a frame from the video camera, and scans a 50x50 pixel area of each color patch to find the median red, green and blue (RGB) color values for each color patch on the face. The RGB values are converted to CIE X Y y coordinates, and then the CIE values are trigonometrically compared to the calibration values to find the closest match. The computer then asks the robot to show it the next face, and the process is repeated until all the faces have been scanned.

Consider the awesome circularity of this thing: A toy that can solve a toy. I’m in love.

This reminds me of why Lego may be the best toy ever to teach math, engineering, and logic. Any kid that plays with Lego has to confront the challenges of calculating how to add up multiple tiny shapes into a bigger one, usually with interesting questions of geometric symmetry thrown in, and the engineering demands of making a structure stable enough to be played with. And when you add in the Mindstorms programming language, you’ve basically got something that is essentially a complete curriculum in way-kewl geekitude.

Even before Mindstorms came along with an official coding language, Lego had many connections to the programming mentality. Brown himself has a superb nerd sense of humor, as I found when surfing his FAQ and discovered he’d written a description of his work like in NQC, one of the most popular Lego Mindstorms programming languages:

#define boredom_threshold 1

#define client_lag 35

#define work OUT_A

#define alive true

int meeting_lag;

task main()

    {

    while( alive ) {

        crisis_level = Random( meeting_lag );

        Wait( boredom_threshold + crisis_level );

        On(work);

        do {

            Wait( Random( meeting_lag ) );

            —crisis_level;

            } while( crisis_level > 0 );

        Off( work );

        }

    }


blog comments powered by Disqus

Search This Site


Bio:

I'm Clive Thompson, the author of Smarter Than You Think: How Technology is Changing Our Minds for the Better (Penguin Press). You can order the book now at Amazon, Barnes and Noble, Powells, Indiebound, or through your local bookstore! I'm also a contributing writer for the New York Times Magazine and a columnist for Wired magazine. Email is here or ping me via the antiquated form of AOL IM (pomeranian99).

More of Me

Twitter
Tumblr

Recent Comments

Collision Detection: A Blog by Clive Thompson