FlightTaskAuto - Recover position control after local position reset (#11636)

* FlightTaskAuto - Explicitly check is _triplet_target is finite to decide if the target has to be updated or not. If the _target is NAN, always try to update it to get a valid setpoint.
This commit is contained in:
bresch
2019-03-15 05:42:24 +01:00
committed by Daniel Agar
parent 09b795161e
commit c5706f6283
@@ -153,8 +153,12 @@ bool FlightTaskAuto::_evaluateTriplets()
bool triplet_update = true;
if (!(fabsf(_triplet_target(0) - tmp_target(0)) > 0.001f || fabsf(_triplet_target(1) - tmp_target(1)) > 0.001f
|| fabsf(_triplet_target(2) - tmp_target(2)) > 0.001f)) {
if (PX4_ISFINITE(_triplet_target(0))
&& PX4_ISFINITE(_triplet_target(1))
&& PX4_ISFINITE(_triplet_target(2))
&& fabsf(_triplet_target(0) - tmp_target(0)) < 0.001f
&& fabsf(_triplet_target(1) - tmp_target(1)) < 0.001f
&& fabsf(_triplet_target(2) - tmp_target(2)) < 0.001f) {
// Nothing has changed: just keep old waypoints.
triplet_update = false;