mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-11-03 06:21:35 +08:00
MulticopterPositionControl: readd takeoff ramp fix
added in #14821 and accidentally removed in #14665
This commit is contained in:
@@ -365,6 +365,11 @@ void MulticopterPositionControl::Run()
|
|||||||
const bool flying = (_takeoff.getTakeoffState() >= TakeoffState::flight);
|
const bool flying = (_takeoff.getTakeoffState() >= TakeoffState::flight);
|
||||||
const bool flying_but_ground_contact = (flying && _vehicle_land_detected.ground_contact);
|
const bool flying_but_ground_contact = (flying && _vehicle_land_detected.ground_contact);
|
||||||
|
|
||||||
|
// make sure takeoff ramp is not amended by acceleration feed-forward
|
||||||
|
if (!flying) {
|
||||||
|
_setpoint.acceleration[2] = NAN;
|
||||||
|
}
|
||||||
|
|
||||||
if (not_taken_off || flying_but_ground_contact) {
|
if (not_taken_off || flying_but_ground_contact) {
|
||||||
// we are not flying yet and need to avoid any corrections
|
// we are not flying yet and need to avoid any corrections
|
||||||
reset_setpoint_to_nan(_setpoint);
|
reset_setpoint_to_nan(_setpoint);
|
||||||
|
|||||||
Reference in New Issue
Block a user