Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages | Examples

O_SESSAME::Rotation Class Reference
[Rotation Library]

#include <Rotation.h>

Collaboration diagram for O_SESSAME::Rotation:

Collaboration graph
[legend]
List of all members.

Detailed Description

A generalized rotation class to represent any attitude coordinate transformation.

Todo:
Write description of rotation class.

Examples:
It is very easy to setup and output rotations. Note that to output a rotation you must first choose what attitude state to represent it in (you cannot "cout << MyRotation" directly:
Rotation rotOB;
rotOB.Set(deg2rad(40),deg2rad(-10),deg2rad(0), 321); \\ setup a 321 rotation of euler angles with [40, -10, 0] deg
cout << rotOB.GetDCM();

Successive Rotations:

Rotation rotOB(quatOB); // create a rotation given the quaternion from Body to Orbital
Rotation rotIO(quatIO); // create a rotation given the quaternion from Orbital to Inertial
Rotation rotIB;
rotIB = rotIO * rotOB; // the successive rotation can be calculate by 'multiplying' the rotations
rotIB = rotIO + rotOB; // or by 'adding' them

Inverse Transformation:

Rotation rotBI;
rotBI = ~rotIB; // determine the transformation from Inertial to Body from the inverse (transpose) of Body to Inertial

Relative Rotation:

Rotation rotError;
rotError = rotTrue - rotActual; // determine the error rotation by taking the 'difference' between the two respective rotations

Definition at line 398 of file Rotation.h.

Public Member Functions

 Rotation ()
 Default Constructor. Create a Rotation with no offset.
 Rotation (const Matrix &_inMatrix)
 Create a Rotation from a direction cosine matrix.
 Rotation (const DirectionCosineMatrix &_DCM)
 Create a Rotation from a direction cosine matrix.
 Rotation (const Vector &_Angles, const int &_Sequence)
 Create a Rotation from an euler angle sequence.
 Rotation (const Angle &_Angle1, const Angle &_Angle2, const Angle &_Angle3, const int &_Sequence)
 Create a Rotation from an euler angle sequence.
 Rotation (const Vector &_Axis, const Angle &_Angle)
 Create a Rotation from a given euler axis and angle.
 Rotation (const ModifiedRodriguezParameters &_MRP)
 Create a Rotation from a given set of Modified Rodriguez Parameters.
 Rotation (const Quaternion &_quat)
 Create a Rotation from a given quaternion.
virtual ~Rotation ()
 Default Destructor.
void Set (const Matrix &_inMatrix)
 Set the Rotation from a converted DCM.
void Set (const DirectionCosineMatrix &_DCM)
 Set the Rotation from a converted DCM.
void Set (const Vector &_Angles, const int &_Sequence)
 Set the Rotation from an euler angle sequence.
void Set (const Angle &_Angle1, const Angle &_Angle2, const Angle &_Angle3, const int &_Sequence)
 Create a Rotation from an euler angle sequence.
void Set (const Vector &_Axis, const Angle &_Angle)
 Set the Rotation from a converted Euler Axis and Angle set.
void Set (const ModifiedRodriguezParameters &_MRP)
 Set the Rotation from a converted vector of MRP.
void Set (const Quaternion &_quat)
 Set the Rotation from a converted quaternion.
DirectionCosineMatrix GetDCM () const
 Return the Direction Cosine Matrix (DCM) form of the attitude transformation.
Vector GetEulerAngles (const int &_Sequence) const
 Return the Euler angles from the rotation representation.
Vector GetEulerAxisAngle (Vector &_EulerAxis, Angle &_EulerAngle) const
 Return the Euler Axis and Angle form of the attitude transformation.
Vector GetEulerAxisAngle () const
 Return the Euler Axis and Angle form of the attitude transformation.
ModifiedRodriguezParameters GetMRP () const
 Return the Modified Rodriguez Parameters vector form of the attitude transformation.
Quaternion GetQuaternion () const
 Return the quaternion form of the attitude transformation.
Vector GetRotation (const RotationType &_type, const int &_Sequence=123) const
 Return the rotation based on the specified parameterization.
Rotation operator * (const Rotation &_rot2) const
 Multiply the rotation matrices together to determine the successive rotation.
Vector operator * (const Vector &_vec) const
 Multiply the rotation by the Vector for a rotation.
Rotation operator~ () const
 Take the inverse of the rotation matrix.
Rotation operator+ (const Rotation &_rot2) const
 Determine the successive rotation from the summation of two rotations.
Rotation operator- (const Rotation &_rot2) const

Private Attributes

Quaternion m_quaternion
 internal representation of the attitude transformation.
RotationSense m_RotationSense
 Handed-ness of the rotation, either LEFT_HANDED or RIGHT_HANDED.


Constructor & Destructor Documentation

O_SESSAME::Rotation::Rotation  ) 
 

Default Constructor. Create a Rotation with no offset.

Definition at line 20 of file Rotation.cpp.

References O_SESSAME::RIGHT_HAND.

Referenced by operator *().

O_SESSAME::Rotation::Rotation const Matrix _inMatrix  ) 
 

Create a Rotation from a direction cosine matrix.

Parameters:
_inMatrix 3x3 matrix of Direction Cosine Matrix (DCM) values.

Definition at line 29 of file Rotation.cpp.

References O_SESSAME::Matrix, and Set().

O_SESSAME::Rotation::Rotation const DirectionCosineMatrix _Matrix  ) 
 

Create a Rotation from a direction cosine matrix.

Parameters:
_DCM instance of Direction Cosine Matrix (DCM) class.

Definition at line 34 of file Rotation.cpp.

References Set().

O_SESSAME::Rotation::Rotation const Vector _Angles,
const int &  _Sequence
 

Create a Rotation from an euler angle sequence.

Parameters:
_Angles 3x1 matrix of euler angles.
_Sequence Euler angle rotation sequence. (ie 123, 213, 313, 321, etc).

Definition at line 40 of file Rotation.cpp.

References Set(), and O_SESSAME::Vector.

O_SESSAME::Rotation::Rotation const Angle _Angle1,
const Angle _Angle2,
const Angle _Angle3,
const int &  _Sequence
 

Create a Rotation from an euler angle sequence.

Parameters:
_Angle1 first angles in Euler angle set. [rad]
_Angle2 second angles in Euler angle set. [rad]
_Angle3 third angles in Euler angle set. [rad]
_Sequence Euler angle rotation sequence. (ie 123, 213, 313, 321, etc).

Definition at line 48 of file Rotation.cpp.

References Set().

O_SESSAME::Rotation::Rotation const Vector _Axis,
const Angle _Angle
 

Create a Rotation from a given euler axis and angle.

Parameters:
Axis 3x1 Euler Axis
Angle Angle rotation about axis [rad].

Definition at line 54 of file Rotation.cpp.

References Set(), and O_SESSAME::Vector.

O_SESSAME::Rotation::Rotation const ModifiedRodriguezParameters _MRP  ) 
 

Create a Rotation from a given set of Modified Rodriguez Parameters.

Parameters:
_MRP 3x1 MRP vector to be represented.

Definition at line 59 of file Rotation.cpp.

References Set().

O_SESSAME::Rotation::Rotation const Quaternion _quat  ) 
 

Create a Rotation from a given quaternion.

Parameters:
_quat 4x1 quaternion to be represented.

Definition at line 64 of file Rotation.cpp.

References Set().

O_SESSAME::Rotation::~Rotation  )  [virtual]
 

Default Destructor.

Definition at line 24 of file Rotation.cpp.


Member Function Documentation

DirectionCosineMatrix O_SESSAME::Rotation::GetDCM  )  const
 

Return the Direction Cosine Matrix (DCM) form of the attitude transformation.

Returns:
3x3 Direction Cosine Matrix (DCM).

Definition at line 148 of file Rotation.cpp.

References m_quaternion.

Referenced by GetRotation(), main(), operator *(), slidingModeControlMRPMW::Run(), MRPTracking::Run(), and AngularRateController::Run().

Vector O_SESSAME::Rotation::GetEulerAngles const int &  _Sequence  )  const
 

Return the Euler angles from the rotation representation.

Parameters:
_Sequence Euler angle rotation sequence. (ie 123, 213, 313, 321, etc).
Returns:
_Angles 3x1 matrix of euler angles.

Definition at line 157 of file Rotation.cpp.

References O_SESSAME::Quaternion::GetEulerAngles(), m_quaternion, and O_SESSAME::Vector.

Referenced by GetRotation().

Vector O_SESSAME::Rotation::GetEulerAxisAngle  )  const
 

Return the Euler Axis and Angle form of the attitude transformation.

Returns:
4-element vector of the Euler Axis and Angle [EulerAxis; EulerAngle].

Definition at line 165 of file Rotation.cpp.

References O_SESSAME::Quaternion::GetEulerAxisAngle(), m_quaternion, and O_SESSAME::Vector.

Referenced by GetRotation().

Vector O_SESSAME::Rotation::GetEulerAxisAngle Vector _EulerAxis,
Angle _EulerAngle
const
 

Return the Euler Axis and Angle form of the attitude transformation.

Parameters:
_EulerAxis 3x1 Euler Axis to be returned.
_EulerAngle Euler angle of rotation [rad].

Definition at line 174 of file Rotation.cpp.

References O_SESSAME::Quaternion::GetEulerAxisAngle(), m_quaternion, and O_SESSAME::Vector.

ModifiedRodriguezParameters O_SESSAME::Rotation::GetMRP  )  const
 

Return the Modified Rodriguez Parameters vector form of the attitude transformation.

Returns:
3x1 MRP vector.

Definition at line 182 of file Rotation.cpp.

References m_quaternion.

Referenced by GetRotation().

Quaternion O_SESSAME::Rotation::GetQuaternion  )  const
 

Return the quaternion form of the attitude transformation.

Returns:
4x1 quaternion.

Definition at line 190 of file Rotation.cpp.

Referenced by GetRotation(), main(), and DMU::SetSensorToBodyQuaternions().

Vector O_SESSAME::Rotation::GetRotation const RotationType _type,
const int &  _Sequence = 123
const
 

Return the rotation based on the specified parameterization.

Todo:
completely document various rotation return types
Parameters:
_type rotation parameterization type to return the rotation representation in.
_Sequence for Euler Angle sets, specify the desired rotation sequence.
Returns:
the rotation represented by the specified rotation.

Definition at line 201 of file Rotation.cpp.

References _, O_SESSAME::DCM_SIZE, GetDCM(), GetEulerAngles(), GetEulerAxisAngle(), GetMRP(), GetQuaternion(), O_SESSAME::Matrix, O_SESSAME::Vector, and O_SESSAME::VectorIndexBase.

Referenced by O_SESSAME::AttitudeState::GetState(), and O_SESSAME::AttitudeHistory::GetState().

Vector O_SESSAME::Rotation::operator * const Vector _vec2  )  const
 

Multiply the rotation by the Vector for a rotation.

Returns:
3x1 Rotated vector.

Definition at line 245 of file Rotation.cpp.

References O_SESSAME::Vector.

Rotation O_SESSAME::Rotation::operator * const Rotation _rot2  )  const
 

Multiply the rotation matrices together to determine the successive rotation.

Returns:
the successive rotation representation.

Definition at line 238 of file Rotation.cpp.

References GetDCM(), and Rotation().

Rotation O_SESSAME::Rotation::operator+ const Rotation _rot2  )  const
 

Determine the successive rotation from the summation of two rotations.

Parameters:
_rot2 Rotation to be summed with.

Definition at line 261 of file Rotation.cpp.

Rotation O_SESSAME::Rotation::operator- const Rotation _rot2  )  const
 

Definition at line 272 of file Rotation.cpp.

Rotation O_SESSAME::Rotation::operator~  )  const
 

Take the inverse of the rotation matrix.

Returns:
3x3 Direction Cosine Matrix (DCM).

Definition at line 253 of file Rotation.cpp.

void O_SESSAME::Rotation::Set const Quaternion _quat  ) 
 

Set the Rotation from a converted quaternion.

Parameters:
_quat 4x1 quaternion to set the Rotation.

Definition at line 135 of file Rotation.cpp.

References m_quaternion.

void O_SESSAME::Rotation::Set const ModifiedRodriguezParameters _MRP  ) 
 

Set the Rotation from a converted vector of MRP.

Parameters:
_MRP 3x1 vector of Modified Rodriguez Parameters to set the Rotation.

Definition at line 126 of file Rotation.cpp.

References m_quaternion, and O_SESSAME::Quaternion::Set().

void O_SESSAME::Rotation::Set const Vector _Axis,
const Angle _Angle
 

Set the Rotation from a converted Euler Axis and Angle set.

Parameters:
_Axis 3x1 Euler Axis.
_Angle Angle rotation about axis [rad].

Definition at line 117 of file Rotation.cpp.

References m_quaternion, O_SESSAME::Quaternion::Set(), and O_SESSAME::Vector.

void O_SESSAME::Rotation::Set const Angle _Angle1,
const Angle _Angle2,
const Angle _Angle3,
const int &  _Sequence
 

Create a Rotation from an euler angle sequence.

Parameters:
_Angle1 first angles in Euler angle set. [rad]
_Angle2 second angles in Euler angle set. [rad]
_Angle3 third angles in Euler angle set. [rad]
_Sequence Euler angle rotation sequence. (ie 123, 213, 313, 321, etc).

Definition at line 107 of file Rotation.cpp.

References m_quaternion, and O_SESSAME::Quaternion::Set().

void O_SESSAME::Rotation::Set const Vector _Angles,
const int &  _Sequence
 

Set the Rotation from an euler angle sequence.

Parameters:
_Angles 3x1 matrix of euler angles.
_Sequence Euler angle rotation sequence. (ie 123, 213, 313, 321, etc).

Definition at line 95 of file Rotation.cpp.

References m_quaternion, O_SESSAME::Quaternion::Set(), and O_SESSAME::Vector.

void O_SESSAME::Rotation::Set const DirectionCosineMatrix _DCM  ) 
 

Set the Rotation from a converted DCM.

Parameters:
_DCM 3x3 matrix of Direction Cosine Matrix (DCM) values.

Definition at line 85 of file Rotation.cpp.

References m_quaternion, and O_SESSAME::Quaternion::Set().

void O_SESSAME::Rotation::Set const Matrix _inMatrix  ) 
 

Set the Rotation from a converted DCM.

Parameters:
_inMatrix 3x3 matrix of Direction Cosine Matrix (DCM) values.

Todo:
Add testing for other types of matrix inputs

Definition at line 69 of file Rotation.cpp.

References m_quaternion, O_SESSAME::Matrix, and O_SESSAME::Quaternion::Set().

Referenced by O_SESSAME::AttitudeHistory::GetState(), main(), Rotation(), and slidingModeControlMRPMW::Run().


Member Data Documentation

Quaternion O_SESSAME::Rotation::m_quaternion [private]
 

internal representation of the attitude transformation.

Definition at line 477 of file Rotation.h.

Referenced by GetDCM(), GetEulerAngles(), GetEulerAxisAngle(), GetMRP(), and Set().

RotationSense O_SESSAME::Rotation::m_RotationSense [private]
 

Handed-ness of the rotation, either LEFT_HANDED or RIGHT_HANDED.

Definition at line 480 of file Rotation.h.


The documentation for this class was generated from the following files:
Generated on Wed Sep 5 12:54:49 2007 for DSACSS Operational Code by  doxygen 1.3.9.1