<!-- Generated by scripts/sync-agent-content.mjs. Edit the shared public sources, then regenerate. -->
# VictorIA

A robot arm that reads a board and plays Connect Four.

- Dates: 2025
- Status: Robotics prototype
- Areas: Software engineering; Robotics; AI / ML
- Stack: Python · OpenCV · SAM 2 · ROS
- Topics: Python; Game AI; Computer Vision; Robotics; Physical Computing
- Public case study: https://mgiorgetti.com/project_details/project-victoria.html

## Problem

A robot playing Connect Four must translate a camera view into a stable board state and then execute a legal move on the physical board.

## Contribution

Robotics lab prototype integrating board calibration, computer vision, game-state interpretation, search and a ROS-controlled arm.

## Technical approach and public case study

A robot arm that plays Connect 4 on a real board.

- Robotics lab project

- Python · OpenCV · SAM 2

- Working prototype

A webcam reads the board; the arm picks up and places the robot’s discs.

### Reading the board and choosing a move

Calibration locates the board before play. The repeated work on each turn uses a smaller cell classifier.

- Find the board SAM 2 segments it from a few clicked points. A perspective warp converts the camera view into a flat grid.

- Read the move A cell classifier assembles the 6 × 7 board state, checking where a new disc could have landed.

- Choose a column Minimax searches five plies with alpha-beta pruning to select the next move.

- Place the disc The selected column is sent over HTTP to the arm's ROS machine, which picks up a disc and drops it into place.

### A full match against VictorIA

### Vision on the Mac, movement on ROS

**On the Mac**

Board calibration, cell recognition, game state, and move selection.

**On the arm's machine**

ROS control, disc pickup, column positioning, and travel poses.

**Between them**

An HTTP move endpoint carries the chosen column.

A player adds a disc while the camera observes the board.

The arm aligns with the selected column.

## Results and limitations

The public case study includes a full-match demonstration and source links. It does not report perception accuracy, win rate or generalized manipulation performance.

## Public supporting links

- [Portfolio case study](https://mgiorgetti.com/project_details/project-victoria.html)
- [View repository](https://github.com/Inventure71/VictorIA)
- [Watch demo](https://youtu.be/D_wXBm4Uxi0)
- [Matteo Giorgetti profile](https://mgiorgetti.com/profile.md)
