Browse Source

takeoff: only set _can_loiter_at_sp if takeoff position has been set

Signed-off-by: RomanBapst <bapstroman@gmail.com>
sbg
RomanBapst 5 years ago committed by Daniel Agar
parent
commit
0779a0502c
  1. 7
      src/modules/navigator/takeoff.cpp

7
src/modules/navigator/takeoff.cpp

@ -149,7 +149,12 @@ Takeoff::set_takeoff_position() @@ -149,7 +149,12 @@ Takeoff::set_takeoff_position()
memset(rep, 0, sizeof(*rep));
}
_navigator->set_can_loiter_at_sp(true);
if (PX4_ISFINITE(pos_sp_triplet->current.lat) && PX4_ISFINITE(pos_sp_triplet->current.lon)) {
_navigator->set_can_loiter_at_sp(true);
} else {
_navigator->set_can_loiter_at_sp(false);
}
_navigator->set_position_setpoint_triplet_updated();
}

Loading…
Cancel
Save