# yarindan27/dofbot_tests architecture

> Architecture diagram of the GitHub repository yarindan27/dofbot_tests, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-02). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/yarindan27/dofbot_tests
- Repository: https://github.com/yarindan27/dofbot_tests

## Overview

DOFBOT Chess is a local, interactive chessboard-manipulation application: an operator calibrates the board, tests reach and grasp, then commands piece moves; a camera stream is available alongside those tasks. The main workflow uses a saved three-point board frame and guarded arm motion. A separate master-calibration script provides joint-profile calibration and a detector-based layout audit. The chess-engine module appears to be a stub and is not shown in the main workflow. Some modules are unsampled; edges are limited to relationships visible in excerpts or the SOURCE INDEX.

Main entry points: [`chess_project/config.py`](https://github.com/yarindan27/dofbot_tests/blob/master/chess_project/config.py) (Runtime configuration), [`chess_project/main.py`](https://github.com/yarindan27/dofbot_tests/blob/master/chess_project/main.py) (Chess CLI), [`chess_project/master_calibration.py`](https://github.com/yarindan27/dofbot_tests/blob/master/chess_project/master_calibration.py) (Master calibration), [`chess_project/arm.py`](https://github.com/yarindan27/dofbot_tests/blob/master/chess_project/arm.py) (Safe arm control)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workflow["Operator workflow"]
  node_main["Chess CLI<br/>[main.py]"]
  node_boardframe["Board frame<br/>[chessboard.py]"]
end

subgraph group_motion["Arm motion"]
  node_arm["Safe arm control<br/>[arm.py]"]
  node_kinematics["Arm kinematics<br/>[kinematics.py]"]
  node_servos["DOFBOT hardware"]
  node_armcontrol["Joint control<br/>[arm_control.py]"]
end

subgraph group_vision["Vision and calibration"]
  node_camera["Camera and MJPEG<br/>[camera.py]"]
  node_mastercal["Master calibration"]
  node_mapper["Square joint mapper<br/>[board_mapper.py]"]
  node_detector["Layout detector<br/>[detector.py]"]
end

subgraph group_support["Runtime support"]
  node_config["Runtime configuration<br/>[config.py]"]
end

node_operator(("Operator"))
node_browser(("Stream viewer"))

node_operator -->|"uses"| node_main
node_main -->|"loads and saves"| node_boardframe
node_main -->|"commands moves"| node_arm
node_arm -->|"solves poses"| node_kinematics
node_arm -->|"writes and reads"| node_servos
node_main -->|"starts stream"| node_camera
node_browser -->|"requests stream"| node_camera
node_main -->|"reads settings"| node_config
node_arm -->|"reads limits"| node_config
node_kinematics -->|"reads geometry"| node_config
node_camera -->|"reads stream settings"| node_config
node_operator -->|"runs calibration"| node_mastercal
node_mastercal -->|"commands joints"| node_armcontrol
node_mastercal -->|"requests square joints"| node_mapper
node_mastercal -->|"captures and audits layout"| node_detector
node_detector -->|"uses mapping"| node_mapper
node_armcontrol -->|"writes and reads"| node_servos
node_mastercal -->|"reads profiles"| node_config
node_mapper -->|"imports settings"| node_config
node_detector -->|"imports settings"| node_config

click node_main "https://github.com/yarindan27/dofbot_tests/blob/master/chess_project/main.py"
click node_boardframe "https://github.com/yarindan27/dofbot_tests/blob/master/chess_project/chessboard.py"
click node_arm "https://github.com/yarindan27/dofbot_tests/blob/master/chess_project/arm.py"
click node_kinematics "https://github.com/yarindan27/dofbot_tests/blob/master/chess_project/kinematics.py"
click node_camera "https://github.com/yarindan27/dofbot_tests/blob/master/chess_project/camera.py"
click node_config "https://github.com/yarindan27/dofbot_tests/blob/master/chess_project/config.py"
click node_mastercal "https://github.com/yarindan27/dofbot_tests/blob/master/chess_project/master_calibration.py"
click node_armcontrol "https://github.com/yarindan27/dofbot_tests/blob/master/chess_project/arm_control.py"
click node_mapper "https://github.com/yarindan27/dofbot_tests/blob/master/chess_project/board_mapper.py"
click node_detector "https://github.com/yarindan27/dofbot_tests/blob/master/chess_project/detector.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_main,node_boardframe,node_browser toneBlue
class node_arm,node_kinematics,node_servos,node_armcontrol toneAmber
class node_camera,node_mastercal,node_mapper,node_detector toneMint
class node_config toneRose
class node_operator toneIndigo
```

## Components

### Operator workflow

- [Chess CLI](https://github.com/yarindan27/dofbot_tests/blob/master/chess_project/main.py): `chess_project/main.py`
- [Board frame](https://github.com/yarindan27/dofbot_tests/blob/master/chess_project/chessboard.py): `chess_project/chessboard.py`

### Arm motion

- [Safe arm control](https://github.com/yarindan27/dofbot_tests/blob/master/chess_project/arm.py): `chess_project/arm.py`
- [Arm kinematics](https://github.com/yarindan27/dofbot_tests/blob/master/chess_project/kinematics.py): `chess_project/kinematics.py`
- **DOFBOT hardware**
- [Joint control](https://github.com/yarindan27/dofbot_tests/blob/master/chess_project/arm_control.py): `chess_project/arm_control.py`

### Vision and calibration

- [Camera and MJPEG](https://github.com/yarindan27/dofbot_tests/blob/master/chess_project/camera.py): `chess_project/camera.py`
- [Master calibration](https://github.com/yarindan27/dofbot_tests/blob/master/chess_project/master_calibration.py): `chess_project/master_calibration.py`
- [Square joint mapper](https://github.com/yarindan27/dofbot_tests/blob/master/chess_project/board_mapper.py): `chess_project/board_mapper.py`
- [Layout detector](https://github.com/yarindan27/dofbot_tests/blob/master/chess_project/detector.py): `chess_project/detector.py`

### Runtime support

- [Runtime configuration](https://github.com/yarindan27/dofbot_tests/blob/master/chess_project/config.py): `chess_project/config.py`

### Other components

- **Operator**
- **Stream viewer**

## Connections

- Operator → Chess CLI: uses (evidence: `chess_project/main.py`)
- Chess CLI → Board frame: loads and saves (evidence: `chess_project/main.py`)
- Chess CLI → Safe arm control: commands moves (evidence: `chess_project/main.py`)
- Safe arm control → Arm kinematics: solves poses (evidence: `chess_project/arm.py`)
- Safe arm control → DOFBOT hardware: writes and reads (evidence: `chess_project/arm.py`)
- Chess CLI → Camera and MJPEG: starts stream (evidence: `chess_project/main.py`)
- Stream viewer → Camera and MJPEG: requests stream (evidence: `chess_project/camera.py`)
- Chess CLI → Runtime configuration: reads settings (evidence: `chess_project/main.py`)
- Safe arm control → Runtime configuration: reads limits (evidence: `chess_project/arm.py`)
- Arm kinematics → Runtime configuration: reads geometry (evidence: `chess_project/kinematics.py`)
- Camera and MJPEG → Runtime configuration: reads stream settings (evidence: `chess_project/camera.py`)
- Operator → Master calibration: runs calibration (evidence: `chess_project/master_calibration.py`)
- Master calibration → Joint control: commands joints (evidence: `chess_project/master_calibration.py`)
- Master calibration → Square joint mapper: requests square joints (evidence: `chess_project/master_calibration.py`)
- Master calibration → Layout detector: captures and audits layout (evidence: `chess_project/master_calibration.py`)
- Layout detector → Square joint mapper: uses mapping (evidence: `chess_project/master_calibration.py`)
- Joint control → DOFBOT hardware: writes and reads (evidence: `chess_project/arm_control.py`)
- Master calibration → Runtime configuration: reads profiles (evidence: `chess_project/master_calibration.py`)
- Square joint mapper → Runtime configuration: imports settings (evidence: `chess_project/board_mapper.py`)
- Layout detector → Runtime configuration: imports settings (evidence: `chess_project/detector.py`)
