Added slerp and updated quaternion class

This commit is contained in:
dario
2024-06-19 15:08:02 +02:00
parent e3d45a11c3
commit 059b356ec7
8 changed files with 122 additions and 21 deletions

View File

@@ -28,6 +28,7 @@ namespace sta
Quaternion getAttitude();
private:
Quaternion state_;
float ox_, oy_, oz_;
float alpha_;
float time_;
};

View File

@@ -0,0 +1,23 @@
/*
* slerp.hpp
*
* Created on: Jun 19, 2024
* Author: Dario
*/
#ifndef STA_MATHS_ATTITUDE_SLERP_HPP
#define STA_MATHS_ATTITUDE_SLERP_HPP
#include <sta/math/quaternion.hpp>
namespace sta
{
namespace math
{
Quaternion slerp(Quaternion q1, Quaternion q2, float beta);
} // namespace math
} // namespace sta
#endif /* STA_MATHS_ATTITUDE_SLERP_HPP*/

View File

@@ -18,6 +18,8 @@ namespace sta
Quaternion();
Quaternion integrate(float dt, float ox, float oy, float oz);
static Quaternion unit();
float norm();

View File

@@ -1,12 +1,16 @@
#ifndef INC_UTILS_HPP_
#define INC_UTILS_HPP_
#include <math.h>
namespace sta
{
namespace math
{
float fast_inv_sqrt(float);
float clip(float value, float min, float max);
} // namespace math
} // namespace sta
#endif /* INC_UTILS_HPP_ */
#endif /* INC_UTILS_HPP_ */