From be05b3e8d740bf7faf85e127284affba40f559f9 Mon Sep 17 00:00:00 2001 From: Matthias Grob Date: Tue, 21 Nov 2023 16:37:49 +0100 Subject: [PATCH] helper_functions: include defines for M_PI_PRECISE The defintion of the custom symbol M_PI_PRECISE was not included in one of the only places it's used. Looks like a mistake that happened in 34c852255e16bb62d2caf0c3be1f2fea660036ba possibly because a lot of things are included almost everywhere and if the include order ligns up there are no compile errors. --- src/lib/matrix/matrix/Quaternion.hpp | 2 +- src/lib/matrix/matrix/helper_functions.hpp | 4 +++- .../tasks/AutoFollowTarget/FlightTaskAutoFollowTarget.hpp | 1 - 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/lib/matrix/matrix/Quaternion.hpp b/src/lib/matrix/matrix/Quaternion.hpp index 5b91dde0a4..7155bdff1a 100644 --- a/src/lib/matrix/matrix/Quaternion.hpp +++ b/src/lib/matrix/matrix/Quaternion.hpp @@ -458,7 +458,7 @@ public: for (size_t i = 0; i < 4; i++) { if (std::fabs(q(i)) > FLT_EPSILON) { - return q * Type(matrix::sign(q(i))); + return q * Type(sign(q(i))); } } diff --git a/src/lib/matrix/matrix/helper_functions.hpp b/src/lib/matrix/matrix/helper_functions.hpp index 6a9e871ef0..08e74d7115 100644 --- a/src/lib/matrix/matrix/helper_functions.hpp +++ b/src/lib/matrix/matrix/helper_functions.hpp @@ -2,6 +2,8 @@ #include +#include "math.hpp" + namespace matrix { @@ -41,7 +43,7 @@ Floating wrap_floating(Floating x, Floating low, Floating high) return x - range * num_wraps; } -} // namespace detail +} // namespace detail /** * Wrap single precision floating point value to stay in range [low, high) diff --git a/src/modules/flight_mode_manager/tasks/AutoFollowTarget/FlightTaskAutoFollowTarget.hpp b/src/modules/flight_mode_manager/tasks/AutoFollowTarget/FlightTaskAutoFollowTarget.hpp index 23f4fdd0b7..1eb4ba8557 100644 --- a/src/modules/flight_mode_manager/tasks/AutoFollowTarget/FlightTaskAutoFollowTarget.hpp +++ b/src/modules/flight_mode_manager/tasks/AutoFollowTarget/FlightTaskAutoFollowTarget.hpp @@ -57,7 +57,6 @@ #include #include -#include #include // << Follow Target Behavior related constants >>