mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-23 08:13:33 +08:00
More testing and cleanup.
This commit is contained in:
+15
-2
@@ -36,6 +36,16 @@ public:
|
||||
q(3) = 0;
|
||||
}
|
||||
|
||||
Quaternion(const Vector<Type, 4> & other) :
|
||||
Vector<Type, 4>(other)
|
||||
{
|
||||
}
|
||||
|
||||
Quaternion(const Matrix<Type, 4, 1> & other) :
|
||||
Vector<Type, 4>(other)
|
||||
{
|
||||
}
|
||||
|
||||
Quaternion(const Dcm<Type> & dcm) :
|
||||
Vector<Type, 4>()
|
||||
{
|
||||
@@ -50,7 +60,9 @@ public:
|
||||
(4 * q(0)));
|
||||
}
|
||||
|
||||
Quaternion(const Euler<Type> & euler) {
|
||||
Quaternion(const Euler<Type> & euler) :
|
||||
Vector<Type, 4>()
|
||||
{
|
||||
Quaternion &q = *this;
|
||||
Type cosPhi_2 = Type(cos(euler.phi() / 2.0));
|
||||
Type cosTheta_2 = Type(cos(euler.theta() / 2.0));
|
||||
@@ -68,7 +80,8 @@ public:
|
||||
sinPhi_2 * sinTheta_2 * cosPsi_2;
|
||||
}
|
||||
|
||||
Quaternion(Type a, Type b, Type c, Type d) : Vector<Type, 4>()
|
||||
Quaternion(Type a, Type b, Type c, Type d) :
|
||||
Vector<Type, 4>()
|
||||
{
|
||||
Quaternion &q = *this;
|
||||
q(0) = a;
|
||||
|
||||
Reference in New Issue
Block a user