Tracking-scenario simulator and replay visualizer over a shared JSONL stream contract
Project description
TrackSim (Tracking-Scenario Simulation)
Tracking-scenario simulator and replay visualizer over a shared JSONL stream contract. Generate labeled truth, degrade it into observables across fidelity tiers, replay it through a reference estimator, and scrub the result on a timeline. Requires Python 3.12+.
gri-tracksim is two paired tools joined by one file contract: a simulator
that emits truth / input / output streams, and a Dash/Plotly replay
viewer that reads them. The boundary is the JSONL contract alone, so the viewer
renders the output of any contract-conformant tracker, not just this package's.
The viewer is a 2D replay tool. The 3D analyst app ("Crucible") is a separate, closed product and is not part of this repository.
Key Features
- Scenario simulator: leg-based truth (straight / turn / climb / hold), degraded observables (geo / TDOA / FDOA / AOA / altitude), and a four-tier fidelity ladder (T0..T3) driven from one physical scene.
- Declarative scenarios: author scenarios in YAML from the shipped vocabulary - no source checkout required.
- Reference replay: a single-target IMM replay produces the
outputstream with forward-prediction horizons. - Replay viewer: a 2D top-down ENU map plus linked time-series panes, with a play/scrub timeline.
- Self-contained contract: a language-agnostic JSONL wire format you can emit from your own tracker and render here.
Capability Tiers
gri-tracksim is built around three ways to use it:
- Viz-only consumer - you already have a tracker. Emit the JSONL contract
and run
gri-tracksim-vizto scrub it. - Scenario author - write scenario YAML from the shipped vocabulary
(emitters, legs, tiers, collector presets, noise) and generate the
truth/input/outputtriple. Needs the package; no source. - Vocabulary developer - add new leg primitives, collector geometries,
fidelity tiers, or parametric sweeps. These live in registries in the source
and require a checkout (see
AGENTS.md).
Installation
pip install gri-tracksim # simulator + replay viewer
Quick Start
Generate a scenario (CLI)
gri-tracksim --list # list bundled example scenarios
gri-tracksim 1c_air_racetrack -o _streams # render a bundled scenario
gri-tracksim my_scenario.yaml -o _streams # render your own YAML
This writes _streams/<name>/truth.jsonl, input.jsonl, and output.jsonl.
Scrub a run (viewer)
gri-tracksim-viz _streams/1c_air_racetrack
Author a scenario in Python
from gri_tracksim.sim import load_scenario, write_scenario_streams
scenario = load_scenario("my_scenario.yaml")
n_truth, n_input, n_output = write_scenario_streams(
scenario, "_streams/my_scenario", predict_horizons_s=(10.0, 30.0),
)
Read the contract from your own tracker
from gri_tracksim.contract import Header, load_stream, write_jsonl
header, records = load_stream("output.jsonl") # parsed Header + event records
You only need gri_tracksim.contract to emit or read the streams - it has no
dependency on the simulator or the viewer.
Scenario YAML
A scenario is a single declarative file. All keys but name, origin_lla,
dt, and emitters are optional:
name: 1c_air_racetrack
origin_lla: [38.0, -77.0, 0.0] # ENU anchor [lat_deg, lon_deg, alt_m]
dt: 2.0 # grid step (s)
seed: 3
tier: T2 # T0 | T1 | T2 | T3
collectors: diverse # good | weak | diverse | null
motion: air # level (cruise) | air (climb-aware IMM)
noise:
altitude_std_m: 200.0
emitters:
E1:
start_enu: [0.0, 0.0, 1000.0]
azimuth_deg: 90.0
speed_mps: 120.0
legs:
- {type: straight, duration_s: 30.0}
- {type: climb, duration_s: 20.0, climb_rate_mps: 10.0}
- {type: turn, delta_azimuth_deg: 180.0, radius_m: 2000.0}
The leg types (straight, turn, climb, hold), fidelity tiers
(T0..T3), collector presets (good, weak, diverse), and replay motion
banks (level, air) are fixed vocabularies; adding to them is the source-only
developer path.
The Stream Contract
Each stream is JSON Lines: a self-describing header record followed by one record per event.
truth-{"t", "emitter_id", "pos_enu", "vel_enu", "leg_mode"}input-{"t", "id", "type", ...}wheretypeis one ofgeo | tdoa | fdoa | aoa | altitude; the stableid(obs_0000...) is what the output'sassociationreferences.output- the estimator replay (estimate / association / predicted), association keyed back to the inputid.
The wire format is plain JSON (no gri types on the wire), so any tracker, in any language, can emit a stream the viewer will render.
Dependencies
A top-tier package in the GRI FOSS ecosystem; a sibling consumer of the same
mid-tier libraries as gri-multitrack.
- gri-geosim (iterative locate), gri-kalman (reference IMM replay), gri-trajectory (legs), gri-obs, gri-pos, gri-ell, gri-utils
- gri-plot, dash, plotly (the replay viewer)
- numpy, scipy, pyyaml
Other Projects
Current list of other GRI FOSS Projects we are building and maintaining.
License
MIT License. See LICENSE for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file gri_tracksim-0.1.1.tar.gz.
File metadata
- Download URL: gri_tracksim-0.1.1.tar.gz
- Upload date:
- Size: 89.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.9.30 {"installer":{"name":"uv","version":"0.9.30","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"12","id":"bookworm","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ff83a18538640cec6cba7ef5aa430e9474155ed934dca12ae82f42175e70e317
|
|
| MD5 |
a272b608a6ec7e2c8c3961d33cf43c22
|
|
| BLAKE2b-256 |
e9980091b13f0425e307cec404f47a45d255ea42dedc2dbcea3a0f69491f97a7
|
File details
Details for the file gri_tracksim-0.1.1-py3-none-any.whl.
File metadata
- Download URL: gri_tracksim-0.1.1-py3-none-any.whl
- Upload date:
- Size: 85.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.9.30 {"installer":{"name":"uv","version":"0.9.30","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"12","id":"bookworm","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d0ab14ff8b8d8494fae483476d47c5b1ef59788538327721b82295120f2fa1d9
|
|
| MD5 |
9998128336a99a3b43d2ed369466c365
|
|
| BLAKE2b-256 |
98871783463dbc883924bb1f199a0709812450a9010451728a611108f72d069d
|