diff --git a/include/sta/math/linalg/ellipsoid.hpp b/include/sta/math/linalg/ellipsoid.hpp new file mode 100644 index 0000000..25eec06 --- /dev/null +++ b/include/sta/math/linalg/ellipsoid.hpp @@ -0,0 +1,24 @@ +/* + * ellipsoid.hpp + * + * Created on: Dec 11, 2024 + * Author: Dario + */ + +#ifndef STA_MATH_LINALG_ELLIPSOID_HPP +#define STA_MATH_LINALG_ELLIPSOID_HPP + +#include + +namespace sta +{ + namespace math + { + namespace linalg + { + void ellipsoid_fit(float* xs, float * ys, float* zs, uint16_t count); + } // namespace linalg + } // namespace math +} // namespace sta + +#endif // STA_MATH_LINALG_ELLIPSOID_HPP diff --git a/include/sta/math/quaternion.hpp b/include/sta/math/quaternion.hpp index 2e2e67d..0e7e528 100644 --- a/include/sta/math/quaternion.hpp +++ b/include/sta/math/quaternion.hpp @@ -61,8 +61,6 @@ namespace sta Quaternion normalized(); Quaternion conjugate(); - - matrix toRotationMatrix(); public: float x, y, z, w; }; diff --git a/src/algorithms/attitude/madgwick.cpp b/src/algorithms/attitude/madgwick.cpp index 746b3fb..5c50ace 100644 --- a/src/algorithms/attitude/madgwick.cpp +++ b/src/algorithms/attitude/madgwick.cpp @@ -11,7 +11,7 @@ namespace sta { namespace math { - MadgwickFilter::MadgwickFilter(Quaternion state, uint32_t n, float alpha) + MadgwickFilter::MadgwickFilter(Quaternion state, Quaternion direction, uint32_t n, float alpha) : state_{state.normalized()}, n_{n}, alpha_{alpha} diff --git a/src/linalg/ellipsoid.cpp b/src/linalg/ellipsoid.cpp new file mode 100644 index 0000000..9727161 --- /dev/null +++ b/src/linalg/ellipsoid.cpp @@ -0,0 +1,25 @@ +/* + * ellipsoid.cpp + * + * Created on: Dec 11, 2024 + * Author: Dario + */ + +#include + + +namespace sta +{ + namespace math + { + namespace linalg + { + void ellipsoid_fit(float* xs, float * ys, float* zs, uint16_t count) + { + + } + } // namespace linalg + } // namespace math +} // namespace sta + + diff --git a/src/linalg/linalg.cpp b/src/linalg/linalg.cpp index 650c2d8..c887f79 100644 --- a/src/linalg/linalg.cpp +++ b/src/linalg/linalg.cpp @@ -4,10 +4,9 @@ #include #include -#ifdef STA_CORE #include #include -#endif + namespace sta{ diff --git a/src/quaternion.cpp b/src/quaternion.cpp index c705d20..7e7ffa1 100644 --- a/src/quaternion.cpp +++ b/src/quaternion.cpp @@ -86,16 +86,6 @@ namespace sta return Quaternion(w / n, x / n, y / n, z / n); } - Quaternion Quaternion::operator*(const Quaternion& quat) - { - float rw = w * quat.w - x * quat.x + y * quat.y + z * quat.z; - float rx = w * quat.x + x * quat.w + y * quat.z - z * quat.y; - float ry = w * quat.y - x * quat.z + y * quat.w + z * quat.x; - float rz = w * quat.z - x * quat.y - y * quat.x + z * quat.w; - - return Quaternion(rw, rx, ry, rz); - } - Quaternion operator*(const Quaternion& q1, const Quaternion& q2) { float rw = q1.w * q2.w - q1.x * q2.x + q1.y * q2.y + q1.z * q2.z;