# superxslam/tartanimu architecture

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

## Overview

TartanIMU is a multi-platform inertial-positioning model: it turns synchronized IMU sequences into body-frame velocity for trajectory positioning. The main workflow is configured training or checkpoint evaluation, with dataset readers feeding a registered model and training/evaluation runtime. Separate branches cover trajectory metrics and visualization, pretrained-model use, and the IROS challenge submission kit. The README documents those product capabilities; unsampled evaluation and cached-reader internals are represented at subsystem level, without asserting undocumented calls.

Main entry points: [`main_net.py`](https://github.com/superxslam/tartanimu/blob/master/main_net.py) (CLI orchestration), [`tartan_imu/evaluation/evaluators.py`](https://github.com/superxslam/tartanimu/blob/master/tartan_imu/evaluation/evaluators.py) (Evaluation runtime), [`tartan_imu/model/lstm/model_lstm.py`](https://github.com/superxslam/tartanimu/blob/master/tartan_imu/model/lstm/model_lstm.py) (LSTM foundation model), [`train.py`](https://github.com/superxslam/tartanimu/blob/master/train.py) (Training loop)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Training and runtime"]
  node_entry["CLI orchestration<br/>[main_net.py]"]
  node_config["Config assembly<br/>[configer.py]"]
  node_resume["Resume resolution<br/>[resume.py]"]
  node_trainer["Training loop<br/>[train.py]"]
  node_checkpoints["Checkpoint state<br/>[checkpoint.py]"]
end

subgraph group_data["Data and modeling"]
  node_datasets["Sequence readers"]
  node_commondata["Window preparation<br/>[_common.py]"]
  node_modelcreate["Model factory<br/>[model_factory.py]"]
  node_registry["Model registry<br/>[registry.py]"]
  node_foundation["LSTM foundation model<br/>[model_lstm.py]"]
  node_trunks["ResNet-LSTM trunks<br/>[trunks.py]"]
  node_heads["Prediction heads<br/>[heads.py]"]
  node_blocks["Network blocks<br/>[blocks.py]"]
  node_functions["Training functions<br/>[function.py]"]
  node_losses["Loss functions<br/>[losses.py]"]
  node_pretrained["Pretrained inference"]
end

subgraph group_analysis["Evaluation and analysis"]
  node_evaluation["Evaluation runtime<br/>[evaluators.py]"]
  node_metrics["Trajectory metrics<br/>[metrics.py]"]
  node_postprocess["Trajectory postprocessing<br/>[postprocess.py]"]
  node_visualization["Plots and state views<br/>[plots.py]"]
end

subgraph group_challenge["Challenge kit"]
  node_starter["Challenge submission"]
  node_baseline["Baseline submission"]
  node_score["Challenge scorer"]
end

node_user(("Engineer"))
node_weights[("Published model weights")]

node_user -->|"runs"| node_entry
node_entry -->|"loads config"| node_config
node_entry -->|"resolves resume"| node_resume
node_entry -->|"builds loaders"| node_datasets
node_entry -->|"builds model"| node_modelcreate
node_entry -->|"dispatches training"| node_trainer
node_entry -->|"dispatches evaluation"| node_evaluation
node_datasets -->|"uses windows"| node_commondata
node_config -->|"builds model"| node_foundation
node_modelcreate -->|"selects model"| node_registry
node_registry -->|"registers model"| node_foundation
node_foundation -->|"uses trunk"| node_trunks
node_foundation -->|"uses heads"| node_heads
node_trunks -->|"uses blocks"| node_blocks
node_trainer -->|"runs training"| node_functions
node_functions -->|"uses losses"| node_losses
node_trainer -->|"saves state"| node_checkpoints
node_evaluation -.->|"computes metrics"| node_metrics
node_evaluation -.->|"postprocesses paths"| node_postprocess
node_evaluation -.->|"renders results"| node_visualization
node_user -->|"runs inference"| node_pretrained
node_weights -->|"provides weights"| node_pretrained
node_user -->|"submits model"| node_starter
node_starter -.->|"scores submission"| node_score
node_user -.->|"runs baseline"| node_baseline

click node_entry "https://github.com/superxslam/tartanimu/blob/master/main_net.py"
click node_config "https://github.com/superxslam/tartanimu/blob/master/tartan_imu/config/configer.py"
click node_resume "https://github.com/superxslam/tartanimu/blob/master/tartan_imu/config/resume.py"
click node_trainer "https://github.com/superxslam/tartanimu/blob/master/train.py"
click node_checkpoints "https://github.com/superxslam/tartanimu/blob/master/tartan_imu/training/checkpoint.py"
click node_datasets "https://github.com/superxslam/tartanimu/tree/master/tartan_imu/dataloader"
click node_commondata "https://github.com/superxslam/tartanimu/blob/master/tartan_imu/dataloader/_common.py"
click node_modelcreate "https://github.com/superxslam/tartanimu/blob/master/tartan_imu/model/model_factory.py"
click node_registry "https://github.com/superxslam/tartanimu/blob/master/tartan_imu/model/registry.py"
click node_foundation "https://github.com/superxslam/tartanimu/blob/master/tartan_imu/model/lstm/model_lstm.py"
click node_trunks "https://github.com/superxslam/tartanimu/blob/master/tartan_imu/model/lstm/trunks.py"
click node_heads "https://github.com/superxslam/tartanimu/blob/master/tartan_imu/model/lstm/heads.py"
click node_blocks "https://github.com/superxslam/tartanimu/blob/master/tartan_imu/model/common/blocks.py"
click node_functions "https://github.com/superxslam/tartanimu/blob/master/tartan_imu/model/common/function.py"
click node_losses "https://github.com/superxslam/tartanimu/blob/master/tartan_imu/model/common/losses.py"
click node_evaluation "https://github.com/superxslam/tartanimu/blob/master/tartan_imu/evaluation/evaluators.py"
click node_metrics "https://github.com/superxslam/tartanimu/blob/master/tartan_imu/evaluation/metrics.py"
click node_postprocess "https://github.com/superxslam/tartanimu/blob/master/tartan_imu/evaluation/postprocess.py"
click node_visualization "https://github.com/superxslam/tartanimu/blob/master/tartan_imu/evaluation/plots.py"
click node_pretrained "https://github.com/superxslam/tartanimu/tree/master/tartan_imu/model"
click node_starter "https://github.com/superxslam/tartanimu/blob/master/starter/tartanimu_submission.py"
click node_baseline "https://github.com/superxslam/tartanimu/blob/master/starter/baseline_submission.py"
click node_score "https://github.com/superxslam/tartanimu/blob/master/starter/kaggle_metric_tartanimu_score.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_entry,node_config,node_resume,node_trainer,node_checkpoints toneBlue
class node_datasets,node_commondata,node_modelcreate,node_registry,node_foundation,node_trunks,node_heads,node_blocks,node_functions,node_losses,node_pretrained,node_weights toneAmber
class node_evaluation,node_metrics,node_postprocess,node_visualization toneMint
class node_starter,node_baseline,node_score toneRose
class node_user toneIndigo
```

## Components

### Training and runtime

- [CLI orchestration](https://github.com/superxslam/tartanimu/blob/master/main_net.py): `main_net.py`
- [Config assembly](https://github.com/superxslam/tartanimu/blob/master/tartan_imu/config/configer.py): `tartan_imu/config/configer.py`
- [Resume resolution](https://github.com/superxslam/tartanimu/blob/master/tartan_imu/config/resume.py): `tartan_imu/config/resume.py`
- [Training loop](https://github.com/superxslam/tartanimu/blob/master/train.py): `train.py`
- [Checkpoint state](https://github.com/superxslam/tartanimu/blob/master/tartan_imu/training/checkpoint.py): `tartan_imu/training/checkpoint.py`

### Data and modeling

- [Sequence readers](https://github.com/superxslam/tartanimu/tree/master/tartan_imu/dataloader): `tartan_imu/dataloader`
- [Window preparation](https://github.com/superxslam/tartanimu/blob/master/tartan_imu/dataloader/_common.py): `tartan_imu/dataloader/_common.py`
- [Model factory](https://github.com/superxslam/tartanimu/blob/master/tartan_imu/model/model_factory.py): `tartan_imu/model/model_factory.py`
- [Model registry](https://github.com/superxslam/tartanimu/blob/master/tartan_imu/model/registry.py): `tartan_imu/model/registry.py`
- [LSTM foundation model](https://github.com/superxslam/tartanimu/blob/master/tartan_imu/model/lstm/model_lstm.py): `tartan_imu/model/lstm/model_lstm.py`
- [ResNet-LSTM trunks](https://github.com/superxslam/tartanimu/blob/master/tartan_imu/model/lstm/trunks.py): `tartan_imu/model/lstm/trunks.py`
- [Prediction heads](https://github.com/superxslam/tartanimu/blob/master/tartan_imu/model/lstm/heads.py): `tartan_imu/model/lstm/heads.py`
- [Network blocks](https://github.com/superxslam/tartanimu/blob/master/tartan_imu/model/common/blocks.py): `tartan_imu/model/common/blocks.py`
- [Training functions](https://github.com/superxslam/tartanimu/blob/master/tartan_imu/model/common/function.py): `tartan_imu/model/common/function.py`
- [Loss functions](https://github.com/superxslam/tartanimu/blob/master/tartan_imu/model/common/losses.py): `tartan_imu/model/common/losses.py`
- [Pretrained inference](https://github.com/superxslam/tartanimu/tree/master/tartan_imu/model): `tartan_imu/model`

### Evaluation and analysis

- [Evaluation runtime](https://github.com/superxslam/tartanimu/blob/master/tartan_imu/evaluation/evaluators.py): `tartan_imu/evaluation/evaluators.py`
- [Trajectory metrics](https://github.com/superxslam/tartanimu/blob/master/tartan_imu/evaluation/metrics.py): `tartan_imu/evaluation/metrics.py`
- [Trajectory postprocessing](https://github.com/superxslam/tartanimu/blob/master/tartan_imu/evaluation/postprocess.py): `tartan_imu/evaluation/postprocess.py`
- [Plots and state views](https://github.com/superxslam/tartanimu/blob/master/tartan_imu/evaluation/plots.py): `tartan_imu/evaluation/plots.py`

### Challenge kit

- [Challenge submission](https://github.com/superxslam/tartanimu/blob/master/starter/tartanimu_submission.py): `starter/tartanimu_submission.py`
- [Baseline submission](https://github.com/superxslam/tartanimu/blob/master/starter/baseline_submission.py): `starter/baseline_submission.py`
- [Challenge scorer](https://github.com/superxslam/tartanimu/blob/master/starter/kaggle_metric_tartanimu_score.py): `starter/kaggle_metric_tartanimu_score.py`

### Other components

- **Engineer**
- **Published model weights**

## Connections

- Engineer → CLI orchestration: runs (evidence: `README.md`)
- CLI orchestration → Config assembly: loads config (evidence: `main_net.py`)
- CLI orchestration → Resume resolution: resolves resume (evidence: `main_net.py`)
- CLI orchestration → Sequence readers: builds loaders (evidence: `main_net.py`)
- CLI orchestration → Model factory: builds model (evidence: `main_net.py`)
- CLI orchestration → Training loop: dispatches training (evidence: `README.md`)
- CLI orchestration → Evaluation runtime: dispatches evaluation (evidence: `README.md`)
- Sequence readers → Window preparation: uses windows (evidence: `tartan_imu/dataloader/dataset_Humanoid.py`)
- Config assembly → LSTM foundation model: builds model (evidence: `tartan_imu/config/configer.py`)
- Model factory → Model registry: selects model (evidence: `tartan_imu/model/model_factory.py`)
- Model registry → LSTM foundation model: registers model (evidence: `tartan_imu/model/registry.py`)
- LSTM foundation model → ResNet-LSTM trunks: uses trunk (evidence: `tartan_imu/model/lstm/model_lstm.py`)
- LSTM foundation model → Prediction heads: uses heads (evidence: `tartan_imu/model/lstm/model_lstm.py`)
- ResNet-LSTM trunks → Network blocks: uses blocks (evidence: `tartan_imu/model/lstm/trunks.py`)
- Training loop → Training functions: runs training (evidence: `train.py`)
- Training functions → Loss functions: uses losses (evidence: `tartan_imu/model/common/function.py`)
- Training loop → Checkpoint state: saves state (evidence: `train.py`)
- Evaluation runtime → Trajectory metrics: computes metrics
- Evaluation runtime → Trajectory postprocessing: postprocesses paths
- Evaluation runtime → Plots and state views: renders results
- Engineer → Pretrained inference: runs inference (evidence: `README.md`)
- Published model weights → Pretrained inference: provides weights (evidence: `README.md`)
- Engineer → Challenge submission: submits model (evidence: `README.md`)
- Challenge submission → Challenge scorer: scores submission
- Engineer → Baseline submission: runs baseline
