-
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
land_detector: quick workaround for MC NAN setpoints #15426
Conversation
8395e3d
to
2895168
Compare
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.
Just an idea, we can take your workaround first to not spent too long. It should work with the current setpoint generation implementation.
|
||
if (_vehicle_control_mode.flag_control_climb_rate_enabled && vz_valid) { | ||
// setpoints can briefly be NAN to signal resets, TODO: fix in multicopter position controller | ||
if (PX4_ISFINITE(_vehicle_local_position_setpoint.vz)) { |
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.
This means in every case where there's no vertical velocity setpoint the _in_descend
state just stays how it was. The only cases that come to my mind where no vertical velocity setpoint is set (intentionally) are: the thrust cut when ground is detected (that's the constelation that leads to the bug you found) and the in failsafe descend when there's no RC and the vehicle looses the vertical velocity estimate.
What about we capture the case where there's no vertical velocity setpoint and in that case compare vertical acceleration. E.g. the thrust cut is a huge downwards acceleration to enable the land detector to detect maybe landed and landed. And with that huge downwards acceleration you expect no freefall.
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.
The acceleration condition sounds good, I'm not sure what that wasn't already a factor. My only immediate concern is the current time scale of the ground contact and its hysteresis.
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.
In flag_control_climb_rate_enabled
(and vz_valid) if the vz setpoint is NAN we could just set _in_descend to 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.
in failsafe descend when there's no RC and the vehicle looses the vertical velocity estimate.
Actually, this one isn't going to matter because ground_contact
is only used by maybe_landed
if vz and z estimates are valid.
Going back to the larger PR. #15083 |
This is a quick fix for one of the issues found in the process of fixing other MC land detector issues.
When the multicopter position controller sees
ground_contact
the setpoint reset (NANs) is briefly published onvehicle_local_position_setpoint
. This can force the multicopter land detector_in_descend
state immediately back to false which interrupts ground_contact if not currently in low thrust.https://github.com/PX4/Firmware/blob/7354e3989335dfb38cc41216182f48fe84d165c7/src/modules/mc_pos_control/mc_pos_control_main.cpp#L644-L654