public class Attitude extends Object implements TimeStamped, TimeShiftable<Attitude>, TimeInterpolable<Attitude>, Serializable
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.
Orbit
,
AttitudeProvider
,
Serialized FormConstructor and Description |
---|
Attitude(AbsoluteDate date,
Frame referenceFrameIn,
AngularCoordinates orientationIn)
Creates a new instance.
|
Attitude(AbsoluteDate date,
Frame referenceFrameIn,
Rotation attitude,
Vector3D spin)
Creates a new instance.
|
Attitude(AbsoluteDate date,
Frame referenceFrameIn,
Rotation attitude,
Vector3D spin,
Vector3D acceleration)
Creates a new instance.
|
Attitude(double[] y,
AbsoluteDate date,
Frame referenceFrameIn)
Creates a new instance from an array containing a quaternion and a spin vector.
|
Attitude(Frame referenceFrameIn,
TimeStampedAngularCoordinates orientationIn)
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
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.
|
public Attitude(Frame referenceFrameIn, TimeStampedAngularCoordinates orientationIn)
referenceFrameIn
- reference frame from which attitude is definedorientationIn
- complete orientation between reference frame and satellite frame,
including rotation rate and rotation accelerationpublic Attitude(AbsoluteDate date, Frame referenceFrameIn, AngularCoordinates orientationIn)
date
- date at which attitude is definedreferenceFrameIn
- reference frame from which attitude is definedorientationIn
- complete orientation from reference frame to the frame of interest, including rotation ratepublic Attitude(AbsoluteDate date, Frame referenceFrameIn, Rotation attitude, Vector3D spin, Vector3D acceleration)
date
- date at which attitude is definedreferenceFrameIn
- reference frame from which attitude is definedattitude
- rotation between reference frame and satellite framespin
- satellite spin (axis and velocity, in satellite frame)acceleration
- satellite rotation acceleration (in satellite frame)public Attitude(AbsoluteDate date, Frame referenceFrameIn, Rotation attitude, Vector3D spin)
date
- date at which attitude is definedreferenceFrameIn
- reference frame from which attitude is definedattitude
- rotation between reference frame and satellite framespin
- satellite spin (axis and velocity, in satellite frame)public Attitude(double[] y, AbsoluteDate date, Frame referenceFrameIn)
y
- attitude representation in the state vector (quaternion + spin vector)date
- date at which attitude is definedreferenceFrameIn
- reference frame from which attitude is definedpublic Attitude shiftedBy(double dt)
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.
shiftedBy
in interface TimeShiftable<Attitude>
dt
- time shift in secondspublic final Attitude withReferenceFrame(Frame newReferenceFrame, boolean spinDerivativesComputation) throws PatriusException
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).
newReferenceFrame
- desired reference frame for attitudespinDerivativesComputation
- true if spin derivatives should be computed. If not, spin derivative is set to nullPatriusException
- if conversion between reference frames failspublic final Attitude withReferenceFrame(Frame newReferenceFrame) throws PatriusException
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.
newReferenceFrame
- desired reference frame for attitudePatriusException
- if conversion between reference frames failspublic final AbsoluteDate getDate()
getDate
in interface TimeStamped
public final Frame getReferenceFrame()
public TimeStampedAngularCoordinates getOrientation()
getRotation()
,
getSpin()
,
getRotationAcceleration()
public Rotation getRotation()
getOrientation()
,
getSpin()
public Vector3D getSpin()
The spin vector is defined in satellite frame.
getOrientation()
,
getRotation()
public Vector3D getRotationAcceleration() throws PatriusException
The rotation acceleration. vector is defined in satellite frame.
PatriusException
- is the rotation acceleration is not availablegetOrientation()
,
getRotation()
public Attitude interpolate(AbsoluteDate interpolationDate, Collection<Attitude> sample) throws PatriusException
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.
interpolate
in interface TimeInterpolable<Attitude>
interpolationDate
- interpolation datesample
- attitude samplesPatriusException
- if the sample points are inconsistentpublic Attitude interpolate(AbsoluteDate interpolationDate, Collection<Attitude> sample, boolean computeSpinDerivatives) throws PatriusException
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).
interpolationDate
- interpolation datesample
- attitude samplescomputeSpinDerivatives
- true if spin derivatives should be computed. If not, spin derivative is set to nullPatriusException
- thrown if interpolation failedpublic double[] mapAttitudeToArray()
public static Attitude slerp(AbsoluteDate date, Attitude attitude1, Attitude attitude2, Frame frame, boolean computeSpinDerivative) throws PatriusException
date
- the date to interpolateattitude1
- the Attitude
of the satellite at the previous dateattitude2
- the Attitude
of the satellite at the next dateframe
- the expression framecomputeSpinDerivative
- true if spin derivatives should be computed. If not, spin derivative is set to nullPatriusException
- if conversion between reference frames failsCopyright © 2019 CNES. All rights reserved.