Time for technical details:
1) Board recognition.
We have used the camera (in android phone with IP Webcam app) to grab the photo of board and send it to the host computer. Next, the image is cropped translated to board square - then it is divided into separate fields. Algorithm tries to match circle in every field (from above pawns ale near ideal circles). If the pawn is detected the image of field is being thresholded to detect if it’s white or black. When all the fields were recognized the board is sent do game logic part of program. Image recognition was written in python with openCV library.
2) Checkers algorithm
Firstly, it detects if the human move is allowed
Our board to value function (we have to know which situation is better than other, but it's really heuristic):
- the closer the pawn to the end the bigger the value,
- if the pawn is a kings is much more valuable,
- if the pawn is under beat it is less valuable,
Analogically for the computer pawns.
We can set searching depth from 5 to 8. The algorithm is so good that we have never beaten it.... The slave becomes better than master...
3) Crane for moving pawns
We have to made a robot to move pawns. It was developed using two LEGO NXT’s, train tracks and many other lego parts.
Axes was made using LEGO train tracks and cars - it forces straight movement in one direction and it has enough precision. On one site of track we mounted a motor with wheel mounted to rope going to the other site of track. The NXT motors have build-in encoder which gives us an information about position where we are - this means we can move to given field. Both axes have endstops for detecting origin positions.
We have build pressure controlled pump and controlled valves. The pump runs until the switch was pressed. As we have run out of touch sensor we've made a breakdown cable - NXT detects shortcut between two pins of it's cable. So we've used normal switch !
4) Application GUI
GUI was made using PyQT with QT Designer - It shows steam from camera, moves list, and many other options!
PyQT is very nice to write apps, especially if you use designer and generate UI code - your job is just to make an interface (slots and signals) with rest of app.
5) Putting it all together