# poboisvert/gptars_interstellar architecture

> Architecture diagram of the GitHub repository poboisvert/gptars_interstellar, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-03-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/poboisvert/gptars_interstellar
- Repository: https://github.com/poboisvert/gptars_interstellar

## Overview

- TARSRunner.py – the entry point that initializes the system, handles communication (notably with a Bluetooth remote), and orchestrates the overall operation.
- ServoAbstractor.py – a layer that combines the basic servo movements into higher-level walking or movement functions.
- ServoController.py – the low-level module that communicates directly with the Adafruit PCA9685 16-channel PWM/servo driver to control individual servo motors.

##### Main Components
a. Onboard Computer (Raspberry Pi): Represent the Raspberry Pi as the central processing unit running the Python code.
c. Servo Abstractor Module: Show this as the logic layer that takes TARSRunner’s high-level instructions and converts them into a sequence of servo actions.
d. Servo Controller Module: Present this as the hardware interface layer that converts commands into precise signals to the servo driver.
e. Adafruit PCA9685 Servo Driver: Represent this external hardware component that receives commands from the Servo Controller and drives multiple servo motors.
f. Servo Motors: Include these as the actuators that perform the mechanical movements.

##### Relationships and Interactions
- The Servo Abstractor then “calls” the Servo Controller for basic movement primitives.
- The Servo Controller sends control signals to the Adafruit PCA9685.
- Finally, the PCA9685 drives the individual servo motors.

##### Architectural Patterns and Design Principles
- A layered architecture where high-level decision making (TARSRunner) is separated from low-level hardware interfacing (ServoController).
- Modular division between combining functions (Servo Abstractor) and basic hardware control.
- That the design allows for extensibility—for example, adding more movement routines in the Abstractor or integrating additional sensors.

##### Relevant Technologies and Components
- Hardware: Raspberry Pi, Adafruit PCA9685, servo motors, Bluetooth module.
- Software: Python scripts that encapsulate control logic.
- External interfaces: Bluetooth controlled input, and possibly user interface elements if further extended.

##### Final Advice
- Be as detailed as possible for clarity, ensuring that every component and its interactions are captured.
- Don’t hesitate to break down the flow – even if it appears “simple” – to show where enhancements or debugging steps might be implemented.

Happy diagramming!

## Diagram (Mermaid)

```mermaid
flowchart TD
    BT["Bluetooth Remote"]:::hardware
    RPi["Onboard Computer (Raspberry Pi)"]:::hardware
    TR["TARSRunner"]:::software
    SA["Servo Abstractor"]:::software
    SC["Servo Controller"]:::software
    PCA["Adafruit PCA9685 Servo Driver"]:::hardware
    SM["Servo Motors"]:::hardware
    CD["Physical Design (CAD)"]:::external

    %% Main control flow
    BT -->|"sendsCommand"| TR
    RPi ---|"hosts"| TR
    TR -->|"instructs"| SA
    RPi ---|"hosts"| SA
    SA -->|"calls"| SC
    RPi ---|"hosts"| SC
    SC -->|"controls"| PCA
    PCA -->|"drives"| SM
    SM -->|"feedback"| RPi
    RPi ---|"CAD_Ref"| CD

    %% Click Events
    click TR "https://github.com/poboisvert/gptars_interstellar/blob/main/TARSRunner.py"
    click SA "https://github.com/poboisvert/gptars_interstellar/blob/main/ServoAbstractor.py"
    click SC "https://github.com/poboisvert/gptars_interstellar/blob/main/ServoController.py"
    click CD "https://github.com/poboisvert/gptars_interstellar/blob/main/525125.STEP"

    %% Styles
    classDef software fill:#AED6F1,stroke:#2874A6,stroke-width:2px;
    classDef hardware fill:#F9E79F,stroke:#D4AC0D,stroke-width:2px;
    classDef external fill:#F5B7B1,stroke:#C0392B,stroke-width:2px,stroke-dasharray: 5 5;
```
