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 );
}
}
Posted by Clive Thompson at February 20, 2004 11:18 AM
Trackback Pings
TrackBack URL for this entry: http://www.collisiondetection.net/mt3/mt-tb.cgi/728
Listed below are links to weblogs that reference Lego robot that solves Rubik's Cube:
Well this guy could have ruled the world. But he decided to give us something cute instead!!!
I salute him!!!
Posted by: Mario at February 22, 2004 6:21 AM
I know! He could have built a Lego robot that ATTACKED TOKYO and SMASHED IT INTO THE GROUND. But did he? No.
Posted by: Clive at February 22, 2004 1:45 PM
Post a comment
Well this guy could have ruled the world. But he decided to give us something cute instead!!!
I salute him!!!
Posted by: Mario at February 22, 2004 6:21 AM
I know! He could have built a Lego robot that ATTACKED TOKYO and SMASHED IT INTO THE GROUND. But did he? No.
Posted by: Clive at February 22, 2004 1:45 PM