# oresat/oresat-star-tracker-software architecture

> Architecture diagram of the GitHub repository oresat/oresat-star-tracker-software, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-30). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/oresat/oresat-star-tracker-software
- Repository: https://github.com/oresat/oresat-star-tracker-software

## Overview

OreSat Star Tracker is an OLAF/CANopen application that captures camera images, optionally filters or saves them, and estimates spacecraft attitude with LOST for reporting over the service object dictionary and CAN TPDOs. Its development web page exposes a Flask-based integration surface. A separate Python wrapper supports generating LOST databases. The main capture-to-attitude path is visible in the service and native binding excerpts; broader OLAF and CANopen internals are external dependencies.

Main entry points: [`oresat_star_tracker/star_tracker_service.py`](https://github.com/oresat/oresat-star-tracker-software/blob/master/oresat_star_tracker/star_tracker_service.py) (Tracker service), [`oresat_star_tracker/__main__.py`](https://github.com/oresat/oresat-star-tracker-software/blob/master/oresat_star_tracker/__main__.py) (App entry point), [`oresat_star_tracker/camera.py`](https://github.com/oresat/oresat-star-tracker-software/blob/master/oresat_star_tracker/camera.py) (Camera driver), [`oresat_star_tracker/_lost_core.cpp`](https://github.com/oresat/oresat-star-tracker-software/blob/master/oresat_star_tracker/_lost_core.cpp) (LOST estimate binding)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["App runtime"]
  node_app["App entry point<br/>[__main__.py]"]
  node_service["Tracker service"]
  node_web["Development page<br/>[star_tracker.html]"]
end

subgraph group_imaging["Image acquisition"]
  node_camera["Camera driver<br/>[camera.py]"]
  node_demosaic["Bayer demosaicing<br/>[camera.py]"]
  node_mock_images["Mock image resources"]
end

subgraph group_solving["Attitude solving"]
  node_solver["LOST estimate binding<br/>[_lost_core.cpp]"]
  node_catalog["Star catalog"]
  node_database[("LOST solve database<br/>[py-database.dat]")]
  node_db_wrapper["Database generation wrapper<br/>[wrapper.py]"]
  node_db_config["Database configurations<br/>[types.py]"]
end

subgraph group_integration["Integration and data"]
  node_attitude["Attitude outputs"]
  node_capture_cache[("Capture file cache")]
end

node_operator(("Operator"))
node_camera_hw["AR013x device"]
node_olaf["OLAF / CANopen"]
node_lost_cli["LOST CLI"]

node_operator -->|"starts app"| node_app
node_app -->|"registers service"| node_service
node_app -->|"registers template"| node_web
node_app -->|"runs framework"| node_olaf
node_service -->|"captures images"| node_camera
node_camera -->|"reads frames"| node_camera_hw
node_camera -->|"demosaics frames"| node_demosaic
node_camera -->|"loads mock frames"| node_mock_images
node_service -->|"estimates attitude"| node_solver
node_solver -->|"loads catalog"| node_catalog
node_solver -->|"solves against"| node_database
node_service -->|"updates orientation"| node_attitude
node_service -->|"sends TPDOs"| node_olaf
node_service -->|"caches captures"| node_capture_cache
node_operator -->|"views development page"| node_web
node_db_config -->|"configures generation"| node_db_wrapper
node_db_wrapper -->|"runs command"| node_lost_cli

click node_app "https://github.com/oresat/oresat-star-tracker-software/blob/master/oresat_star_tracker/__main__.py"
click node_service "https://github.com/oresat/oresat-star-tracker-software/blob/master/oresat_star_tracker/star_tracker_service.py"
click node_web "https://github.com/oresat/oresat-star-tracker-software/blob/master/oresat_star_tracker/templates/star_tracker.html"
click node_camera "https://github.com/oresat/oresat-star-tracker-software/blob/master/oresat_star_tracker/camera.py"
click node_demosaic "https://github.com/oresat/oresat-star-tracker-software/blob/master/oresat_star_tracker/camera.py"
click node_mock_images "https://github.com/oresat/oresat-star-tracker-software/tree/master/oresat_star_tracker/data"
click node_solver "https://github.com/oresat/oresat-star-tracker-software/blob/master/oresat_star_tracker/_lost_core.cpp"
click node_catalog "https://github.com/oresat/oresat-star-tracker-software/blob/master/oresat_star_tracker/data/bright-star-catalog.tsv"
click node_database "https://github.com/oresat/oresat-star-tracker-software/blob/master/oresat_star_tracker/data/py-database.dat"
click node_attitude "https://github.com/oresat/oresat-star-tracker-software/blob/master/oresat_star_tracker/star_tracker_service.py"
click node_capture_cache "https://github.com/oresat/oresat-star-tracker-software/blob/master/oresat_star_tracker/star_tracker_service.py"
click node_db_wrapper "https://github.com/oresat/oresat-star-tracker-software/blob/master/oresat_star_tracker/lost/wrapper.py"
click node_db_config "https://github.com/oresat/oresat-star-tracker-software/blob/master/oresat_star_tracker/lost/types.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_app,node_service,node_web toneBlue
class node_camera,node_demosaic,node_mock_images toneAmber
class node_solver,node_catalog,node_database,node_db_wrapper,node_db_config toneMint
class node_attitude,node_capture_cache toneRose
class node_operator,node_camera_hw,node_olaf,node_lost_cli toneIndigo
```

## Components

### App runtime

- [App entry point](https://github.com/oresat/oresat-star-tracker-software/blob/master/oresat_star_tracker/__main__.py): `oresat_star_tracker/__main__.py`
- [Tracker service](https://github.com/oresat/oresat-star-tracker-software/blob/master/oresat_star_tracker/star_tracker_service.py): `oresat_star_tracker/star_tracker_service.py`
- [Development page](https://github.com/oresat/oresat-star-tracker-software/blob/master/oresat_star_tracker/templates/star_tracker.html): `oresat_star_tracker/templates/star_tracker.html`

### Image acquisition

- [Camera driver](https://github.com/oresat/oresat-star-tracker-software/blob/master/oresat_star_tracker/camera.py): `oresat_star_tracker/camera.py`
- [Bayer demosaicing](https://github.com/oresat/oresat-star-tracker-software/blob/master/oresat_star_tracker/camera.py): `oresat_star_tracker/camera.py`
- [Mock image resources](https://github.com/oresat/oresat-star-tracker-software/tree/master/oresat_star_tracker/data): `oresat_star_tracker/data`

### Attitude solving

- [LOST estimate binding](https://github.com/oresat/oresat-star-tracker-software/blob/master/oresat_star_tracker/_lost_core.cpp): `oresat_star_tracker/_lost_core.cpp`
- [Star catalog](https://github.com/oresat/oresat-star-tracker-software/blob/master/oresat_star_tracker/data/bright-star-catalog.tsv): `oresat_star_tracker/data/bright-star-catalog.tsv`
- [LOST solve database](https://github.com/oresat/oresat-star-tracker-software/blob/master/oresat_star_tracker/data/py-database.dat): `oresat_star_tracker/data/py-database.dat`
- [Database generation wrapper](https://github.com/oresat/oresat-star-tracker-software/blob/master/oresat_star_tracker/lost/wrapper.py): `oresat_star_tracker/lost/wrapper.py`
- [Database configurations](https://github.com/oresat/oresat-star-tracker-software/blob/master/oresat_star_tracker/lost/types.py): `oresat_star_tracker/lost/types.py`

### Integration and data

- [Attitude outputs](https://github.com/oresat/oresat-star-tracker-software/blob/master/oresat_star_tracker/star_tracker_service.py): `oresat_star_tracker/star_tracker_service.py`
- [Capture file cache](https://github.com/oresat/oresat-star-tracker-software/blob/master/oresat_star_tracker/star_tracker_service.py): `oresat_star_tracker/star_tracker_service.py`

### Other components

- **Operator**
- **AR013x device**
- **OLAF / CANopen**
- **LOST CLI**

## Connections

- Operator → App entry point: starts app (evidence: `README.md`)
- App entry point → Tracker service: registers service (evidence: `oresat_star_tracker/__main__.py`)
- App entry point → Development page: registers template (evidence: `oresat_star_tracker/__main__.py`)
- App entry point → OLAF / CANopen: runs framework (evidence: `oresat_star_tracker/__main__.py`)
- Tracker service → Camera driver: captures images (evidence: `oresat_star_tracker/star_tracker_service.py`)
- Camera driver → AR013x device: reads frames (evidence: `oresat_star_tracker/camera.py`)
- Camera driver → Bayer demosaicing: demosaics frames (evidence: `oresat_star_tracker/camera.py`)
- Camera driver → Mock image resources: loads mock frames (evidence: `oresat_star_tracker/camera.py`)
- Tracker service → LOST estimate binding: estimates attitude (evidence: `oresat_star_tracker/star_tracker_service.py`)
- LOST estimate binding → Star catalog: loads catalog (evidence: `oresat_star_tracker/_lost_core.cpp`)
- LOST estimate binding → LOST solve database: solves against (evidence: `oresat_star_tracker/_lost_core.cpp`)
- Tracker service → Attitude outputs: updates orientation (evidence: `oresat_star_tracker/star_tracker_service.py`)
- Tracker service → OLAF / CANopen: sends TPDOs (evidence: `oresat_star_tracker/star_tracker_service.py`)
- Tracker service → Capture file cache: caches captures (evidence: `oresat_star_tracker/star_tracker_service.py`)
- Operator → Development page: views development page (evidence: `README.md`)
- Database configurations → Database generation wrapper: configures generation (evidence: `oresat_star_tracker/lost/wrapper.py`)
- Database generation wrapper → LOST CLI: runs command (evidence: `oresat_star_tracker/lost/wrapper.py`)
