Rubik's Cube Solving Robot
This repository is for a robot that solves the rubik's cube. The idea is that after a scrambled rubik's cube has been places in the robot, an ESP32 (master) gets the cube's state (using 2 cameras, looking at opposite corners, each seeing 3 faces). The data is then sent to a more powerful computer (slave) which puts the data through kociemba's algorithm. The solution is then sent back to the master for servos to execute and (hopefully) solve the cube.
Master-Slave Relationship
The data is sent through the default UART connection between the master and the slave in the simple RCTP protocol (Rubik's Cube Transfer Protocol) (see include/rctp.h
) (Note that both machines have to have the same endianess since the protocol is binary)
Building
The projects can all be built separately, but only the implementation of kociemba's algorithm (kociemba/
) can be useful on its own.
-
kociemba/
: built usingGNU make
(kociemba/README.md
for more details) -
slave/
: built usingGNU make
(slave/README.md
for more details) -
master/
: in contrast with the other parts, the master is built usingesp-idf
's build system (master/README.md
for more details)
The Makfile in the root of this repo is a wrapper around the other build systems, so just use:
-
make all/kociemba/slave/master
to build all or a single one (with nondebug flags) -
make run [FLASH=1] [PORT=ttyUSBn]
to build and run the slave, and whenFLASH
is set the master program is flashed, and whenPORT
is set, the given port is tried instead of the defaultttyUSB0
Note that building master/
using the wrapper requires the esp-idf
export script to be sourced.