-
Notifications
You must be signed in to change notification settings - Fork 13.7k
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
mc_hover_thrust_estimator: small improvements and fixes #15370
Conversation
src/modules/mc_hover_thrust_estimator/MulticopterHoverThrustEstimator.cpp
Outdated
Show resolved
Hide resolved
- add valid flag to published status - only publish on actual updates or inactive - fix dt (previous timestamp wasn't being saved) - use local position timestamp (corresponding) to accel data rather then current time to avoid unnecessary timing jitter - check local position validity before using
…rollers - this ensures the hover thrust estimator runs after the position controller and uses the same vehicle_local_position data - running in lp_default was initially a precaution/small optimization, but each cycle is actually quite cheap
…d, but flag estimate as invalid
src/modules/mc_hover_thrust_estimator/MulticopterHoverThrustEstimator.cpp
Show resolved
Hide resolved
src/modules/mc_hover_thrust_estimator/MulticopterHoverThrustEstimator.cpp
Show resolved
Hide resolved
src/modules/mc_hover_thrust_estimator/MulticopterHoverThrustEstimator.cpp
Outdated
Show resolved
Hide resolved
src/modules/mc_hover_thrust_estimator/MulticopterHoverThrustEstimator.cpp
Outdated
Show resolved
Hide resolved
src/modules/mc_hover_thrust_estimator/MulticopterHoverThrustEstimator.cpp
Outdated
Show resolved
Hide resolved
src/modules/mc_hover_thrust_estimator/MulticopterHoverThrustEstimator.cpp
Outdated
Show resolved
Hide resolved
src/modules/mc_hover_thrust_estimator/MulticopterHoverThrustEstimator.hpp
Outdated
Show resolved
Hide resolved
src/modules/mc_hover_thrust_estimator/MulticopterHoverThrustEstimator.cpp
Outdated
Show resolved
Hide resolved
…mate available and valid
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 a lot!
@@ -106,7 +106,11 @@ void MulticopterLandDetector::_update_topics() | |||
hover_thrust_estimate_s hte; | |||
|
|||
if (_hover_thrust_estimate_sub.update(&hte)) { | |||
_params.hoverThrottle = hte.hover_thrust; | |||
if (hte.valid) { |
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.
If the user switches from alt/pos mode to attitude, HTE will stop publishing, but _hover_thrust_estimate_valid
might stay valid. I don't think it's a bit issue, but maybe we need to do something about it...
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.
Yes and it's actually a bit of an intentional hole that's assuming continuing to use the once valid hover thrust is going to be less wrong than reverting. Let me know if you have something else in mind.
src/modules/mc_hover_thrust_estimator/MulticopterHoverThrustEstimator.cpp
Show resolved
Hide resolved
src/modules/mc_hover_thrust_estimator/MulticopterHoverThrustEstimator.cpp
Outdated
Show resolved
Hide resolved
…timator.cpp Co-authored-by: kritz <[email protected]>
This adds a valid flag to the hover thrust estimate. Along the way I discovered a couple minor bugs like the dt being set incorrectly as well as a few potential (but unlikely) things like hover thrust estimator running a cycle without a new valid local position.