Skip to content

Commit

Permalink
MulticopterPositionControl: readd takeoff ramp fix
Browse files Browse the repository at this point in the history
added in #14821 and accidentally removed in #14665
  • Loading branch information
MaEtUgR committed Mar 31, 2021
1 parent e9370c6 commit 72a93c5
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/modules/mc_pos_control/MulticopterPositionControl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,11 @@ void MulticopterPositionControl::Run()
const bool flying = (_takeoff.getTakeoffState() >= TakeoffState::flight);
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) {
// we are not flying yet and need to avoid any corrections
reset_setpoint_to_nan(_setpoint);
Expand Down

0 comments on commit 72a93c5

Please sign in to comment.