FlightTask: preserve vertical velocity during reactivation

to allow descending by stick for reliable land detection.
Issue:
Stick smoothing gets completely reset to state when not taken off
-> downwards velocity setpoint is gone when not taken off
-> in_descend flag of land detection is never true when not taken off
-> when landing but falling out of landing it landing detection fails
bafore taking off and landing again
This commit is contained in:
Matthias Grob 2021-08-04 18:55:51 +02:00 committed by Daniel Agar
parent c20e5e3a00
commit a461bb971a

View File

@ -20,7 +20,10 @@ bool FlightTask::activate(const vehicle_local_position_setpoint_s &last_setpoint
void FlightTask::reActivate()
{
activate(empty_setpoint);
// Preserve vertical velocity while on the ground to allow descending by stick for reliable land detection
vehicle_local_position_setpoint_s setpoint_preserve_vertical{empty_setpoint};
setpoint_preserve_vertical.vz = _velocity_setpoint(2);
activate(setpoint_preserve_vertical);
}
bool FlightTask::updateInitialize()