# bhsaztecs/eden architecture

> Architecture diagram of the GitHub repository bhsaztecs/eden, 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/bhsaztecs/eden
- Repository: https://github.com/bhsaztecs/eden

## Overview

##### Main Components
- Library Core – The central functionality provided by Eden is implemented in the src and include directories. Key modules include:
○ IRoC.cpp – Likely responsible for high-level control or integration interfacing with the robot's operating context.
○ declarations.cpp & declarations.h – Contain core declarations used across the library.
○ interface.cpp & interface.h – Provide the user-facing API for interacting with the robotic system.
○ motor.cpp, sensor.cpp, servo.cpp, pathfind.cpp – Each file handles a specific hardware component or control functionality.
○ misc.cpp – Supporting miscellaneous functions.
- Example Usage – The data/example.cpp shows users how to use the library in practice.
- Configuration & Build Tools – Files like project.manifest and data/shfuncs (plus the GitHub workflows) indicate how the library is integrated and compiled in the KIPR ecosystem.
- External Library Dependency – The README references KIPR’s libwallaby as a dependency, which underlies the abstraction this library provides.

##### Relationships and Interactions
- Within Eden, each module (motor, sensor, servo, pathfinding) interacts with the main interface and declarations components to provide a unified API.
- The build/compilation process (managed by GitHub workflows and scripts in data/shfuncs) takes the source code and produces either a standalone executable or a library, as indicated by the compile command options.
- The project manifest file configures integration with the robot’s file system (/home/kipr/Documents/KISS/...).

##### Architectural Patterns and Design Principles
- Modular design – The clear separation between modules (each hardware/functionality component in its own source file) reflects a modular approach.
- Abstraction Layer – Eden abstracts the details of KIPR’s low-level library (libwallaby) behind a simplified interface.
- Build and Integration automation – Use of GitHub Actions (.github/workflows/compile.yml) and shell functions (data/shfuncs) demonstrates an emphasis on automated compilation and deployment.

##### Relevant Technologies and Tools
- C++ is the primary language (evidenced by the .cpp and .h files).
- Git and GitHub for version control and CI/CD (GitHub Actions defined in .github).
- The target deployment is on a robot environment with a specific file structure (KISS folder format) and permissions adjustments (as seen in the troubleshooting section).

##### Instructing the Principal Software Engineer
- Clear, labeled blocks for:
○ “Eden Library Core” with submodules: Interface, Declarations, Motor, Sensor, Servo, Pathfinding, Miscellaneous, and IRoC.
○ “Build & Deployment” components: GitHub Actions (compile.yml), shell functions (data/shfuncs), project manifest configuration.
○ “Example Usage” – a block representing data/example.cpp which illustrates usage.
○ “External Dependency” – connection to KIPR’s libwallaby.
○ Data flow from example code/user code → Eden’s interface.
○ Internal dependencies between the interface and its underlying modules.
○ The build flow from source files + configuration → compile process → deployment into the robot’s file system.
○ Core modules (perhaps as rectangles)

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Eden Library Core"
        IRoC["IRoC Module"]
        DECL["Declarations Module"]
        INT["Interface Module"]
        MOTOR["Motor Control Module"]
        SENSOR["Sensor Processing Module"]
        SERVO["Servo Management Module"]
        PATH["Pathfinding Module"]
        MISC["Miscellaneous Functions Module"]
    end

    subgraph "Build & Deployment"
        GHA["GitHub Actions Workflow"]
        SHF["Shell Functions Script"]
        MANIFEST["Project Manifest"]
    end

    EXUSAGE["Example Usage"]
    BUILDPROCESS["Build Process"]
    DEPLOY["Robot Deployment (KISS Directory)"]
    EXTERNAL["KIPR's libwallaby"]

    %% Relationships: User code flows into the interface
    EXUSAGE -->|"uses"| INT

    %% Internal module dependencies: Interface calls core modules
    INT -->|"calls"| IRoC
    INT -->|"calls"| DECL
    INT -->|"calls"| MOTOR
    INT -->|"calls"| SENSOR
    INT -->|"calls"| SERVO
    INT -->|"calls"| PATH
    INT -->|"calls"| MISC

    %% Build flow: Source modules and build configuration enter the build process then deploy
    IRoC --> BUILDPROCESS
    DECL --> BUILDPROCESS
    INT --> BUILDPROCESS
    MOTOR --> BUILDPROCESS
    SENSOR --> BUILDPROCESS
    SERVO --> BUILDPROCESS
    PATH --> BUILDPROCESS
    MISC --> BUILDPROCESS
    GHA --> BUILDPROCESS
    SHF --> BUILDPROCESS
    MANIFEST --> BUILDPROCESS
    BUILDPROCESS --> DEPLOY

    %% External dependency integration from Interface to external library
    INT -->|"integrates"| EXTERNAL

    %% Click Events
    click IRoC "https://github.com/bhsaztecs/eden/blob/main/src/IRoC.cpp"
    click DECL "https://github.com/bhsaztecs/eden/blob/main/src/declarations.cpp"
    click DECL "https://github.com/bhsaztecs/eden/blob/main/include/declarations.h"
    click INT "https://github.com/bhsaztecs/eden/blob/main/src/interface.cpp"
    click INT "https://github.com/bhsaztecs/eden/blob/main/include/interface.h"
    click MOTOR "https://github.com/bhsaztecs/eden/blob/main/src/motor.cpp"
    click SENSOR "https://github.com/bhsaztecs/eden/blob/main/src/sensor.cpp"
    click SERVO "https://github.com/bhsaztecs/eden/blob/main/src/servo.cpp"
    click PATH "https://github.com/bhsaztecs/eden/blob/main/src/pathfind.cpp"
    click MISC "https://github.com/bhsaztecs/eden/blob/main/src/misc.cpp"
    click EXUSAGE "https://github.com/bhsaztecs/eden/blob/main/data/example.cpp"
    click GHA "https://github.com/bhsaztecs/eden/blob/main/.github/workflows/compile.yml"
    click SHF "https://github.com/bhsaztecs/eden/tree/main/data/shfuncs"
    click MANIFEST "https://github.com/bhsaztecs/eden/blob/main/project.manifest"

    %% Class definitions for styling
    class IRoC,DECL,INT,MOTOR,SENSOR,SERVO,PATH,MISC coreModule
    class GHA,SHF,MANIFEST buildComponent
    class EXUSAGE exampleUsage
    class EXTERNAL external
    class BUILDPROCESS,DEPLOY buildProcess

    %% Style definitions with color and border settings
    classDef coreModule fill:#ADD8E6,stroke:#000,stroke-width:1px;
    classDef buildComponent fill:#90EE90,stroke:#000,stroke-width:1px;
    classDef exampleUsage fill:#FFFF99,stroke:#000,stroke-width:1px;
    classDef external fill:#FFA500,stroke:#000,stroke-width:1px;
    classDef buildProcess fill:#D3D3D3,stroke:#000,stroke-width:1px;
```
