added: covestim arg. in both MovingHorizonEstimator constructors + honor P̂_0#374
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #374 +/- ##
=======================================
Coverage 98.57% 98.57%
=======================================
Files 27 27
Lines 5468 5477 +9
=======================================
+ Hits 5390 5399 +9
Misses 78 78 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
covestim arg. in both MovingHorizonEstimator constructorscovestim arg. in both MovingHorizonEstimator constructors + honor P̂_0
covestim arg. in both MovingHorizonEstimator constructors + honor P̂_0covestim arg. in both MovingHorizonEstimator constructors + honor P̂_0
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.
It's now possible to customize the estimator for the arrival covariance$\mathbf{\bar{P}}$ in the first constructor of the $\mathbf{\bar{P}}$ is very useful, and it's supported by providing a
MovingHorizonEstimator, that is, the one that avoid specifying the full covariance matrices. A constant arrival covarianceSteadyKalmanFilterobject in thecovestimargument. But the argument was exposed only in the second constructor of the MHE, which is less "user-friendly". This is no longer the case.I also changed the behavior compared PR #248. The
P̂_0argument ofMovingHorizonEstimatorconstructor was not honored when acovestimargument was provided, which is totally counterintuitive and I would even consider this as a bug. It is now always honored. It is no longer required to manually callsetstate!to set the arrival covariance value when it's estimated by aSteadyKalmanFilter, that is, a constant. The user can just provideσP_0,σPint_ym_0andσPint_u_0arguments in the first constructor, orP̂_0in the second, and it will be fixed at these values.In the case that the user would like to fix it at the steady-state value$\mathbf{\hat{P}}(\infty)$ , the user can call the first MHE constructor with
σP_0=nothing, orP̂_0=nothingfor the second one, and it will fetch the value fromcovestim.cov.P̂, which is the steady-state covariance for theSteadyKalmanFilter.As mentioned in the documentation, it is also possible to set a constant arrival covariance with
NonLinModels by constructing aSteadyKalmanFilterwith an dummyLinModeland pass this object incovestim, as long as the number of estimated statesnx̂mathches the MHE.