Do you remember those complicated little Rubik’s block that we would sit there trying to figure out for what seems like hours? Did any of you guys/girls ever solve them? Maybe all it takes for us to solve the “cube” would be for us to see what it’s all about. While there are many mesmerizing toys that are about to emerge into our world, today, we would like to take a close look at the Rubik’s Build It, Solve It, because we believe this is the one-way ticket to finally solving the cube!
The robot will turn the cube to each face and the camera will take 6 pictures, one of each side of the Cube. The Raspberry Pi will determine the cube configuration from the six pictures. The Cube configuration will be passed to the kociemba Python library to find an efficient solution. Finally, the robot will execute the moves to solve the Rubik’s Cube!
1 When production is initiated, the plastic pellets are transformed into Rubik's cube parts through injection molding. In this process, the pellets are put into the hopper of an injection molding machine. They are melted when they are passed through a hydraulically controlled screw. As the screw turns, the melted plastic is shuttled through a nozzle and physically forced, or injected, into the mold. Just prior to the arrival of the molten plastic, the two halves of the mold are brought together to create a cavity that has the identical shape of the Rubik's cube part. This could be an edge, a corner, or the center piece. Inside the mold, the plastic is held under pressure for a specific amount of time and then allowed to cool. While cooling, the plastic hardens inside the mold. After enough time passes, the mold halves are opened and the cube pieces are ejected. The mold then closes again and the process begins again. Each time the machine moulds a set of parts is one cycle of the machine. The Rubik's cube cycle time is around 20 seconds.
The project uses the Pi to directly solve the Rubik’s cube. The BrickPi3 takes the unsolved Rubik’s cube and the Raspberry Pi takes a picture of each side of the Rubik’s cube with the Raspberry Pi Camera. The Pi creates a text map of the color squares that shows where they are located on the cube. When it has fully mapped the cube, the Pi uses the “kociemba” python library to map out the moves needed to solve the Rubik’s cube. This information is taken by the Pi and BrickPi3 to solve the Rubik’s cube using the LEGO motors. The result: a solved Rubik’s cube.