org.orekit.attitudes
Class Attitude

java.lang.Object
  extended by org.orekit.attitudes.Attitude
All Implemented Interfaces:
Serializable, TimeInterpolable<Attitude>, TimeShiftable<Attitude>, TimeStamped

public class Attitude
extends Object
implements TimeStamped, TimeShiftable<Attitude>, TimeInterpolable<Attitude>, Serializable

This class handles attitude definition at a given date.

This class represents the rotation from a reference frame to a "frame of interest", as well as its spin (axis and rotation rate).

The angular coordinates describe the orientation and angular velocity of the frame of interest in the reference frame.

Consequently, defining xSat_Rsat = Vector3D.PLUS_I, one can compute xSat_Rref = rot.applyTo(xSat_Rsat).

The state can be slightly shifted to close dates. This shift is based on a linear extrapolation for attitude taking the spin rate into account. It is not intended as a replacement for proper attitude propagation but should be sufficient for either small time shifts or coarse accuracy.

The instance Attitude is guaranteed to be immutable.

Author:
Véronique Pommier-Maurussane
See Also:
Orbit, AttitudeProvider, Serialized Form

Constructor Summary
Attitude(AbsoluteDate date, Frame referenceFrame, AngularCoordinates orientation)
          Creates a new instance.
Attitude(AbsoluteDate date, Frame referenceFrame, Rotation attitude, Vector3D spin)
          Creates a new instance.
Attitude(AbsoluteDate date, Frame referenceFrame, Rotation attitude, Vector3D spin, Vector3D acceleration)
          Creates a new instance.
Attitude(double[] y, AbsoluteDate date, Frame referenceFrame)
          Creates a new instance from an array containing a quaternion and a spin vector.
Attitude(Frame referenceFrame, TimeStampedAngularCoordinates orientation)
          Creates a new instance.
 
Method Summary
 AbsoluteDate getDate()
          Get the date of attitude parameters.
 TimeStampedAngularCoordinates getOrientation()
          Get the complete orientation including spin and spin derivatives.
 Frame getReferenceFrame()
          Get the reference frame.
 Rotation getRotation()
          Get the attitude rotation.
 Vector3D getRotationAcceleration()
          Get the satellite rotation acceleration.
 Vector3D getSpin()
          Get the satellite spin.
 Attitude interpolate(AbsoluteDate interpolationDate, Collection<Attitude> sample)
          Get an interpolated instance.
 Attitude interpolate(AbsoluteDate interpolationDate, Collection<Attitude> sample, boolean computeSpinDerivatives)
          Interpolates attitude.
 double[] mapAttitudeToArray()
          Convert Attitude to state array.
 Attitude shiftedBy(double dt)
          Get a time-shifted attitude.
static Attitude slerp(AbsoluteDate date, Attitude attitude1, Attitude attitude2, Frame frame, boolean computeSpinDerivative)
          The slerp interpolation method is efficient but is less accurate than the interpolate method.
 Attitude withReferenceFrame(Frame newReferenceFrame)
          Get a similar attitude with a specific reference frame.
 Attitude withReferenceFrame(Frame newReferenceFrame, boolean spinDerivativesComputation)
          Get a similar attitude with a specific reference frame.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Attitude

public Attitude(Frame referenceFrame,
                TimeStampedAngularCoordinates orientation)
Creates a new instance.

Parameters:
referenceFrame - reference frame from which attitude is defined
orientation - complete orientation between reference frame and satellite frame, including rotation rate and rotation acceleration

Attitude

public Attitude(AbsoluteDate date,
                Frame referenceFrame,
                AngularCoordinates orientation)
Creates a new instance. The angular coordinates describe the orientation and angular velocity of the frame of interest in the reference frame.

Parameters:
date - date at which attitude is defined
referenceFrame - reference frame from which attitude is defined
orientation - complete orientation from reference frame to the frame of interest, including rotation rate

Attitude

public Attitude(AbsoluteDate date,
                Frame referenceFrame,
                Rotation attitude,
                Vector3D spin,
                Vector3D acceleration)
Creates a new instance.

Parameters:
date - date at which attitude is defined
referenceFrame - reference frame from which attitude is defined
attitude - rotation between reference frame and satellite frame
spin - satellite spin (axis and velocity, in satellite frame)
acceleration - satellite rotation acceleration (in satellite frame)

Attitude

public Attitude(AbsoluteDate date,
                Frame referenceFrame,
                Rotation attitude,
                Vector3D spin)
Creates a new instance.

Parameters:
date - date at which attitude is defined
referenceFrame - reference frame from which attitude is defined
attitude - rotation between reference frame and satellite frame
spin - satellite spin (axis and velocity, in satellite frame)

Attitude

public Attitude(double[] y,
                AbsoluteDate date,
                Frame referenceFrame)
Creates a new instance from an array containing a quaternion and a spin vector. The quaternion describe the orientation of the frame of interest in the reference frame.

Parameters:
y - attitude representation in the state vector (quaternion + spin vector)
date - date at which attitude is defined
referenceFrame - reference frame from which attitude is defined
Method Detail

shiftedBy

public Attitude shiftedBy(double dt)
Get a time-shifted attitude.

The state can be slightly shifted to close dates. This shift is based on a linear extrapolation for attitude taking the spin rate into account. It is not intended as a replacement for proper attitude propagation but should be sufficient for either small time shifts or coarse accuracy. This method does not take into account the derivatives of spin: the new attitude does not contain the spin derivatives.

Specified by:
shiftedBy in interface TimeShiftable<Attitude>
Parameters:
dt - time shift in seconds
Returns:
a new attitude, shifted with respect to the instance (which is immutable)

withReferenceFrame

public final Attitude withReferenceFrame(Frame newReferenceFrame,
                                         boolean spinDerivativesComputation)
                                  throws OrekitException
Get a similar attitude with a specific reference frame.

If the instance reference frame is already the specified one, the instance itself is returned without any object creation. Otherwise, a new instance will be created with the specified reference frame. In this case, the required intermediate rotation and spin between the specified and the original reference frame will be inserted.
The spin derivatives are not transformed in the specified reference frame: the spinDerivatives attribute of the new instance is null, unless the reference frame is already the specified one (in that case, the spinDerivatives attribute itself is returned with the attitude).

Parameters:
newReferenceFrame - desired reference frame for attitude
spinDerivativesComputation - true if spin derivatives should be computed. If not, spin derivative is set to null
Returns:
an attitude that has the same orientation and motion as the instance, but guaranteed to have the specified reference frame
Throws:
OrekitException - if conversion between reference frames fails

withReferenceFrame

public final Attitude withReferenceFrame(Frame newReferenceFrame)
                                  throws OrekitException
Get a similar attitude with a specific reference frame.

If the instance reference frame is already the specified one, the instance itself is returned without any object creation. Otherwise, a new instance will be created with the specified reference frame. In this case, the required intermediate rotation and spin between the specified and the original reference frame will be inserted.
The spin derivatives are not transformed in the specified reference frame: the spinDerivatives attribute of the new instance is null, unless the reference frame is already the specified one (in that case, the spinDerivatives attribute itself is returned with the attitude).

Warning: spin derivative is not computed.

Parameters:
newReferenceFrame - desired reference frame for attitude
Returns:
an attitude that has the same orientation and motion as the instance, but guaranteed to have the specified reference frame
Throws:
OrekitException - if conversion between reference frames fails

getDate

public final AbsoluteDate getDate()
Get the date of attitude parameters.

Specified by:
getDate in interface TimeStamped
Returns:
date of the attitude parameters

getReferenceFrame

public final Frame getReferenceFrame()
Get the reference frame.

Returns:
referenceFrame reference frame from which attitude is defined.

getOrientation

public TimeStampedAngularCoordinates getOrientation()
Get the complete orientation including spin and spin derivatives.

Returns:
complete orientation including spin and spin derivatives
See Also:
getRotation(), getSpin(), getRotationAcceleration()

getRotation

public Rotation getRotation()
Get the attitude rotation.

Returns:
attitude satellite rotation from reference frame.
See Also:
getOrientation(), getSpin()

getSpin

public Vector3D getSpin()
Get the satellite spin.

The spin vector is defined in satellite frame.

Returns:
spin satellite spin (axis and velocity).
See Also:
getOrientation(), getRotation()

getRotationAcceleration

public Vector3D getRotationAcceleration()
                                 throws OrekitException
Get the satellite rotation acceleration. May be null

The rotation acceleration. vector is defined in satellite frame.

Returns:
rotation acceleration
Throws:
OrekitException - is the rotation acceleration is not available
See Also:
getOrientation(), getRotation()

interpolate

public Attitude interpolate(AbsoluteDate interpolationDate,
                            Collection<Attitude> sample)
                     throws OrekitException
Get an interpolated instance.

Note that the state of the current instance may not be used in the interpolation process, only its type and non interpolable fields are used (for example central attraction coefficient or frame when interpolating orbits). The interpolable fields taken into account are taken only from the states of the sample points. So if the state of the instance must be used, the instance should be included in the sample points.

The interpolated instance is created by polynomial Hermite interpolation on Rodrigues vector ensuring rotation rate remains the exact derivative of rotation.

As this implementation of interpolation is polynomial, it should be used only with small samples (about 10-20 points) in order to avoid Runge's phenomenon and numerical problems (including NaN appearing).

Warning: spin derivative is not computed.

Specified by:
interpolate in interface TimeInterpolable<Attitude>
Parameters:
interpolationDate - interpolation date
sample - attitude samples
Returns:
interpolated attitude
Throws:
OrekitException - if the sample points are inconsistent

interpolate

public Attitude interpolate(AbsoluteDate interpolationDate,
                            Collection<Attitude> sample,
                            boolean computeSpinDerivatives)
                     throws OrekitException
Interpolates attitude.

The interpolated instance is created by polynomial Hermite interpolation on Rodrigues vector ensuring rotation rate remains the exact derivative of rotation.

As this implementation of interpolation is polynomial, it should be used only with small samples (about 10-20 points) in order to avoid Runge's phenomenon and numerical problems (including NaN appearing).

Parameters:
interpolationDate - interpolation date
sample - attitude samples
computeSpinDerivatives - true if spin derivatives should be computed. If not, spin derivative is set to null
Returns:
interpolated attitude
Throws:
OrekitException - thrown if interpolation failed

mapAttitudeToArray

public double[] mapAttitudeToArray()
Convert Attitude to state array.

Returns:
the state vector representing the Attitude.

slerp

public static Attitude slerp(AbsoluteDate date,
                             Attitude attitude1,
                             Attitude attitude2,
                             Frame frame,
                             boolean computeSpinDerivative)
                      throws OrekitException
The slerp interpolation method is efficient but is less accurate than the interpolate method.

Parameters:
date - the date to interpolate
attitude1 - the Attitude of the satellite at the previous date
attitude2 - the Attitude of the satellite at the next date
frame - the expression frame
computeSpinDerivative - true if spin derivatives should be computed. If not, spin derivative is set to null
Returns:
the interpolated attitude
Throws:
OrekitException - if conversion between reference frames fails


Copyright © 2017 CNES. All Rights Reserved.