This repository contains the implementation of a Chess Coach system designed to enhance the chess-playing experience using AI and robotics. The system provides support for both educational and normal game modes and integrates computer vision, chess engines, and robotics.
- Utilizes a YOLOv8 model to detect the chessboard layout and its grid.
- A YOLOv11 model identifies the positions and types of chess pieces within each box on the board.
- Converts the detected game state into Forsyth–Edwards Notation (FEN), representing the current chessboard status.
- Uses the Stockfish chess engine to suggest the best moves:
- ELO Rating: Adjusts suggestions based on the configured skill level.
- Game Modes:
- Normal: The robotic arm plays the move suggested by Stockfish.
- Educational: A button allows the child to see and optionally play the suggested best move.
- Sends the complete game details to a backend server after the game ends for analysis and storage.
-
Clone the Repository:
git clone https://github.com/RoboKnight-INSAT/ChessBotVision.git cd ChessBotVision -
Install Dependencies:
- Ensure Python 3.8+ is installed.
- Install the required Python libraries:
pip install -r requirements.txt
-
Download YOLO Models:
- The models are expoted in "best_chesspiece_model.pt" and "best_corner_detection_model.pt"
-
Configure Stockfish:
- Download the Stockfish engine and place it in the
engines/directory. - Update the configuration file to set the path to Stockfish.
- Download the Stockfish engine and place it in the
-
Connect Hardware:
- Ensure the robotic arm and any additional hardware are connected and configured.
-
Start the Chess Coach:
python main.py
-
Select Game Mode:
- Choose between Educational or Normal mode in the LCD Interface.
-
Play the Game:
- Follow the prompts for move suggestions, or let the robotic arm play in normal mode.
-
End of Game:
- Game data will be automatically sent to the backend server.
Directory structure:
└── roboknights-insat-chessbotvision/
├── README.md
├── requirements.txt
├── images/
├── models/
│ ├── best_chesspiece_model.pt
│ └── best_corner_detection_model.pt
├── notebooks/
│ ├── app.ipynb
│ └── chess_move_detection.ipynb
├── outputs/
├── src/
│ ├── app.py
│ ├── lcd.py
│ ├── main.py
│ └── stockfish_test.py
└── tools/
├── ChessTools.py
└── computer_vision_tools.py
This project is licensed under the MIT License.