Repository navigation
fix(demo): make radar_tracking_ukf converge and report honestly - #16
Merged
rahadbhuiya merged 1 commit intoOct 24, 2026
Merged
Conversation
Closes Exploidus#3: the demo's position error grew 1.47m -> 26.84m over 15 steps yet it printed an unconditional 'UKF tracked' because: - the transition closure froze the y-state (|s, dt| [s0+8dt, s1]) while the ground-truth y drifted, so the model and reality disagreed by construction; - a single range observation cannot separate a 2-D state's x from y (unobservable in the direction orthogonal to the line of sight). Three-part fix: 1. Model the motion the target actually makes: capture constant velocities vx, vy in the transition closure so both components propagate (a linear model tracks linear motion; the old sin() 'curved' path was itself the first mismatch). 2. Add a second observation (a lateral y sensor) so the 2-D state is observable. 3. Gate the success claim on the real final error and add a regression-guard assert: a future divergence panics the example instead of printing a false win. Final error now stabilises at ~0.3m and the run prints an honest, error-qualified 'tracked' line. Verified: fmt clippy (all-targets) tests all examples green; the assert was confirmed to fire by temporarily tightening the threshold (exit 134).
12 tasks done
rahadbhuiya
self-requested a review
October 24, 2026 18:56
mdabydeen
added a commit
to mdabydeen/aegis-filter
that referenced
this pull request
Oct 25, 2026
N-D Joseph-stabilized measurement update for LinearKalmanFilter (Exploidus#15) and the honest radar-tracking demo fix (Exploidus#16); closes Exploidus#2 and Exploidus#3.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #3.
What
examples/radar_tracking_ukf.rsprinted a position-error column that grew from 1.47 m to26.84 m over 15 steps, then closed with "UKF tracked continuous curved flight without
analytical Jacobian matrices." The number and the conclusion contradicted each other.
Root cause
yconstant (|state, _d| [state[0] + 8.0 * _d, state[1]])while the ground-truth
ymoved, so the model and reality did not agree.sqrt(x^2 + y^2)is barely observable iny, so the estimatestuck.
The filter math was fine; the demo model was inconsistent.
Fix
yin the transition: the target now flies a constant-velocity straight line(
x0 + vx*t,y0 + vy*t), which is what a linear transition can actually track.yreading) so the 2-D state is recoverable.error is under a threshold, guarded by an assertion so a future regression panics the
example instead of silently printing a false success.
Verification
example panic (exit 134), then reverted.
cargo fmt -- --checkcleancargo clippy --all-targets --all-features -- -D warningsclean (examples included)cargo run --example radar_tracking_ukfexits 0; the other three examples still runNote: examples are not part of
cargo test, so correctness is guarded by the in-mainassertion plus the before/after numbers, not a unit test.