Multicopter land detector: do not update parameters every cycle #13212
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.
Describe problem solved by this pull request
In PR #11874 I inadvertently introduced updating multicopter throttle and landspeed parameters every cycle. This PR corrects that error. I think this PR also simplifies the logic a bit as well.
Test data / coverage
Test flown on a 250 quad with pixhawk 4 mini: https://review.px4.io/plot_app?log=f71fb16d-69c1-4ef7-93cd-40783eee96f8
Additional context
See feedback in PR #11874 for background.
Hi @bkueng , I think your suggestion to move the
if (_parameter_update_sub.updated())
check up into theLandDetector::Run()
method works nicely. Let me know if you prefer the first commit instead or if you have any other feedback. Thanks for your review!@MaEtUgR , @julianoes , let me know if you'd like to see anything different as well.
Thanks!