-
Notifications
You must be signed in to change notification settings - Fork 13.6k
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
Cherry pick the src/modules/land_detector/
directory work from PR #9756
#11874
Cherry pick the src/modules/land_detector/
directory work from PR #9756
#11874
Conversation
2a7244c
to
b408a98
Compare
b408a98
to
103033b
Compare
15dd715
to
c70b933
Compare
04a7062
to
14526c7
Compare
d085b2d
to
f4bf37b
Compare
f4bf37b
to
0d2919f
Compare
51d6d7d
to
cd63d24
Compare
@dagar, finally, I can help with flight testing. PX4 master branch on the same drone: The multicopter land detector seemed to behave the same for this PR and PX4 master with my airframe, neither reliably detects. I attribute the inability to detect the landing in this case on somewhat high levels of vibration, (something I can look into on my rig), but again, no perceptible differences between this PR and master. Please let me know if you need more data collected against this PR. -Mark |
cd63d24
to
36aede3
Compare
I've squashed all of the commits in this PR and corrected duplicate (inherited) code in the MulticopterLandDetector that I had missed pruning. @PX4/testflights , now that it's passing CI, (only if you have time and its not too inconvenient), would you be able to try this PR on a fixed wing? I'll get multicopter flight logs posted here as soon as I have my hardware flight ready again; should only be a day or two. |
Tested on pixhawk1 v3 phantom wing log: |
Tested on Pixhawk 4mini v5:Modes Tested
Procedure Notes Log: |
Tested on Pixhawk 4 v5 f450 log: https://review.px4.io/plot_app?log=3de37f3e-4fb2-4287-8bf6-456b6331de1d |
@mcsauder let us know if you need further testing. |
Thank you so much @Tony3dr , @dannyfpv ,and @Junkim3DR !! I appreciate it very much. My flight testing also showed good results, correct land detection 5 of 5 on a 250 quad with pixhawk 4 mini:
@MaEtUgR , this PR should be good to go! |
@@ -71,15 +63,16 @@ LandDetector::~LandDetector() | |||
|
|||
void LandDetector::start() | |||
{ | |||
_check_params(true); | |||
_force_param_update = true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do you use a class attribute here? It adds another state, whereas passing an argument would be simpler.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @bkueng , I changed it to meet your suggestion and flight testing is good: https://review.px4.io/plot_app?log=a7b84e5b-14dc-4324-a324-986aac6873dc
Initially I had overloaded the method to allow inheritance from the base class while preserving the original behavior. This was changed after feedback above to use a class variable. As it stands now, the MulticopterLandDetector class doesn't use the argument, but I don't see any issues with that.
Thanks for the feedback!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for fixing, now it's much clearer.
Consolidate _update_params() methods for improved inheritance from the LandDetector base class. Move common uORB::Subscriptions to the base class for inheritance. Deprecate redundant override methods.
2eab329
to
adb10a1
Compare
Hi @MaEtUgR , the CI tools failed after the lastest master branch merge, so I rebased, squashed commits, and updated the commit comments to better reflect the changes that have occurred. No changes to the code, only the commit comments and squash. Hopefully CI is happy this round! UPDATE: Here is a quick flight test, everything looks good. The flight was a few minutes of hovering, climb to altitude, then descent from altitude. (I bumped the mode switch to alt on the way down, so that blip in the modes was my fault but doesn't impact the test.) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mcsauder Awsome, thanks a lot! CI is happy. I would say it's ready.
Thanks @MaEtUgR ! I am excited to see this one through to the end! I appreciate everyone's reviews and all of your feedback! |
{ | ||
LandDetector::_update_params(force); | ||
|
||
_freefall_hysteresis.set_hysteresis_time_from(false, (hrt_abstime)(1e6f * _param_lndmc_ffall_ttri.get())); | ||
|
||
param_get(_paramHandle.minThrottle, &_params.minThrottle); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mcsauder this is not correct, it re-loads the params every cycle now, as there is no check for _parameter_update_sub
here. You can move the _parameter_update_sub.updated()
check out of LandDetector::_update_params
around the _update_params();
in LandDetector::Run()
(and get rid of the force
argument).
(Alternatively you can rename this method here to void updateParams() override;
, and then make LandDetector::_update_params
non-virtual)
There also needs to be a call to updateParams()
in LandDetector::_update_params
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @bkueng , I might be mistaken, but with the default argument force = false
, I don't think that passing the force
argument from MulticopterLandDetector::_update_param(const bool force = false)
will result in re-loading the params every cycle. It would only result in forcing a reload if somewhere else this method is being called with a true argument, which doesn't happen anywhere I am able to find. Let me know if I'm not seeing things correctly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I think I see that your concern is with the additional 4 param_get() calls. I'll work on getting a PR opened to address that.
Describe problem solved by the proposed pull request
This PR captures the remaining
src/modules/land_detector/
directory changes from PR #9756 to simplify that PR.The changes in the
land_detector
directory are fairly straightforward:LandDetector::initialize_topics()
andLandDetector::update_topics()
parent class methods.This PR primarily aims to reduce the scope of PR #9756.
Describe possible alternatives
Keeping the current implementations is certainly a viable option; please let me know if that is the preference!
Additional context
See PR #9756.
Much of the original work proposed in this PR has already been carried out by #12209, #12677, #12702, #13079, and #13077.
Thanks!
-Mark