Fame and frustration straight from the eighties. The Rubik's Cube. Peeling off 54 stickers is hard and takes a lot of time, so I built a robot that solves the cube for me instead. Some LEGO Technic, two NXT modules and some programming and a lot of programming later
- Insert cube and press red button
- Take picture of each side
- Recognize colors on each piece (sticker)
- Build string of 54 characters representing the cube
- Run string through solving algorithm
- Convert solution to work with mechanical setup of our robot (4 sides instead of 6)
- Convert further into seperate motor rotations
- Send solution to the NXT modules
More details. After the color recognition on the cube pictures we have a string representing the cube: lbrdurdulffffrrblfbrdufubbrrrdldulfruflllbubuddfdbdulb. We run this through cube explorer and get a solution: U2 F' R2 U' D R U' L2 D2 L U' B U2 F L2 D2 L2 F' B2 R2.
Which of course assumes you can turn any side of the cube so we do a little conversion to work with the mechanical limitations of our robot. Change the D(own) and U(p) rotations into full cube rotations followed by F(ront), R(ight), B(ack) or D(own): z R2 F' x F2 R' L F R' B2 L2 B R' x F R2 B x F2 L2 F2 z L' R2 B2.
Finally we split these cube manipulations into seperate motor movements for our 6 motors. Four to turn the F, B, L and R side. And the final two move a pair towards and away from the cube (FB and RL). Send this final conversion to the NXT modules and shortly after the cube is solved!