Class LofOffset

  • All Implemented Interfaces:
    Serializable, AttitudeProvider

    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
    See Also:
    Serialized Form
    • Constructor Detail

      • LofOffset

        public LofOffset​(Frame inertialFrame,
                         LOFType type)
        Create a LOF-aligned attitude.

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

        Parameters:
        inertialFrame - inertial frame with respect to which orbit should be computed
        type - type of Local Orbital Frame
      • LofOffset

        public LofOffset​(Frame inertialFrame,
                         LOFType type,
                         org.hipparchus.geometry.euclidean.threed.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, lofType, order, alpha1, alpha2, alpha3);
           Rotation  offsetAtt    = law.getAttitude(orbit).getRotation();
           Rotation  alignedAtt   = new LofOffset(inertial, lofType).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.println(alpha1 + " == " + anglesV[0]);
           System.out.println(alpha2 + " == " + anglesV[1]);
           System.out.println(alpha3 + " == " + anglesV[2]);
        
           // note the conventions in the following statement
           double[] anglesF = offsetProper.getAngles(order, RotationConvention.FRAME_TRANSFORM);
           System.out.println(alpha1 + " == " + anglesF[0]);
           System.out.println(alpha2 + " == " + anglesF[1]);
           System.out.println(alpha3 + " == " + anglesF[2]);
         
        Parameters:
        inertialFrame - inertial frame with respect to which orbit should be computed
        type - type of 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 Detail

      • 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 attitude on the specified date and position-velocity state
      • getAttitude

        public <T extends org.hipparchus.RealFieldElement<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 attitude on the specified date and position-velocity state