Sunday, July 18, 2021

Check This Chess-Playing Raspberry Pi Robot

By Ian Evenden 3 days ago

Not that kind of Single Board Computer
(Image credit: Joey Meyer)

Sounding like some sort of delightful fruit confection, but in reality a cold, hard, machine of war surely destined to rule us all one day, the Raspberry Turk is a robot that plays chess powered by a Raspberry Pi. Not a chess computer like Deep Blue, but an actual robot that can see the pieces and move them using a robotic arm. The project was created by Apple software engineer and chess fan Joey Meyer.

As you will have probably guessed from the name, the brains behind this Turk come from a Raspberry Pi 3 which uses OpenCV to see the game pieces and a servo controlled arm and gripper to hold and move the pieces. Inspiration comes from the Mechanical Turk, a fake chess-playing machine constructed by an Austrian inventor that toured Europe between the end of the 16th and middle of the 17th centuries.

The Mechanical Turk’s secret was not the fiendishly clever mechanism, nor the beautifully polished cabinet or human-like automaton that sat upon it, but the very small chess player secreted within the woodwork. The Raspberry Turk, by contrast, is written mostly in Python, with the code available on GitHub, and takes advantage of the open-source Stockfish chess engine. It stands upon a wooden table into which it would be difficult to insert even the smallest, flattest Grand Master.

With all the electronics kept neatly in a wooden box at the side of the board, the robot arm (made from Actobotics components) and camera module are all that hang over the board, which is painted directly onto the table top. The Raspberry Turk takes around 30 seconds to make a move, and the pieces have embedded metal studs to make grasping them easier using an electromagnet built into the arm. Meyer trained the computer vision model by hand, moving pieces himself and taking multiple images of every possible position. If you fancy having a go yourself, Meyer’s notes on the project are also available to peruse.


No comments: