mirror of
https://git.intern.spaceteamaachen.de/ALPAKA/sta-peak.git
synced 2025-09-28 22:37:33 +00:00
Added slerp and updated quaternion class
This commit is contained in:
@@ -28,6 +28,7 @@ namespace sta
|
||||
Quaternion getAttitude();
|
||||
private:
|
||||
Quaternion state_;
|
||||
float ox_, oy_, oz_;
|
||||
float alpha_;
|
||||
float time_;
|
||||
};
|
||||
|
23
include/sta/math/algorithms/attitude/slerp.hpp
Normal file
23
include/sta/math/algorithms/attitude/slerp.hpp
Normal 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*/
|
@@ -18,6 +18,8 @@ namespace sta
|
||||
|
||||
Quaternion();
|
||||
|
||||
Quaternion integrate(float dt, float ox, float oy, float oz);
|
||||
|
||||
static Quaternion unit();
|
||||
|
||||
float norm();
|
||||
|
@@ -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_ */
|
||||
|
Reference in New Issue
Block a user