Class AttitudeEndpoints

  • All Implemented Interfaces:
    AttitudeBuilder

    public class AttitudeEndpoints
    extends Object
    implements AttitudeBuilder
    Endpoints for attitude definition.

    This class provides a bridge between two different views of attitude definition. In both views, there is an external frame, based on either celestial body or orbit-relative and there is a spacecraft body frame.

    • CCSDS ADM view: frames are labeled as A and B but nothing tells which is which and attitude can be defined in any direction
    • Orekit attitude view: attitude is always from external to spacecraft body
    Since:
    11.0
    Author:
    Luc Maisonobe
    • Constructor Detail

      • AttitudeEndpoints

        public AttitudeEndpoints()
        Empty constructor.

        This constructor is not strictly necessary, but it prevents spurious javadoc warnings with JDK 18 and later.

        Since:
        12.0
    • Method Detail

      • checkExternalFrame

        public void checkExternalFrame​(Enum<?> aKey,
                                       Enum<?> bKey)
        Check external frame is properly initialized.
        Parameters:
        aKey - key for frame A
        bKey - key for frame B
      • checkMandatoryEntriesExceptExternalFrame

        public void checkMandatoryEntriesExceptExternalFrame​(double version,
                                                             Enum<?> aKey,
                                                             Enum<?> bKey,
                                                             Enum<?> dirKey)
        Check is mandatory entries except external frame have been initialized.

        Either frame A or frame B must be initialized with a spacecraft body frame.

        This method should throw an exception if some mandatory entry is missing

        Parameters:
        version - format version
        aKey - key for frame A
        bKey - key for frame B
        dirKey - key for direction
      • setFrameA

        public void setFrameA​(FrameFacade frameA)
        Set frame A.
        Parameters:
        frameA - frame A
      • getFrameA

        public FrameFacade getFrameA()
        Get frame A.
        Returns:
        frame A
      • setFrameB

        public void setFrameB​(FrameFacade frameB)
        Set frame B.
        Parameters:
        frameB - frame B
      • getFrameB

        public FrameFacade getFrameB()
        Get frame B.
        Returns:
        frame B
      • setA2b

        public void setA2b​(boolean a2b)
        Set rotation direction.
        Parameters:
        a2b - if true, rotation is from frame A to frame B
      • isA2b

        public boolean isA2b()
        Check if rotation direction is from frame A to frame B.
        Returns:
        true if rotation direction is from frame A to frame B
      • getExternalFrame

        public FrameFacade getExternalFrame()
        Get the external frame.
        Returns:
        external frame
      • getSpacecraftBodyFrame

        public FrameFacade getSpacecraftBodyFrame()
        Get the spacecraft body frame.
        Returns:
        spacecraft body frame
      • isExternal2SpacecraftBody

        public boolean isExternal2SpacecraftBody()
        Check if attitude is from external frame to spacecraft body frame.

        Mandatory entries must have been initialized properly to non-null values before this method is called, otherwise NullPointerException will be thrown.

        Returns:
        true if attitude is from external frame to spacecraft body frame
      • isCompatibleWith

        public boolean isCompatibleWith​(AttitudeEndpoints other)
        Check if a endpoint is compatible with another one.

        Endpoins are compatible if they refer o the same frame names, in the same order and in the same direction.

        Parameters:
        other - other endpoints to check against
        Returns:
        true if both endpoints are compatible with each other
      • build

        public Attitude build​(Frame frame,
                              PVCoordinatesProvider pvProv,
                              TimeStampedAngularCoordinates rawAttitude)
        Build a filtered attitude.
        Specified by:
        build in interface AttitudeBuilder
        Parameters:
        frame - reference frame with respect to which attitude must be defined
        pvProv - provider for spacecraft position and velocity
        rawAttitude - raw rotation/rotation rate/rotation acceleration
        Returns:
        filtered attitude