Skip to content

Preserve predicted EKF priors and support missing measurements - #348

Open
xixihaha-ha wants to merge 1 commit into
rlabbe:masterfrom
xixihaha-ha:fix/ekf-predict-update-20261104
Open

xixihaha-ha wants to merge 1 commit into
rlabbe:masterfrom
xixihaha-ha:fix/ekf-predict-update-20261104

Conversation

@xixihaha-ha

Copy link
Copy Markdown

ExtendedKalmanFilter.predict_update saves the old self.x/self.P as its prior, rather than the local predicted state/covariance. It also evaluates the observation functions for z=None and then fails, although the method documents a prediction-only step for missing measurements.

Save the computed predicted values. For a missing measurement, retain them as current/posterior state and return before calling observation functions, matching separate predict and update(None) calls.

Tests compare combined and separate steps with control input for present/missing observations, including all prior/posterior snapshots. A separate test rejects any observation-function call for a missing measurement.

Validation: all 3 new tests fail on unchanged main and pass after the fix. Including existing EKF tests: 5 passed (Python 3.11 / NumPy 1.26).

AI assistance was used to investigate, implement and test this change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant