# snrathod1/555wheelchair architecture

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

- Interactive diagram: https://gitdiagram.com/snrathod1/555wheelchair
- Repository: https://github.com/snrathod1/555wheelchair

## Overview

##### Project type and purpose
- This is a robotics control software project (“555wheelchair”) for driving a motorized wheelchair via a gamepad.
- The presence of Python2 and Python3 versions shows an evolution of the same control logic.

##### File structure
- Top-level:
- README.md – project title only
- Working_Python2/ – legacy codebase targeting Python 2
- Working_Python3/ – current codebase targeting Python 3
- Under Working_Python3 (current):
- main.py & main_experimental.py – entry points (control loops)
- flag.py – global flags / configuration
- gamepad15.py – gamepad input interface
- mapping.py – raw-input to control-value mapper
- motorsAlgorithm.py – core steering / throttle algorithm
- motor.py – motor hardware abstraction
- motor_deprecated.py – old motor code kept for reference

##### README for additional insights
- README only contains the project name; no architecture details. All knowledge must come from file names and common robotics software patterns.

##### Elements
- Blue for input modules
- Green for processing/algorithm modules
- Orange for hardware interface modules

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Active Python3 Branch
    subgraph "Active (Python3)"
        Main1["main.py"]:::orchestrator
        MainExp["main_experimental.py"]:::orchestrator
        Flag["flag.py"]:::config
        GP["gamepad15.py"]:::input
        Map["mapping.py"]:::processing
        Alg["motorsAlgorithm.py"]:::processing
        MotorIF["motor.py"]:::hardware
    end

    %% Legacy Python2 Branch
    subgraph "Legacy (Python2)"
        GP2["gamepad15.py"]:::legacy
        Alg2["motorsAlgorithm.py"]:::legacy
        Motor2["motor.py"]:::legacy
    end

    %% Hardware Node
    HD["Motor Drivers & Wheels"]:::hardware

    %% Data Flows Active
    GP -->|"joystick events"| Main1
    Flag -.->|"configuration flags"| Main1
    Main1 -->|"raw input events"| Map
    Map -->|"normalized controls"| Alg
    Alg -->|"computed motor speeds"| MotorIF
    MotorIF -->|"PWM/GPIO signals"| HD

    MainExp -.-> Main1

    %% Data Flows Legacy
    GP2 -->|"joystick events"| Alg2
    Alg2 -->|"computed speeds"| Motor2
    Motor2 -->|"PWM/GPIO signals"| HD

    %% Click Events
    click GP "https://github.com/snrathod1/555wheelchair/blob/master/Working_Python3/gamepad15.py"
    click Flag "https://github.com/snrathod1/555wheelchair/blob/master/Working_Python3/flag.py"
    click Map "https://github.com/snrathod1/555wheelchair/blob/master/Working_Python3/mapping.py"
    click Alg "https://github.com/snrathod1/555wheelchair/blob/master/Working_Python3/motorsAlgorithm.py"
    click MotorIF "https://github.com/snrathod1/555wheelchair/blob/master/Working_Python3/motor.py"
    click Main1 "https://github.com/snrathod1/555wheelchair/blob/master/Working_Python3/main.py"
    click MainExp "https://github.com/snrathod1/555wheelchair/blob/master/Working_Python3/main_experimental.py"
    click GP2 "https://github.com/snrathod1/555wheelchair/blob/master/Working_Python2/gamepad15.py"
    click Alg2 "https://github.com/snrathod1/555wheelchair/blob/master/Working_Python2/motorsAlgorithm.py"
    click Motor2 "https://github.com/snrathod1/555wheelchair/blob/master/Working_Python2/motor.py"

    %% Styles
    classDef input fill:#add8e6,stroke:#000,stroke-width:1px
    classDef config fill:#b0c4de,stroke:#000,stroke-width:1px
    classDef processing fill:#90ee90,stroke:#000,stroke-width:1px
    classDef hardware fill:#ffa500,stroke:#000,stroke-width:1px
    classDef orchestrator fill:#dda0dd,stroke:#000,stroke-width:1px
    classDef legacy fill:#d3d3d3,stroke:#000,stroke-width:1px,stroke-dasharray: 5 5
```
