mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-06-01 02:55:07 +08:00
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:
@@ -153,8 +153,12 @@ bool FlightTaskAuto::_evaluateTriplets()
|
|||||||
|
|
||||||
bool triplet_update = true;
|
bool triplet_update = true;
|
||||||
|
|
||||||
if (!(fabsf(_triplet_target(0) - tmp_target(0)) > 0.001f || fabsf(_triplet_target(1) - tmp_target(1)) > 0.001f
|
if (PX4_ISFINITE(_triplet_target(0))
|
||||||
|| fabsf(_triplet_target(2) - tmp_target(2)) > 0.001f)) {
|
&& 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.
|
// Nothing has changed: just keep old waypoints.
|
||||||
triplet_update = false;
|
triplet_update = false;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user