| Earth Observation Mission CFI Software Pointing Software User Manual |

Public Member Functions | Protected Member Functions

# EECFI::Attitude Class Reference

Attitude data and configuration. More...

Inheritance diagram for EECFI::Attitude:

List of all members.

## Public Member Functions
| Attitude () throw (CfiError)
| Empty Class constructor.
| Attitude (const TimeCorrelation &timeId, const SatNomTransId &satNomTrId, const SatTransId &satTrId, const InstrTransId &instTrId) throw (CfiError)
| Constructor with satellite frame ids.
| ~Attitude () throw (CfiError)
| Class destructor.
void | setTransformations (const TimeCorrelation &timeId, const SatNomTransId &satNomTrId, const SatTransId &satTrId, const InstrTransId &instTrId) throw (CfiError)
| Set the transformations in the attitutde Id..
void | compute (const ModelId &modelId, const StateVector &stateVector, long targetFrame) throw (CfiError)
void | userSet (const ModelId &modelId, const StateVector &stateVector, long targetFrame, const double matrix[3][3], const double matrixRate[3][3], const double matrixRateRate[3][3], const double offset[3]) throw (CfiError)
| Assign user-defined attitude frame.
AttRec | getAttitudeData (long dataType, long sourceRefType, long sourceRef) const throw (CfiError)
| Compute quaternions/angles equivalent to the transformation from sourceRef to the attitude target frame.
AttitudeData | getData () const throw (CfiError)
| Get attitude id data.
void | setData (const AttitudeData &attitudeData) throw (CfiError)
| Set attitude id data.
Coord | changeFrame (const SatId &satId, const ModelId &modelId, long modeFlag, long frameFlagIn, long frameIdIn, long frameFlagOut, long frameIdOut, const StateVector &satStateVec, const Coord &statVecIn) throw (CfiError)
| Change the input vector/direction from a coordinate system to another ( including attitude frames ).
Attitude const & | operator= (Attitude const &att)
| Operator =.
SatId | satId () const
| Return satellite id.
## Protected Member Functions
GenericId * | getId ()
| Get the id.

## Detailed Description

Attitude data and configuration.

## Constructor & Destructor Documentation

EECFI::Attitude::Attitude | ( |  | ) | throw (CfiError)

Empty Class constructor.

References EECFI::CfiClass::throwWarn.

EECFI::Attitude::Attitude | ( | const TimeCorrelation & | timeId,
|  | const SatNomTransId & | satNomTrId,
|  | const SatTransId & | satTrId,
|  | const InstrTransId & | instTrId |
| ) |  |  | throw (CfiError)

Constructor with satellite frame ids.

Parameters:

  | timeId | Time correlations.
  | satNomTrId | Satellite nominal attitude.
  | satTrId | Satellite attitude.
  | instTrId | Instrument attitude.

EECFI::Attitude::~Attitude | ( |  | ) | throw (CfiError)

Class destructor.

References EECFI::CfiId::status(), and EECFI::CfiClass::throwWarn.

## Member Function Documentation

Coord EECFI::Attitude::changeFrame | ( | const SatId & | satId,
|  | const ModelId & | modelId,
|  | long | modeFlag,
|  | long | frameFlagIn,
|  | long | frameIdIn,
|  | long | frameFlagOut,
|  | long | frameIdOut,
|  | const StateVector & | satStateVec,
|  | const Coord & | stateVec |
| ) |  |  | throw (CfiError)

Change the input vector/direction from a coordinate system to another ( including attitude frames ).

This method changes the coordinate or attitude frame of a location or direction by keeping the location or direction in inertial space identical. Both all coordinate frames and all attitude frames are supported. When changing the frame for a location, the difference in origin of the frames is taken into account. While when changing the frame for a direction, the target is assumed to be at infinity.

Parameters:

  | satId | Satellite id.
  | modelId | Model id.
  | modeFlag | Selection of location or direction calculus (ModeFlagPointingEnum).
  | frameFlagIn | Selection of coordinate or Attitude frame on input (FrameFlagEnum).
  | frameIdIn | Coordinate frame id or attitude frame id on input (AttFrEnum or CsRlEnum).
  | frameFlagOut | Selection of coordinate or Attitude frame on output (FrameFlagEnum).
  | frameIdOut | Coordinate frame id or attitude frame id on output (AttFrEnum or CsRlEnum).
  | satStateVec | State vector with time, time reference, position, velocity and acceleration of satellite (Earth fixed CS).
  | stateVec | Coordinates to be transformed in input frame (deriv indicates if pos, pos and vel or pos, vel and acc is to be calculated).

Returns:
  Tranformed coordinates in ouput frame.

References EECFI::Coord::acc, EECFI::Coord::cs, EECFI::Coord::deriv, EECFI::Coord::pos, and EECFI::Coord::vel.

void EECFI::Attitude::compute | ( | const ModelId & | modelId,
|  | const StateVector & | stateVector,
|  | long | targetFrame |
| ) |  |  | throw (CfiError)

Compute attitude matrix.

Note: it can be internally applied a correction to computations in order to compensate for the travel time of light from the Sun to the Earth and the satellites orbiting it. To activate this compensation, the Sun model in xl_model_id must be initialized with the enum XL_MODEL_SUN_TRAVEL_TIME using the function xl_model_init (see [LIBSUM]).

This method calculates the Attitude Frame for a given S/C state vector.

Parameters:

  | modelId | Model Id.
  | stateVector | State vector which contains time reference, time, position, velocity and acceleration needed for computation.
  | targetFrame | Attitude frame (AttFrEnum).

AttRec EECFI::Attitude::getAttitudeData | ( | long | dataType,
|  | long | sourceRefType,
|  | long | sourceRef |
| ) |  |  | const throw (CfiError)

Compute quaternions/angles equivalent to the transformation from sourceRef to the attitude target frame.

Parameters:

  | modelId | Model Id.
  | stateVector | State vector with time, time reference, position, velocity and acceleration needed for computation.
  | targetFrame | Attitude frame ID (AttFrEnum).
  | matrix | Matrix represeting the transformation from ToD to targetFrame.
  | matrixRate | Matrix represeting the transformation rate from ToD to targetFrame.
  | matrixRateRate | Matrix represeting the transformation rate rate from ToD to targetFrame.
  | offset | Offset in the reference frame origin.

Returns:
  Attitude record with the time and quaternions or angles.

AttitudeData EECFI::Attitude::getData | ( |  | ) | const throw (CfiError)

Get attitude id data.

Returns:
  Attitude data.

References EECFI::Coord::acc, EECFI::CfiError::addMsg(), EECFI::CsTra::ambFlag, EECFI::AttitudeData::attitudeEF, EECFI::AzElDefinition::az0Axis, EECFI::AzElDefinition::az90Axis, EECFI::CsTra::azelDef, EECFI::CsTra::azelFlag, EECFI::StateVector::coord, EECFI::Coord::cs, EECFI::CsTra::deriv, EECFI::Coord::deriv, EECFI::AzElDefinition::el90Axis, EECFI::Time::format, EECFI::CsTra::m, EECFI::CsTra::m2d, EECFI::CsTra::md, EECFI::AttitudeData::model, EECFI::AttitudeData::offset, EECFI::Coord::pos, EECFI::Time::ref, EECFI::CsTra::reff, EECFI::CsTra::refi, EECFI::AttitudeData::satMat, EECFI::AttitudeData::satVector, EECFI::AttitudeData::sourceFrame, EECFI::AttitudeData::targetFrame, EECFI::CfiClass::throwWarn, EECFI::Time::time, EECFI::StateVector::time, EECFI::CsTra::v, EECFI::CsTra::v2d, EECFI::CsTra::vd, and EECFI::Coord::vel.

GenericId * EECFI::Attitude::getId | ( |  | ) | `[protected]`

Get the id.

Returns:
  Pointer to xo_orbit_id.

Attitude const & EECFI::Attitude::operator= | ( | Attitude const & | att | ) |

Operator =.

Parameters:

  | att | Attitude object to be copied.

Returns:
  Attitude object copy of the input object; the new object is completely independent from the input one.

References EECFI::CfiError::addMsg(), EECFI::CfiId::status(), and EECFI::CfiClass::throwWarn.

SatId EECFI::Attitude::satId | ( |  | ) | const

Return satellite id.

Returns:
  Satellite id.

void EECFI::Attitude::setData | ( | const AttitudeData & | attData | ) | throw (CfiError)

Set attitude id data.

Parameters:

  | attData | Attitude data.

References EECFI::CfiError::addMsg().

void EECFI::Attitude::setTransformations | ( | const TimeCorrelation & | timeId,
|  | const SatNomTransId & | satNomTrId,
|  | const SatTransId & | satTrId,
|  | const InstrTransId & | instTrId |
| ) |  |  | throw (CfiError)

Set the transformations in the attitutde Id..

Parameters:

  | timeId | Time correlations.
  | satNomTrId | Satellite nominal attitude.
  | satTrId | Satellite attitude.
  | instTrId | Instrument attitude.

void EECFI::Attitude::userSet | ( | const ModelId & | modelId,
|  | const StateVector & | stateVector,
|  | long | targetFrame,
|  | const double | matrix[3][3],
|  | const double | matrixRate[3][3],
|  | const double | matrixRateRate[3][3],
|  | const double | offset[3] |
| ) |  |  | throw (CfiError)

Assign user-defined attitude frame.

Parameters:

  | modelId | Model Id.
  | stateVector | State vector with time, time reference, position, velocity and acceleration needed for computation.
  | targetFrame | Attitude frame ID (AttFrEnum).
  | matrix | Matrix represeting the transformation from ToD to targetFrame.
  | matrixRate | Matrix represeting the transformation rate from ToD to targetFrame.
  | matrixRateRate | Matrix represeting the transformation rate rate from ToD to targetFrame.
  | offset | Offset in the reference frame origin.