Class LofOffset

java.lang.Object
org.orekit.attitudes.LofOffset
All Implemented Interfaces:
AttitudeProvider, AttitudeRotationModel, EventDetectorsProvider, ParameterDriversProvider

public class LofOffset extends Object implements AttitudeProvider
Attitude law defined by fixed Roll, Pitch and Yaw angles (in any order) with respect to a local orbital frame.

The attitude provider is defined as a rotation offset from some local orbital frame.

Author:
Véronique Pommier-Maurussane
  • Constructor Details

    • LofOffset

      public LofOffset(Frame inertialFrame, LOF lof)
      Create a LOF-aligned attitude.

      Calling this constructor is equivalent to call LofOffset(inertialFrame, LOF, RotationOrder.XYZ, 0, 0, 0)

      Parameters:
      inertialFrame - inertial frame with respect to which orbit should be computed
      lof - local orbital frame
    • LofOffset

      public LofOffset(Frame inertialFrame, LOF lof, RotationOrder order, double alpha1, double alpha2, double alpha3)
      Creates new instance.

      An important thing to note is that the rotation order and angles signs used here are compliant with an attitude definition, i.e. they correspond to a frame that rotate in a field of fixed vectors. So to retrieve the angles provided here from the Hipparchus underlying rotation, one has to either use the RotationConvention.VECTOR_OPERATOR and revert the rotation, or to use RotationConvention.FRAME_TRANSFORM as in the following code snippet:

         LofOffset law          = new LofOffset(inertial, LOF, order, alpha1, alpha2, alpha3);
         Rotation  offsetAtt    = law.getAttitude(orbit).getRotation();
         Rotation  alignedAtt   = new LofOffset(inertial, LOF).getAttitude(orbit).getRotation();
         Rotation  offsetProper = offsetAtt.compose(alignedAtt.revert(), RotationConvention.VECTOR_OPERATOR);
      
         // note the call to revert and the conventions in the following statement
         double[] anglesV = offsetProper.revert().getAngles(order, RotationConvention.VECTOR_OPERATOR);
         System.out.format(Locale.US, "%f == %f%n", alpha1, anglesV[0]);
         System.out.format(Locale.US, "%f == %f%n", alpha2, anglesV[1]);
         System.out.format(Locale.US, "%f == %f%n", alpha3, anglesV[2]);
      
         // note the conventions in the following statement
         double[] anglesF = offsetProper.getAngles(order, RotationConvention.FRAME_TRANSFORM);
         System.out.format(Locale.US, "%f == %f%n", alpha1, anglesF[0]);
         System.out.format(Locale.US, "%f == %f%n", alpha2, anglesF[1]);
         System.out.format(Locale.US, "%f == %f%n", alpha3, anglesF[2]);
       
      Parameters:
      inertialFrame - inertial frame with respect to which orbit should be computed
      lof - local orbital frame
      order - order of rotations to use for (alpha1, alpha2, alpha3) composition
      alpha1 - angle of the first elementary rotation
      alpha2 - angle of the second elementary rotation
      alpha3 - angle of the third elementary rotation
  • Method Details

    • getLof

      public LOF getLof()
      Get the local orbital frame.
      Returns:
      the local orbital frame.
    • getOffset

      public Rotation getOffset()
      Get the rotational offset.
      Returns:
      the rotational offset.
    • getInertialFrame

      public Frame getInertialFrame()
      Get the inertial frame.
      Returns:
      the inertial frame.
    • getAttitude

      public Attitude getAttitude(PVCoordinatesProvider pvProv, AbsoluteDate date, Frame frame)
      Compute the attitude corresponding to an orbital state.
      Specified by:
      getAttitude in interface AttitudeProvider
      Parameters:
      pvProv - local position-velocity provider around current date
      date - current date
      frame - reference frame from which attitude is computed
      Returns:
      attitude on the specified date and position-velocity state
    • getAttitude

      public <T extends CalculusFieldElement<T>> FieldAttitude<T> getAttitude(FieldPVCoordinatesProvider<T> pvProv, FieldAbsoluteDate<T> date, Frame frame)
      Compute the attitude corresponding to an orbital state.
      Specified by:
      getAttitude in interface AttitudeProvider
      Type Parameters:
      T - type of the field elements
      Parameters:
      pvProv - local position-velocity provider around current date
      date - current date
      frame - reference frame from which attitude is computed
      Returns:
      attitude on the specified date and position-velocity state
    • getAttitudeRotation

      public Rotation getAttitudeRotation(PVCoordinatesProvider pvProv, AbsoluteDate date, Frame frame)
      Compute the attitude-related rotation corresponding to an orbital state.
      Specified by:
      getAttitudeRotation in interface AttitudeProvider
      Parameters:
      pvProv - local position-velocity provider around current date
      date - current date
      frame - reference frame from which attitude is computed
      Returns:
      attitude-related rotation on the specified date and position-velocity state
    • getAttitudeRotation

      public <T extends CalculusFieldElement<T>> FieldRotation<T> getAttitudeRotation(FieldPVCoordinatesProvider<T> pvProv, FieldAbsoluteDate<T> date, Frame frame)
      Compute the attitude-related rotation corresponding to an orbital state.
      Specified by:
      getAttitudeRotation in interface AttitudeProvider
      Type Parameters:
      T - type of the field elements
      Parameters:
      pvProv - local position-velocity provider around current date
      date - current date
      frame - reference frame from which attitude is computed
      Returns:
      rotation on the specified date and position-velocity state