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
Multi-Target Filters
- GM-PHD Filter: Gaussian Mixture Probability Hypothesis Density filter based on Vo & Ma (2006)
- LMB Filter: Labeled Multi-Bernoulli filter with track label preservation
- LMBM Filter: Labeled Multi-Bernoulli Mixture for multi-hypothesis tracking
- Multi-Sensor LMB: AA-LMB, GA-LMB, PU-LMB, IC-LMB variants for sensor fusion
Single-Target Filters
- Kalman Filter: Standard discrete-time linear Kalman filter
- Extended Kalman Filter (EKF): Nonlinear filter with Jacobian linearization
- Unscented Kalman Filter (UKF): Sigma-point filter for highly nonlinear systems
Core Capabilities
- 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, expected count, local maxima)
- Assignment Solver: Hungarian algorithm for optimal track-to-measurement association
- Embedded-Ready: Full
no_stdsupport with optionalalloc
Quick Start
use *;
Models
Transition Models
ConstantVelocity2D- 4D state [x, y, vx, vy] with white noise accelerationConstantVelocity3D- 6D state [x, y, z, vx, vy, vz] for 3D trackingCoordinatedTurn2D- 5D state [x, y, vx, vy, omega] with turn rate (nonlinear)
Observation Models
PositionSensor2D- Observes [x, y] from 4D position-velocity statePositionSensor2DAsym- Asymmetric noise in x/y directionsPositionSensor3D- Observes [x, y, z] from 6D stateRangeBearingSensor- Nonlinear range-bearing for 4D stateRangeBearingSensor5D- Range-bearing for 5D coordinated turn model
Clutter Models
UniformClutter- Uniform Poisson clutter over rectangular surveillance region (generic over dimensions)
Birth Models
FixedBirthModel- Predefined birth locations with configurable weights and covariances
State Extraction
Multiple strategies for extracting target estimates from the mixture:
- Weight Threshold: Extract components exceeding a weight threshold
- Top-N: Extract N highest-weighted components
- Expected Count: Extract based on rounded total weight
- Local Maxima: Extract local maxima with Mahalanobis distance-based suppression
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)