mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-20 04:23:33 +08:00
FlightTaskAuto: use built in matrix comparison
which corresponds to fabsf(a(0) - b(0)) < 1e-4f for each element.
This commit is contained in:
@@ -422,9 +422,7 @@ bool FlightTaskAuto::_evaluateTriplets()
|
|||||||
|| (_next_was_valid != _sub_triplet_setpoint.get().next.valid);
|
|| (_next_was_valid != _sub_triplet_setpoint.get().next.valid);
|
||||||
|
|
||||||
if (_triplet_target.isAllFinite()
|
if (_triplet_target.isAllFinite()
|
||||||
&& fabsf(_triplet_target(0) - tmp_target(0)) < 0.001f
|
&& (_triplet_target == tmp_target)
|
||||||
&& fabsf(_triplet_target(1) - tmp_target(1)) < 0.001f
|
|
||||||
&& fabsf(_triplet_target(2) - tmp_target(2)) < 0.001f
|
|
||||||
&& !prev_next_validity_changed) {
|
&& !prev_next_validity_changed) {
|
||||||
// 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