Tracktor
A type-safe Rust library for Multi-Target Tracking (MTT) using Random Finite Set (RFS) based algorithms.
Why Tracktor?
Compile-Time Correctness
Tracktor leverages Rust's type system to catch errors at compile time, not runtime:
// Vector spaces are type-distinct - you can't accidentally mix them
let state: = /* ... */;
let measurement: = /* ... */;
// This won't compile - type system prevents invalid operations
// let wrong = state + measurement; // Error!
// Matrices encode their transformations
let H: = /* ... */; // Maps 4D state → 2D measurement
let measurement = H.observe; // Correct by construction
State Machine Enforced Filter Phases
The predict-update cycle is enforced at the type level:
// Filter states are typed - can't update before predict
let filter: = /* ... */;
let predicted = filter.predict; // Returns PhdFilterState<_, _, Predicted>
let updated = predicted.update; // Returns PhdFilterState<_, _, Updated>
// This won't compile - type system enforces correct ordering
// let wrong = filter.update(&obs, &measurements); // Error! Can't update an Updated state
Const Generic Dimensions
State and measurement dimensions are compile-time constants:
// 4D state (x, y, vx, vy), 2D measurements (x, y)
type State = ;
type Meas = ;
// Dimension mismatches are caught at compile time, not runtime
Embedded-Ready
Full no_std support with optional alloc - deploy on resource-constrained platforms and real-time systems without compromise.
Features
- GM-PHD Filter: Complete Gaussian Mixture Probability Hypothesis Density filter implementation based on Vo & Ma (2006)
- Pluggable Models: Trait-based transition, observation, clutter, and birth models
- Numerical Stability: Joseph form covariance updates with singular matrix detection
- Mixture Management: Intelligent pruning and merging to maintain tractable component counts
- State Extraction: Multiple strategies (threshold, top-N, local maxima) for target estimation
- Assignment Solver: Hungarian algorithm for optimal track-to-measurement association
Quick Start
use *;
Models
Transition Models
ConstantVelocity2D- Nearly constant velocity with white noise acceleration
Observation Models
PositionSensor2D- Observes position from position-velocity statePositionSensor2DAsym- Asymmetric noise in x/y directions
Clutter Models
UniformClutter2D- Uniform Poisson clutter in rectangular region
Birth Models
FixedBirthModel- Predefined birth locations with configurable weights
State Extraction
Multiple strategies for extracting target estimates from the mixture:
let config = default
.with_weight_threshold
.with_max_targets;
let targets = config.extract;
References
Based on the seminal work:
- B.-N. Vo and W.-K. Ma, "The Gaussian Mixture Probability Hypothesis Density Filter," IEEE Transactions on Signal Processing, vol. 54, no. 11, pp. 4091-4104, Nov. 2006.
License
Licensed under either of AGPL3.0 or commercial license (contact me)