# broncospace-lab/fprime-scales-ref architecture

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

- Interactive diagram: https://gitdiagram.com/broncospace-lab/fprime-scales-ref
- Repository: https://github.com/broncospace-lab/fprime-scales-ref

## Overview

SCALES is an F′ flight-software project for edge computing and autonomous learning across an IMX compute module and a Jetson. The principal workflow is command-driven: deploy the platform topology, capture and transfer camera images on Jetson, then configure an ML component to classify images and report results. Separate scripts support model training/inference, dictionary merging, and graph-friendly data-product exports. The graph includes documented capabilities even where topology wiring was not sampled; dashed edges mark relationships not verified in source excerpts.

Main entry points: [`Components/MLComponent/MLComponent.py`](https://github.com/broncospace-lab/fprime-scales-ref/blob/main/Components/MLComponent/MLComponent.py) (ML Command Component), [`Components/RunLucidCamera/RunLucidCamera.cpp`](https://github.com/broncospace-lab/fprime-scales-ref/blob/main/Components/RunLucidCamera/RunLucidCamera.cpp) (Lucid Camera), [`JetsonDeployment/Top/JetsonDeploymentTopology.cpp`](https://github.com/broncospace-lab/fprime-scales-ref/blob/main/JetsonDeployment/Top/JetsonDeploymentTopology.cpp) (Jetson Deployment), [`ImxDeployment/Top/ImxDeploymentTopology.cpp`](https://github.com/broncospace-lab/fprime-scales-ref/blob/main/ImxDeployment/Top/ImxDeploymentTopology.cpp) (IMX Deployment)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_deploy["Flight Deployments"]
  node_imx["IMX Deployment"]
  node_jetson["Jetson Deployment"]
end

subgraph group_components["Flight Components"]
  node_seqforward["Sequence Forwarder"]
  node_camera["Lucid Camera<br/>[RunLucidCamera.cpp]"]
  node_mlcomponent["ML Command Component<br/>[MLComponent.py]"]
  node_pycomponent["Python Component<br/>[PythonComponent.py]"]
end

subgraph group_ml["ML Workloads"]
  node_resnet_cifar["CIFAR Inference<br/>[resnet_cifar100.py]"]
  node_resnet_inference["Folder Inference"]
  node_fps["FPS Counter<br/>[resnet_fps.py]"]
  node_nanny["Nanny ResNet<br/>[nanny_resnet.py]"]
  node_training["ResNet Training"]
  node_reference_gen["Reference Generator"]
end

subgraph group_ops["Ground Data Tools"]
  node_dict_merger["Dictionary Merger<br/>[merger.py]"]
  node_csv_export["Container CSV Export"]
end

node_operator(("Operator"))
node_camera_device["Lucid Camera Device"]
node_image_store[("Image Files")]
node_filedownlink["File Downlink"]
node_dict_sources["Deployment Dictionaries"]
node_data_products["Decoded Data Products"]
node_csv_files["Graph-ready CSVs"]

node_operator -.->|"starts"| node_imx
node_operator -.->|"starts"| node_jetson
node_imx -.->|"hosts"| node_seqforward
node_jetson -.->|"hosts"| node_camera
node_jetson -.->|"hosts"| node_mlcomponent
node_camera -->|"captures from"| node_camera_device
node_camera -->|"saves image"| node_image_store
node_camera -->|"sends file"| node_filedownlink
node_filedownlink -.->|"transfers image"| node_image_store
node_operator -.->|"configures"| node_mlcomponent
node_mlcomponent -->|"dispatches"| node_resnet_cifar
node_mlcomponent -->|"dispatches"| node_resnet_inference
node_mlcomponent -.->|"reads images"| node_image_store
node_dict_sources -.->|"merges dictionaries"| node_dict_merger
node_data_products -->|"decodes JSON"| node_csv_export
node_csv_export -->|"writes CSVs"| node_csv_files

click node_imx "https://github.com/broncospace-lab/fprime-scales-ref/blob/main/ImxDeployment/Top/ImxDeploymentTopology.cpp"
click node_jetson "https://github.com/broncospace-lab/fprime-scales-ref/blob/main/JetsonDeployment/Top/JetsonDeploymentTopology.cpp"
click node_seqforward "https://github.com/broncospace-lab/fprime-scales-ref/blob/main/Components/CmdSequenceForwarder/CmdSequenceForwarder.cpp"
click node_camera "https://github.com/broncospace-lab/fprime-scales-ref/blob/main/Components/RunLucidCamera/RunLucidCamera.cpp"
click node_mlcomponent "https://github.com/broncospace-lab/fprime-scales-ref/blob/main/Components/MLComponent/MLComponent.py"
click node_pycomponent "https://github.com/broncospace-lab/fprime-scales-ref/blob/main/Components/PythonComponent/PythonComponent.py"
click node_resnet_cifar "https://github.com/broncospace-lab/fprime-scales-ref/blob/main/build-python-fprime/resnet_cifar100.py"
click node_resnet_inference "https://github.com/broncospace-lab/fprime-scales-ref/blob/main/build-python-fprime/resnet_inference.py"
click node_fps "https://github.com/broncospace-lab/fprime-scales-ref/blob/main/build-python-fprime/resnet_fps.py"
click node_nanny "https://github.com/broncospace-lab/fprime-scales-ref/blob/main/build-python-fprime/nanny_resnet.py"
click node_training "https://github.com/broncospace-lab/fprime-scales-ref/blob/main/build-python-fprime/resnet_training_hg.py"
click node_reference_gen "https://github.com/broncospace-lab/fprime-scales-ref/blob/main/build-python-fprime/resnet_reference_gen.py"
click node_dict_merger "https://github.com/broncospace-lab/fprime-scales-ref/blob/main/GDS-Dictionary/merger.py"
click node_csv_export "https://github.com/broncospace-lab/fprime-scales-ref/blob/main/DataProducts/merge_data_products_by_container.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_imx,node_jetson toneBlue
class node_seqforward,node_camera,node_mlcomponent,node_pycomponent,node_image_store toneAmber
class node_resnet_cifar,node_resnet_inference,node_fps,node_nanny,node_training,node_reference_gen toneMint
class node_dict_merger,node_csv_export toneRose
class node_operator,node_camera_device,node_filedownlink,node_dict_sources,node_data_products,node_csv_files toneIndigo
```

## Components

### Flight Deployments

- [IMX Deployment](https://github.com/broncospace-lab/fprime-scales-ref/blob/main/ImxDeployment/Top/ImxDeploymentTopology.cpp): `ImxDeployment/Top/ImxDeploymentTopology.cpp`
- [Jetson Deployment](https://github.com/broncospace-lab/fprime-scales-ref/blob/main/JetsonDeployment/Top/JetsonDeploymentTopology.cpp): `JetsonDeployment/Top/JetsonDeploymentTopology.cpp`

### Flight Components

- [Sequence Forwarder](https://github.com/broncospace-lab/fprime-scales-ref/blob/main/Components/CmdSequenceForwarder/CmdSequenceForwarder.cpp): `Components/CmdSequenceForwarder/CmdSequenceForwarder.cpp`
- [Lucid Camera](https://github.com/broncospace-lab/fprime-scales-ref/blob/main/Components/RunLucidCamera/RunLucidCamera.cpp): `Components/RunLucidCamera/RunLucidCamera.cpp`
- [ML Command Component](https://github.com/broncospace-lab/fprime-scales-ref/blob/main/Components/MLComponent/MLComponent.py): `Components/MLComponent/MLComponent.py`
- [Python Component](https://github.com/broncospace-lab/fprime-scales-ref/blob/main/Components/PythonComponent/PythonComponent.py): `Components/PythonComponent/PythonComponent.py`

### ML Workloads

- [CIFAR Inference](https://github.com/broncospace-lab/fprime-scales-ref/blob/main/build-python-fprime/resnet_cifar100.py): `build-python-fprime/resnet_cifar100.py`
- [Folder Inference](https://github.com/broncospace-lab/fprime-scales-ref/blob/main/build-python-fprime/resnet_inference.py): `build-python-fprime/resnet_inference.py`
- [FPS Counter](https://github.com/broncospace-lab/fprime-scales-ref/blob/main/build-python-fprime/resnet_fps.py): `build-python-fprime/resnet_fps.py`
- [Nanny ResNet](https://github.com/broncospace-lab/fprime-scales-ref/blob/main/build-python-fprime/nanny_resnet.py): `build-python-fprime/nanny_resnet.py`
- [ResNet Training](https://github.com/broncospace-lab/fprime-scales-ref/blob/main/build-python-fprime/resnet_training_hg.py): `build-python-fprime/resnet_training_hg.py`
- [Reference Generator](https://github.com/broncospace-lab/fprime-scales-ref/blob/main/build-python-fprime/resnet_reference_gen.py): `build-python-fprime/resnet_reference_gen.py`

### Ground Data Tools

- [Dictionary Merger](https://github.com/broncospace-lab/fprime-scales-ref/blob/main/GDS-Dictionary/merger.py): `GDS-Dictionary/merger.py`
- [Container CSV Export](https://github.com/broncospace-lab/fprime-scales-ref/blob/main/DataProducts/merge_data_products_by_container.py): `DataProducts/merge_data_products_by_container.py`

### Other components

- **Operator**
- **Lucid Camera Device**
- **Image Files**
- **File Downlink**
- **Deployment Dictionaries**
- **Decoded Data Products**
- **Graph-ready CSVs**

## Connections

- Operator → IMX Deployment: starts (evidence: `README.md`)
- Operator → Jetson Deployment: starts (evidence: `README.md`)
- IMX Deployment → Sequence Forwarder: hosts (evidence: `README.md`)
- Jetson Deployment → Lucid Camera: hosts (evidence: `README.md`)
- Jetson Deployment → ML Command Component: hosts (evidence: `README.md`)
- Lucid Camera → Lucid Camera Device: captures from (evidence: `Components/RunLucidCamera/RunLucidCamera.cpp`)
- Lucid Camera → Image Files: saves image (evidence: `Components/RunLucidCamera/RunLucidCamera.cpp`)
- Lucid Camera → File Downlink: sends file (evidence: `Components/RunLucidCamera/RunLucidCamera.cpp`)
- File Downlink → Image Files: transfers image
- Operator → ML Command Component: configures (evidence: `README.md`)
- ML Command Component → CIFAR Inference: dispatches (evidence: `Components/MLComponent/MLComponent.py`)
- ML Command Component → Folder Inference: dispatches (evidence: `Components/MLComponent/MLComponent.py`)
- ML Command Component → Image Files: reads images
- Deployment Dictionaries → Dictionary Merger: merges dictionaries (evidence: `README.md`)
- Decoded Data Products → Container CSV Export: decodes JSON (evidence: `DataProducts/merge_data_products_by_container.py`)
- Container CSV Export → Graph-ready CSVs: writes CSVs (evidence: `DataProducts/merge_data_products_by_container.py`)
