-
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
Takeoff: check if the desired velocity is finite when generating the takeoff velocity ramp #13973
Conversation
…takeoff velocity ramp
aa29aa9
to
9d5577e
Compare
Ouch, that's a good find! Thanks a lot for the detailed problem description and fix. 👍 I was just thinking about the case where the limit parameter |
@@ -115,6 +116,10 @@ float Takeoff::updateRamp(const float dt, const float takeoff_desired_vz) | |||
} | |||
|
|||
if (_takeoff_state == TakeoffState::rampup) { | |||
if (!PX4_ISFINITE(takeoff_desired_vz)) { | |||
return _takeoff_ramp_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.
I think the ramp should continue to the maximum speed constraint to avoid getting stuck in case takeoff_desired_vz
stays always NaN. I can make a suggestion.
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.
Here's the suggestion: #14339
Describe problem solved by this pull request
Drone takes off, executes an auto mission, lands, but never detects landing, instead keeps high thrust indefinitely.
When the mission starts (with a command) the flight task doesn't update for one iteration (#13971 #13668). If this happens while the takeoff state machine is in state
rampup
, the controller constraints remain NAN as initialized andTakeoff::updateRamp
would set_takeoff_ramp_vz
to NAN. With_takeoff_ramp_vz
being NAN, the takeoff state machine can not leave therampup
state which leads tolimit_thrust_during_landing
never being called and thrust never set to 0, even though ground contact is true.Maybe landed
requires low thrust, solanded
is never detected.Describe your solution
Proposed solution is to check whether the constraint that is used in ramp computation is NAN. While it is NAN the ramp is not updated.