Skip to content

Commit 0dc13b5

Browse files
authored
Update for latest RubiksColorSolver and update README (#285)
1 parent d0625b5 commit 0dc13b5

File tree

2 files changed

+42
-14
lines changed

2 files changed

+42
-14
lines changed

demo/MINDCUB3R/README.md

Lines changed: 38 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,45 @@
11
# MINDCUB3R
22

3-
### Installation
4-
This can take several minutes on an EV3
3+
## Installation
4+
### Installing kociemba
5+
The kociemba program produces a sequence of moves used to solve
6+
a 3x3x3 rubiks cube.
57
```
6-
sudo apt-get install build-essential python3-pip libffi-dev
7-
sudo pip3 install git+https://github.com/dwalton76/kociemba.git
8-
sudo pip3 install git+https://github.com/dwalton76/rubiks-color-resolver.git
9-
kociemba DRLUUBFBRBLURRLRUBLRDDFDLFUFUFFDBRDUBRUFLLFDDBFLUBLRBD
8+
$ sudo apt-get install build-essential libffi-dev
9+
$ cd ~/
10+
$ git clone https://github.com/dwalton76/kociemba.git
11+
$ cd ~/kociemba/kociemba/ckociemba/
12+
$ make
13+
$ sudo make install
1014
```
1115

12-
### Running
13-
./rubiks.py
16+
### Installing rubiks-color-resolver
17+
When the cube is scanned we get the RGB (red, green, blue) value for
18+
all 54 squares of a 3x3x3 cube. rubiks-color-resolver analyzes those RGB
19+
values to determine which of the six possible cube colors is the color for
20+
each square.
21+
```
22+
$ sudo apt-get install python3-pip
23+
$ sudo pip3 install git+https://github.com/dwalton76/rubiks-color-resolver.git
24+
```
25+
26+
### Installing the MINDCUB3R demo
27+
We must git clone the ev3dev-lang-python repository. MINDCUB3R is included
28+
in the demo directory.
29+
```
30+
$ cd ~/
31+
$ git clone https://github.com/rhempel/ev3dev-lang-python.git
32+
$ cd ~/ev3dev-lang-python/demo/MINDCUB3R/
33+
$ kociemba DRLUUBFBRBLURRLRUBLRDDFDLFUFUFFDBRDUBRUFLLFDDBFLUBLRBD
34+
```
35+
36+
## Running MINDCUB3R
37+
```
38+
$ cd ~/ev3dev-lang-python/demo/MINDCUB3R/
39+
$ ./rubiks.py
40+
```
1441

15-
### About kociemba
42+
## About kociemba
1643
You may have noticed that the
1744
`kociemba DRLUUBFBRBLURRLRUBLRDDFDLFUFUFFDBRDUBRUFLLFDDBFLUBLRBD`
1845
step of the install looks a little odd. The "DRLUU..." string is a
@@ -24,9 +51,9 @@ that color data and returns a sequence of moves that can be used to solve the
2451
cube.
2552

2653
```
27-
robot@beaglebone[lego-crane-cuber]# kociemba DRLUUBFBRBLURRLRUBLRDDFDLFUFUFFDBRDUBRUFLLFDDBFLUBLRBD
54+
$ kociemba DRLUUBFBRBLURRLRUBLRDDFDLFUFUFFDBRDUBRUFLLFDDBFLUBLRBD
2855
D2 R' D' F2 B D R2 D2 R' F2 D' F2 U' B2 L2 U2 D R2 U
29-
robot@beaglebone[lego-crane-cuber]#
56+
$
3057
```
3158

3259
Running the kociemba program is part of the install process because the first

demo/MINDCUB3R/rubiks.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from ev3dev.auto import OUTPUT_A, OUTPUT_B, OUTPUT_C, InfraredSensor
44
from ev3dev.helper import LargeMotor, MediumMotor, ColorSensor, MotorStall
55
from pprint import pformat
6-
from rubikscolorresolver import RubiksColorSolver3x3x3
6+
from rubikscolorresolver import RubiksColorSolverGeneric
77
from subprocess import check_output
88
from time import sleep
99
import json
@@ -443,9 +443,10 @@ def scan(self):
443443
return
444444

445445
log.info("RGB json:\n%s\n" % json.dumps(self.colors))
446-
self.rgb_solver = RubiksColorSolver3x3x3()
446+
self.rgb_solver = RubiksColorSolverGeneric(3)
447447
self.rgb_solver.enter_scan_data(self.colors)
448-
self.cube_kociemba = self.rgb_solver.crunch_colors()
448+
self.rgb_solver.crunch_colors()
449+
self.cube_kociemba = self.rgb_solver.cube_for_kociemba_strict()
449450
log.info("Final Colors (kociemba): %s" % ''.join(self.cube_kociemba))
450451

451452
# This is only used if you want to rotate the cube so U is on top, F is

0 commit comments

Comments
 (0)