Filter: SlewCalculator2D typo fix #29275
Merged
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.
This fixes a typo in the 2D Slew Calculator used by the AC_PID_2D class which is used in Copter, Rover and Blimp's XY velocity controller. This means it's also used by QuadPlanes in QLoiter, etc but surely it has nothing to do with the recent questions around quad plane attitude control because the bug was in 4.5 as well.
This was added in PR #23981 but it is only used for reporting so I think this does not cause any actual performance issue. In fact, since this PR went in we've simplified the Rover autotune and we don't use this is anymore so we could potentially backout the slew reporting completely and save some flash and a very small amount of CPU
This resolves issue #29272
I've done some minor testing in copter in SITL and there is a difference in the logged slew rate. For example in the "before" we see consistently low slew rate while in "after" it is much much larger.
I think this is correct though because if I greatly reduce the PSC_VELXY_P and I values I can produce similarly huge numbers with master