Skip to content

added: low-level API correctstate! and predictstate!#403

Closed
franckgaga wants to merge 3 commits into
mainfrom
low_level_API_estimators
Closed

added: low-level API correctstate! and predictstate!#403
franckgaga wants to merge 3 commits into
mainfrom
low_level_API_estimators

Conversation

@franckgaga

@franckgaga franckgaga commented Jul 17, 2026

Copy link
Copy Markdown
Member

Add the support for a new lower-level API for all the state estimators except MovingHorizonEstimator, which is the following public methods:

  • correctstate!(estim::StateEstimator, ym, d=[]): perform the correction step of the state estimator
  • predictstate!(estim::StateEstimator, u, d=[]) : perform the prediction step of the state estimator

Contrarily to preparestate! and updatestate!, the estim.direct and estim.corrected flags are completely ignored in correctstate! and predictstate!. It allows skipping the correction step if the measurements are not available.

Closes the comment in #89. It took a while. I completely forgot about this. I should have created a separate issue to remind me.

@franckgaga franckgaga changed the title Low level api estimators added: low-level API correctstate! and predictstate! Jul 17, 2026
@codecov-commenter

codecov-commenter commented Jul 17, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 65.27778% with 25 lines in your changes missing coverage. Please review.
✅ Project coverage is 98.28%. Comparing base (bc0f8e9) to head (90964aa).

Files with missing lines Patch % Lines
src/estimator/execute.jl 37.50% 15 Missing ⚠️
src/controller/execute.jl 0.00% 4 Missing ⚠️
src/estimator/mhe/execute.jl 33.33% 4 Missing ⚠️
src/sim_model.jl 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #403      +/-   ##
==========================================
- Coverage   98.71%   98.28%   -0.44%     
==========================================
  Files          27       27              
  Lines        5703     5710       +7     
==========================================
- Hits         5630     5612      -18     
- Misses         73       98      +25     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@franckgaga

Copy link
Copy Markdown
Member Author

Huumm come to think of it, there is a simpler way of supporting this feature without introducing new public functions. I could just support NaN values in preparestate! and updatestate!. If a NaN is detected in the ym argument, skip the correction step, maybe with a warning. This way, the behavior would be identical if it's a MovingHorizonEstimator (supporting NaN since #402) or a Kalman filter.

There is already the initstate!, preparestate!, updatestate! and setstate! public functions for the states. Having two new public functions is starting to be overly complex and it lengthen the online documentation significantly.

@franckgaga

Copy link
Copy Markdown
Member Author

Closing in favor of #404

@franckgaga franckgaga closed this Jul 18, 2026
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.

2 participants