mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-07-09 05:30:35 +08:00
better function descriptions for rotation classes:
- do not talk specifically about body or earth frame, just use frame 1 and frame 2
This commit is contained in:
+15
-8
@@ -3,6 +3,12 @@
|
||||
*
|
||||
* A direction cosine matrix class.
|
||||
*
|
||||
* This library uses the convention that premultiplying a three dimensional
|
||||
* vector represented in coordinate system 1 will apply a rotation from coordinate system
|
||||
* 1 to coordinate system 2 to the vector. The rotation is performed following the right-hand rule.
|
||||
* Likewise, a matrix instance of this class also represents a coordinate transformation
|
||||
* from frame 2 to frame 1.
|
||||
*
|
||||
* @author James Goppert <james.goppert@gmail.com>
|
||||
*/
|
||||
|
||||
@@ -66,7 +72,7 @@ public:
|
||||
* Constructor from quaternion
|
||||
*
|
||||
* Instance is initialized from quaternion representing
|
||||
* transformation from inertial frame to body frame.
|
||||
* coordinate transformation from frame 2 to frame 1.
|
||||
*
|
||||
* @param q quaternion to set dcm to
|
||||
*/
|
||||
@@ -77,10 +83,11 @@ public:
|
||||
/**
|
||||
* Constructor from euler angles
|
||||
*
|
||||
* Instance is initialized from angle tripplet (3,2,1) representing
|
||||
* transformation from body frame to inertial frame.
|
||||
* This sets the transformation matrix from frame 2 to frame 1 where the rotation
|
||||
* from frame 1 to frame 2 is described by a 3-2-1 intrinsic Tait-Bryan rotation sequence.
|
||||
*
|
||||
* @param euler euler angles to set dcm to
|
||||
*
|
||||
* @param euler euler angle instance
|
||||
*/
|
||||
Dcm(const Euler<Type> & euler) {
|
||||
set_from_euler(euler);
|
||||
@@ -91,7 +98,7 @@ public:
|
||||
* Set from quaternion
|
||||
*
|
||||
* Instance is set from quaternion representing
|
||||
* transformation from inertial frame to body frame.
|
||||
* transformation from frame 2 to frame 1.
|
||||
*
|
||||
* @param q quaternion to set dcm to
|
||||
*/
|
||||
@@ -119,10 +126,10 @@ public:
|
||||
/**
|
||||
* Set from euler angles
|
||||
*
|
||||
* Instance is set from angle tripplet (3,2,1) representing
|
||||
* transformation from body frame to inertial frame.
|
||||
* This provides the transformation matrix from frame 2 to frame 1 where the rotation
|
||||
* from frame 1 to frame 2 is described by a 3-2-1 intrinsic Tait-Bryan rotation sequence
|
||||
*
|
||||
* @param euler euler angles to set dcm to
|
||||
* @param euler euler angle instannce
|
||||
*/
|
||||
void set_from_euler(const Euler<Type> & euler) {
|
||||
Dcm &dcm = *this;
|
||||
|
||||
+25
-16
@@ -1,7 +1,12 @@
|
||||
/**
|
||||
* @file Euler.hpp
|
||||
*
|
||||
* Euler angle tait-bryan body 3-2-1
|
||||
* An instance of this class defines a rotation from coordinate frame 1 to coordinate frame 2.
|
||||
* It follows the convention of an intrinsic tait-bryan 3-2-1 sequence.
|
||||
* In order to go from frame 1 to frame 2 we apply the following rotations consecutively.
|
||||
* 1) We rotate about our initial Z axis by an angle of _psi.
|
||||
* 2) We rotate about the newly created Y' axis by an angle of _theta.
|
||||
* 3) We rotate about the newly created X'' axis by an angle of _phi.
|
||||
*
|
||||
* @author James Goppert <james.goppert@gmail.com>
|
||||
*/
|
||||
@@ -68,9 +73,9 @@ public:
|
||||
* Instance is initialized from angle tripplet (3,2,1)
|
||||
* representing transformation from body frame to inertial frame.
|
||||
*
|
||||
* @param phi_ roll
|
||||
* @param theta_ pitch
|
||||
* @param psi_ yaw
|
||||
* @param phi_ rotation angle about X axis
|
||||
* @param theta_ rotation angle about Y axis
|
||||
* @param psi_ rotation angle about Z axis
|
||||
*/
|
||||
Euler(Type phi_, Type theta_, Type psi_) : Vector<Type, 3>()
|
||||
{
|
||||
@@ -78,26 +83,30 @@ public:
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructor from dcm
|
||||
* Constructor from DCM matrix
|
||||
*
|
||||
* Instance is initialized from dcm representing transformation
|
||||
* from body frame to inertial frame.
|
||||
* Instance is set from Dcm representing
|
||||
* transformation from frame 2 to frame 1.
|
||||
* This instance will hold the angles defining the rotation
|
||||
* from frame 1 to frame 2.
|
||||
*
|
||||
* @param dcm_ dcm to set angles to
|
||||
*/
|
||||
* @param dcm Direction cosine matrix
|
||||
*/
|
||||
Euler(const Dcm<Type> & dcm) : Vector<Type, 3>()
|
||||
{
|
||||
set_from_dcm(dcm);
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructor from quaternion
|
||||
* Constructor from quaternion instance.
|
||||
*
|
||||
* Instance is initialized from quaternion representing
|
||||
* transformation from body frame to inertial frame.
|
||||
* Instance is set from a quaternion representing
|
||||
* transformation from frame 2 to frame 1.
|
||||
* This instance will hold the angles defining the rotation
|
||||
* from frame 1 to frame 2.
|
||||
*
|
||||
* @param q quaternion to set angles to
|
||||
*/
|
||||
* @param q quaternion
|
||||
*/
|
||||
Euler(const Quaternion<Type> & q) :
|
||||
Vector<Type, 3>()
|
||||
{
|
||||
@@ -108,7 +117,7 @@ public:
|
||||
* Set from euler angles
|
||||
*
|
||||
* Instance is set from angle tripplet (3,2,1) representing
|
||||
* transformation from body frame to inertial frame.
|
||||
* rotation from frame 1 to frame 2.
|
||||
*
|
||||
* @param phi_ roll
|
||||
* @param theta_ pitch
|
||||
@@ -125,7 +134,7 @@ public:
|
||||
* Set from dcm
|
||||
*
|
||||
* Instance is set from dcm representing transformation
|
||||
* from body frame to inertial frame.
|
||||
* from frame 2 to frame 1.
|
||||
*
|
||||
* @param dcm_ dcm to set angles to
|
||||
*/
|
||||
|
||||
+15
-13
@@ -71,8 +71,8 @@ public:
|
||||
/**
|
||||
* Constructor from dcm
|
||||
*
|
||||
* Instance is initialized from a dcm representing transformation
|
||||
* from inertial frame to body frame.
|
||||
* Instance is initialized from a dcm representing coordinate transformation
|
||||
* from frame 2 to frame 1.
|
||||
*
|
||||
* @param dcm dcm to set quaternion to
|
||||
*/
|
||||
@@ -85,10 +85,11 @@ public:
|
||||
/**
|
||||
* Constructor from euler angles
|
||||
*
|
||||
* Instance is initialized from angle tripplet (3,2,1) representing
|
||||
* transformation from body frame to inertial frame.
|
||||
* This sets the instance to a quaternion representing coordinate transformation from
|
||||
* frame 2 to frame 1 where the rotation from frame 1 to frame 2 is described
|
||||
* by a 3-2-1 intrinsic Tait-Bryan rotation sequence.
|
||||
*
|
||||
* @param euler euler angles to set quaternion to
|
||||
* @param euler euler angle instance
|
||||
*/
|
||||
Quaternion(const Euler<Type> & euler) :
|
||||
Vector<Type, 4>()
|
||||
@@ -99,8 +100,8 @@ public:
|
||||
/**
|
||||
* Constructor from quaternion values
|
||||
*
|
||||
* Instance is initialized from quaternion values representing
|
||||
* transformation from inertial frame to body frame.
|
||||
* Instance is initialized from quaternion values representing coordinate
|
||||
* transformation from frame 2 to frame 1.
|
||||
*
|
||||
* @param a set quaternion value 0
|
||||
* @param b set quaternion value 1
|
||||
@@ -116,8 +117,8 @@ public:
|
||||
/**
|
||||
* Set from dcm
|
||||
*
|
||||
* Instance is set from a dcm representing transformation
|
||||
* from inertial frame to body frame.
|
||||
* Instance is set from a dcm representing coordinate transformation
|
||||
* from frame 2 to frame 1.
|
||||
*
|
||||
* @param dcm dcm to set quaternion to
|
||||
*/
|
||||
@@ -137,8 +138,9 @@ public:
|
||||
/**
|
||||
* Set from euler angles
|
||||
*
|
||||
* Instance is set from angle tripplet (3,2,1) representing
|
||||
* transformation from body frame to inertial frame.
|
||||
* This sets the instance to a quaternion representing coordinate transformation from
|
||||
* frame 2 to frame 1 where the rotation from frame 1 to frame 2 is described
|
||||
* by a 3-2-1 intrinsic Tait-Bryan rotation sequence.
|
||||
*
|
||||
* @param euler euler angles to set quaternion to
|
||||
*/
|
||||
@@ -164,8 +166,8 @@ public:
|
||||
/**
|
||||
* Set from quaternion values
|
||||
*
|
||||
* Instance is set from quaternion values representing
|
||||
* transformation from inertial frame to body frame.
|
||||
* Instance is set from quaternion values representing coordinate
|
||||
* transformation from frame 2 to frame 1.
|
||||
*
|
||||
* @param a set quaternion value 0
|
||||
* @param b set quaternion value 1
|
||||
|
||||
Reference in New Issue
Block a user