Back to project journal

PROJECT NOTES / AUTOMOTIVE PERCEPTION & EKF

Automotive Radar Multi-Target Tracker (kalman-cpp & kalman)

A deterministic perception engine in C++17 implementing non-linear Extended Kalman Filtering, Munkres bipartite data association, and ISO 26262 ASIL B lifecycle states, accompanied by the theoretical research guide and Python/Jupyter testbench.

Automotive Radar Multi-Target Tracker (MTT)
Extended Kalman Filter (EKF) with Polar Jacobians
Munkres Bipartite Data Association (O(n·m²))
ISO 26262 ASIL B / Zero-Heap Determinism

AUTOMOTIVE EMBEDDED C++ & PYTHON RESEARCH / EXTENDED KALMAN FILTER & MULTI-TARGET TRACKING

Deterministic C++17 Perception Engine: Non-Linear Polar State Estimation & Track Lifecycle

This project provides an automotive-grade Multi-Target Tracking (MTT) perception pipeline combining a deterministic production C++17 engine (kalman-cpp) and a comprehensive mathematical research testbench (kalman). Engineered according to ISO 26262 ASIL B and MISRA C++ guidelines, the system consumes raw radar detections in polar coordinates (range r, azimuth θ, and radial Doppler velocity vr), projects state estimates into Cartesian coordinates [x, y, vx, vy] using an Extended Kalman Filter (EKF), executes global bipartite data association via the Hungarian algorithm, and enforces strict track confirmation and coasting lifecycles without any dynamic heap allocation.

Automotive Radar Multi-Target Tracker in Action (Dear ImGui & DirectX 11) — Real-time telemetry, 2D BEV radar scope, Extended Kalman Filter state estimation, Munkres bipartite association, and track lifecycle management.
01

Non-Linear Observation Model & Polar Jacobians

Radar measurements reside in non-linear polar space: r = √(x² + y²), θ = atan2(y, x), and vr = (x·vx + y·vy) / r. The system derives the analytical measurement Jacobian H(x) with singularity guards at r → 0, mapping 4-DOF Cartesian state perturbations directly into radar range-rate space (EKF.hpp).

02

Joseph-Stabilized Covariance & Mahalanobis Gating

To prevent numerical divergence caused by finite-precision floating-point arithmetic, the covariance update applies the symmetric Joseph formulation: P⁺ = (I − KH)P⁻(I − KH)ᵀ + KRKᵀ. Candidate measurements are validated against a 3-DOF Chi-Square confidence gate (dM² = yᵀ S⁻¹ y ≤ 12.84, 99.5% threshold), filtering multipath ground bounce and ghost radar clutter.

03

Munkres / Hungarian Bipartite Data Association

Resolves measurement-to-track assignment ambiguity globally using a custom zero-heap implementation of the Hungarian algorithm (DataAssociation.hpp). Operates with O(n·m²) time complexity over static 64×128 cost matrices, guaranteeing optimal matching without combinatorial explosion or greedy local minima.

04

Deterministic Track Lifecycle & ASIL B Safety FSM

Governs track evolution through a strict finite state machine (FREE → TENTATIVE → CONFIRMED → COASTED → DELETED). Unconfirmed tracks require M-of-N confirmation (3 hits in 5 consecutive frames) before downstream publication. Occluded targets coast up to 5 cycles via pure kinematic propagation. An ASIL B health validity flag prevents ghost track actuation in safety-critical AEB and ACC controllers.

Colab ExecutablePython 3.10 • NumPy / Matplotlib • Tested & Verified

Interactive Automotive Radar MTT & EKF Research Notebook

Execute the end-to-end radar Multi-Target Tracking pipeline directly in the cloud. Run Monte Carlo simulations for 4 automotive radar validation scenarios: constant velocity tracking, 5-frame temporary sensor occlusion with dead-reckoning coasting, false-alarm clutter rejection via Chi-Square gating, and crossing targets with global Hungarian data association.

Scenario 01 (TC_TRK_01)

Single Target Constant Velocity & Innovation Monitoring

Validates unaccelerated 4-DOF motion (vx=20 m/s). Confirms rapid covariance matrix convergence within 3 cycles and bounds position RMSE < 0.18 m and velocity RMSE < 0.10 m/s.

Scenario 02 (TC_TRK_02)

Temporary Occlusion & Pure Kinematic Coasting

Simulates 5 consecutive dropped frames (occlusion at frames 25–29). The ASIL B FSM transitions to COASTED, propagating state via pure kinematics while inflating covariance until reacquisition.

Scenario 03 (TC_TRK_03)

Clutter Spikes, Ghost Suppression & Mahalanobis Gating

Injects high-density false-alarm radar clutter (10 clutter points/frame). Validates 3-DOF Chi-square confidence ellipsoids (dM² ≤ 12.84), rejecting 100% of clutter outliers.

Scenario 04 (TC_TRK_04)

Crossing Targets & Global Hungarian/Munkres Association

Evaluates two vehicles intersecting at 45° with overlapping spatial gates. The O(n·m²) Munkres algorithm resolves ambiguous cost matrices globally with zero track-swap errors.

Colabradar_tracker_demo.ipynb
Colab
[6]TC_TRK_01: Constant Velocity Tracking & Polar Innovation Verification
Python 3 (SymPy / SciPy)Scrollable Cell
# TC_TRK_01: Constant Velocity Tracking & Polar Innovation Verification
np.random.seed(42)
config = TrackerConfig(dt=0.040, sigma_r=0.25, sigma_theta=0.0087, sigma_vr=0.15)
tracker = RadarMTT(config)

true_x, true_y, true_vx, true_vy = 10.0, 2.0, 20.0, 0.0

for frame in range(100):
    # Kinematic propagation
    true_x += true_vx * config.dt
    true_y += true_vy * config.dt

    # Non-linear polar measurement with sensor noise
    r_true = math.sqrt(true_x**2 + true_y**2)
    theta_true = math.atan2(true_y, true_x)
    vr_true = (true_x * true_vx + true_y * true_vy) / r_true

    detection = Detection(
        range_m=r_true + np.random.normal(0, config.sigma_r),
        azimuth_rad=theta_true + np.random.normal(0, config.sigma_theta),
        doppler_mps=vr_true + np.random.normal(0, config.sigma_vr)
    )

    # Predict, global Munkres association, and Joseph-stabilized EKF update
    tracks = tracker.process_frame([detection], timestamp_ms=frame * 40)
Monte Carlo Test Results (TC_TRK_01):
Verified on Google Colab
[INIT]Target initialized: x0=10.0m, y0=2.0m, vx=20.0m/s (Heading 0°)
[FRAME 03]Track Status: CONFIRMED (Hit 3/3 in 5-frame confirmation window)
[CONVERGENCE]Position variance P[0,0] stabilized from 5.00 m² to 0.048 m²
[VELOCITY]Velocity variance P[2,2] stabilized from 10.00 (m/s)² to 0.082 (m/s)²
[INNOVATION]Average Normalized Innovation Squared (NIS): 2.87 (within 95% Chi-Square threshold [0.05, 7.81])
[METRICS]Position RMSE: 0.142 m | Radial Velocity RMSE: 0.086 m/s
TC_TRK_01 PASSED: All state estimation bounds and confirmation requirements satisfied.
Deterministic state estimation and multi-target tracking pipeline verified against automotive radar ground truth.
THEORETICAL FOUNDATION & RESEARCH MONOGRAPH

Pedagogical Guide to Automotive Radar Multi-Target Tracking

A complete LaTeX research monograph detailing the mathematical formulation of non-linear state propagation, continuous white-noise acceleration models, Chi-square spatial gating, Munkres assignment, and companion Python / Jupyter verification testbench (kalman repository).

Pedagogical Guide to Automotive Radar MTT

Loading document viewer...

Extended Kalman Filtering, Spatial Gating, and Track Lifecycle Architecture (LaTeX Monograph)

Architecture & Verification Metrics (SPEC-SW-RADAR-TRK-001)

Standard Compliance
ISO 26262 ASIL B design · MISRA C++:2008 guidelines · ASPICE SWE.4/SWE.6
Cycle Budget & WCET
25 Hz nominal rate (40 ms cycle budget) · Worst-Case Execution Time < 0.15 ms
Memory Architecture
Zero heap allocation (no malloc/new) · Static fixed-size memory pools (MAX_TRACKS=64, MAX_DETECTIONS=128)
State Vector & Model
4-DOF Cartesian state [x, y, vx, vy] · Continuous white noise acceleration (CWNA) model
Linear Algebra Engine
Header-only static matrix engine (Matrix.hpp) with closed-form 3×3 & 4×4 analytical inversions
Interactive Visualizer
Dear ImGui desktop application with native DirectX 11 / Win32 backend (main_gui.cpp)
Python Companion Testbench
Jupyter simulation testbench (radar_tracker_demo.ipynb) and automated Python validation suite
C++ Acceptance Test Suite
Automated test suite (test_tracker.cpp) verifying constant velocity, crossing targets, -8 m/s² braking, and clutter rejection

Dual-Repository Perception Framework

Together, kalman-cpp and kalman form a complete perception framework: kalman serves as the pedagogical research and mathematical proof environment (Python, Jupyter, and LaTeX monograph), while kalman-cpp provides the deterministic, zero-heap C++17 production engine for deployment in embedded automotive electronic control units (ECUs).

Engineering Discussion & Peer Comments0

Open peer review & revision-tracked technical discourse

Sort:

Contribute to the Discussion

Markdown code formatting supported
Loading engineering discussions...