Repository navigation
test(mobile): tests for vehicle models, sensor, landmark map, EKF and particle filter - #747
Merged
Merged
Conversation
… particle filter EKF (14%), ParticleFilter (21%) and Vehicle (35%) were the least tested estimators in the toolbox. This adds tests/test_vehicle_estimators.py. - vehicle kinematics against closed form results, state transition and its Jacobians Fx and Fv against finite differences - range-bearing sensor against the geometry, range limits, seeded landmark maps - EKF: dead reckoning (uncertainty grows, covariance stays symmetric positive definite), map-based localization (beats dead reckoning), map creation and SLAM (landmark and vehicle error against ground truth), landmark bookkeeping - particle filter converges to the truth, uncertainty shrinks, seeded Bounds are loose multiples of the errors measured at the time of writing. EKF 14% -> 70%, ParticleFilter 21% -> 62%, sensors 79%. Passes on pgraph 0.6.5 and 1.0.0. One defect is recorded as an expectedFailure: EKF.plot_error() raises in SLAM because it subtracts the whole state vector from the 3-element truth. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Not up to standards ⛔🔴 Issues
|
| Category | Results |
|---|---|
| ErrorProne | 7 high |
🟢 Metrics 62 complexity · 9 duplication
Metric Results Complexity 62 Duplication 9
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #747 +/- ##
=====================================
Coverage 0.00% 0.00%
=====================================
Files 143 143
Lines 14271 14271
=====================================
Misses 14271 14271 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
Summary
EKF (14% covered),
ParticleFilter(21%) andVehicle(35%) were among the least tested code in the toolbox, and several recent third-party bug reports (#719, #720, #721, #735) are in exactly these files. This addstests/test_vehicle_estimators.py.fand its JacobiansFx,Fvagainst finite differencesBounds are loose multiples of the errors measured at the time of writing, so they catch a broken estimator without being brittle. The whole file runs in under half a second (the particle filter test patches
plt.pause, see below).Coverage: EKF 14% → 70%, ParticleFilter 21% → 62%, sensors 79%, landmark map 64%.
Defects found
EKF.plot_error()raises in SLAM (recorded as anexpectedFailure), and has further problems: the line is plotted against sample index while the axes are in time,bgcoloris ignored, and the bounds usedf=2for a scalar errorParticleFilter.run()callsplt.pause(0.2)on every step even whenanimate=False, sorun(T=10)takes 24 s of wall timeFixes follow as separate PRs. Several docstring examples are also wrong (
LandmarkMap(nlandmarks=...),RandomPath(20, 2),RangeBearingSensor(robot, map, W)); that is a separate docs PR.This does not touch the code changed by #719, #720, #721 and #735, and the tests do not depend on those bugs.
Test plan
pytest tests/test_vehicle_estimators.pyon pgraph 0.6.5 and 1.0.0 (39 passed, 1 xfailed)🤖 Generated with Claude Code