added: handle NaN values in measured outputs ym for MovingHorizonEstimator#402
Merged
Conversation
This is cleaner like this. There is no reason to silently support `Inf` values in `Y0m` (the behavior is not really defined). Non-finite values ind `D0` window should not be supported since the behavior is not clearly defined in general (since the vector is argument of the dynamics).
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #402 +/- ##
=======================================
Coverage 98.71% 98.71%
=======================================
Files 27 27
Lines 5691 5703 +12
=======================================
+ Hits 5618 5630 +12
Misses 73 73 ☔ 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.
The data windows of the
MovingHorizonEstimatordid not handle theNaNvalues explicitly before this PR. The results was different from an optimizer to another e.g.: error thrown,NaNpropagation, etc. This PR introduces explicit handling ofNaNvalues.Measured outputs
ymIf a$\mathbf{y^m}$ vectors it will be ignored in the objective function. More precisely, the associated estimated sensor noise $\mathbf{\hat{v}}$ will be $\mathbf{0}$ when evaluating the objective function and a
NaNvalue appears in the@warnwill be printed. This is the natural and logical behavior, that is, treat it like amissingmeasurement hence no impact in the costs.Measured disturbances
dand manipulated InputsuHowever, an$\mathbf{u}$ or measured disturbances $\mathbf{d}$ vectors, since they are arguments of the dynamic. The behavior is not as well-defined. It's better to throw an explicit error. The user can catch it and replace the values in $\mathbf{u}$ or $\mathbf{d}$ if he really want to continue the execution.
ArgumentErrorerror will be thrown with an explicitthrowcall if aNaNvalue appears in the manipulated inputs