Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multicopter land detector: do not update parameters every cycle #13212

Merged
merged 4 commits into from
Oct 18, 2019

Conversation

mcsauder
Copy link
Contributor

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 the LandDetector::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!

@mcsauder
Copy link
Contributor Author

Here is a bit of data for comparison.

Post flight from PR #11874:
image

Post flight from this PR:
image

~46k param_get calls previous, 32 from this PR.

@mcsauder mcsauder changed the title Multicopter land detector: do not update_parameters every cycle Multicopter land detector: do not update parameters every cycle Oct 16, 2019
MaEtUgR
MaEtUgR previously approved these changes Oct 17, 2019
Copy link
Member

@MaEtUgR MaEtUgR left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This totally slipped my review because I read over the inheritance in the diff 😬

Copy link
Member

@bkueng bkueng left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That works.

src/modules/land_detector/LandDetector.cpp Show resolved Hide resolved
@bkueng bkueng merged commit e9c9fb8 into PX4:master Oct 18, 2019
@mcsauder mcsauder deleted the multicopter_land_detector branch October 18, 2019 15:27
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.

4 participants