Project Joseph Hoane: A Robotic Chess Player
(1) Overview
Traditional chess engines exist in the digital realm, but integrating artificial intelligence with physical gameplay presents unique challenges. Our project addresses the gap between virtual chess engines and real-world play by creating an autonomous robotic system capable of physically manipulating chess pieces on a standard chessboard while playing at various skill levels against human opponents.
(2) Tech Stack (HW/SW)
- OS: Ubuntu 20.04
- Visual processing components: Python (>=3.8), OpenCV and AprilTags
- Robot Control: ROS Noetic, rospy, Actionlib, UR10e Robotic Arm, Hand-e Gripper (Robotiq)
- Chess engine: Stockfish package
(3) Architecture
| Term | Description |
|---|---|
| UR10e | An industrial robotic arm with 6 degrees of freedom. This is the main robot that allows the program to move the chess pieces. |
| Hand-e gripper | A gripper that allows the UR10e to pick up a chess piece. |
| ROS | Acronym for Robotic Operating System. It provides an interface to program the UR10e and the Hand-e gripper. Our system uses ROS Noetic. |
| AprilTag | A tag(similar to a QR code) used to detect the location of the piece in the image captured by a camera. |
| Stockfish | Chess engine that will solve the optimal move given the board configuration. |
| Inverse Kinematics / IK | Mathematical model to convert 3d coordinates to list of angles for the joints of robots. Transformation is solved using numerical methods. |
Board Detection
Our board detection system uses a Perturb-Detect-Clustering algorithm to detect apriltags even in poor lighting conditions. It applies randomized affine transformations along with color perturbations, which reduces the chances of a tag not being detected by orders of magnitude.
Pieces
Each piece is a perfect cube, with an april tag on the top for detection and a letter(e.g. P for pawn, Q for queen) etched into each of the four sides. Black pieces(top of image) are denoted by the lower half of the piece shaded black
Chess Engine
We use the Stockfish chess engine to analyze positions and determine optimal moves. The difficulty can be calibrated to match players of any skill level.
Robotic Arm
A UR10e robotic arm with a Hand-e gripper physically moves chess pieces on the board. The system uses inverse kinematics and sophisticated path planning to ensure precise, safe movements.
(4) Game Loop
The game follows a standard loop: the robot makes a move, the vision system detects the new state, the player responds with their move on the physical board, the vision system detects the new state, and the cycle continues until checkmate.