Skip to content
Snippets Groups Projects
Commit c5706f62 authored by bresch's avatar bresch Committed by Daniel Agar
Browse files

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.
parent 09b79516
No related branches found
No related tags found
No related merge requests found
......@@ -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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment