Class AttitudesSequence
- java.lang.Object
-
- org.orekit.attitudes.AttitudesSequence
-
- All Implemented Interfaces:
AttitudeProvider
,AttitudeRotationModel
,EventDetectorsProvider
,ParameterDriversProvider
public class AttitudesSequence extends Object
This classes manages a sequence of different attitude providers that are activated in turn according to switching events. It includes non-zero transition durations between subsequent modes.- Since:
- 5.1
- Author:
- Luc Maisonobe
- See Also:
AttitudesSwitcher
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
AttitudesSequence.Switch
Switch specification.
-
Field Summary
-
Fields inherited from interface org.orekit.propagation.events.EventDetectorsProvider
DATATION_ACCURACY
-
-
Constructor Summary
Constructors Constructor Description AttitudesSequence()
Constructor for an initially empty sequence.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T extends EventDetector>
voidaddSwitchingCondition(AttitudeProvider past, AttitudeProvider future, T switchEvent, boolean switchOnIncrease, boolean switchOnDecrease, double transitionTime, AngularDerivativesFilter transitionFilter, AttitudeSwitchHandler switchHandler)
Add a switching condition between two attitude providers.protected TimeSpanMap<AttitudeProvider>
getActivated()
Getter for map of activated attitude providers.<T extends CalculusFieldElement<T>>
FieldAttitude<T>getAttitude(FieldPVCoordinatesProvider<T> pvProv, FieldAbsoluteDate<T> date, Frame frame)
Compute the attitude corresponding to an orbital state.Attitude
getAttitude(PVCoordinatesProvider pvProv, AbsoluteDate date, Frame frame)
Compute the attitude corresponding to an orbital state.<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.Rotation
getAttitudeRotation(PVCoordinatesProvider pvProv, AbsoluteDate date, Frame frame)
Compute the attitude-related rotation corresponding to an orbital state.Stream<EventDetector>
getEventDetectors()
Get the discrete events related to the model.protected <T extends CalculusFieldElement<T>>
FieldEventDetector<T>getFieldEventDetector(Field<T> field, org.orekit.attitudes.AbstractSwitchingAttitudeProvider.AbstractAttitudeSwitch attitudeSwitch)
Method creating a Field attitude switch from a non-Field one.<T extends CalculusFieldElement<T>>
Stream<FieldEventDetector<T>>getFieldEventDetectors(Field<T> field)
Get the discrete events related to the model.List<AttitudesSequence.Switch>
getSwitches()
Gets a deep copy of the switches stored in this instance.void
resetActiveProvider(AttitudeProvider provider)
Reset the active provider.protected void
setActivated(TimeSpanMap<AttitudeProvider> activated)
Setter for map of activate attitude providers.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.orekit.attitudes.AttitudeProvider
getAttitudeRotation, getAttitudeRotation, getParametersDrivers
-
Methods inherited from interface org.orekit.propagation.events.EventDetectorsProvider
getDateDetector, getEventDetectors, getFieldDateDetector, getFieldEventDetectors
-
Methods inherited from interface org.orekit.utils.ParameterDriversProvider
getNbParametersDriversValue, getParameterDriver, getParameters, getParameters, getParameters, getParameters, getParametersAllValues, getParametersAllValues, isSupported
-
-
-
-
Method Detail
-
addSwitchingCondition
public <T extends EventDetector> void addSwitchingCondition(AttitudeProvider past, AttitudeProvider future, T switchEvent, boolean switchOnIncrease, boolean switchOnDecrease, double transitionTime, AngularDerivativesFilter transitionFilter, AttitudeSwitchHandler switchHandler)
Add a switching condition between two attitude providers.The
past
andfuture
attitude providers are defined with regard to the natural flow of time. This means that if the propagation is forward, the propagator will switch frompast
provider tofuture
provider at event occurrence, but if the propagation is backward, the propagator will switch fromfuture
provider topast
provider at event occurrence. The transition between the two attitude laws is not instantaneous, the switch event defines the start of the transition (i.e. when leaving thepast
attitude law and entering the interpolated transition law). The end of the transition (i.e. when leaving the interpolating transition law and entering thefuture
attitude law) occurs at switch time plustransitionTime
.An attitude provider may have several different switch events associated to it. Depending on which event is triggered, the appropriate provider is switched to.
If the underlying detector has an event handler associated to it, this handler will be triggered (i.e. its
eventOccurred
method will be called), regardless of the event really triggering an attitude switch or not. As an example, if an eclipse detector is used to switch from day to night attitude mode when entering eclipse, withswitchOnIncrease
set tofalse
andswitchOnDecrease
set totrue
. Then a handler set directly at eclipse detector level would be triggered at both eclipse entry and eclipse exit, but attitude switch would occur only at eclipse entry. Note that for the sake of symmetry, the transition start and end dates should match for both forward and backward propagation. This implies that for backward propagation, we have to compensate for thetransitionTime
when looking for the event. An unfortunate consequence is that theeventOccurred
method may appear to be called out of sync with respect to the propagation (it will be called when propagator reaches transition end, despite it refers to transition start, as pertransitionTime
compensation), and if the method returnsAction.STOP
, it will stop at the end of the transition instead of at the start. For these reasons, it is not recommended to set up an event handler for events that are used to switch attitude. If an event handler is needed for other purposes, a second handler should be registered to the propagator rather than relying on the side effects of attitude switches.The smoothness of the transition between past and future attitude laws can be tuned using the
transitionTime
andtransitionFilter
parameters. ThetransitionTime
parameter specifies how much time is spent to switch from one law to the other law. It should be larger than the eventconvergence threshold
in order to ensure attitude continuity. ThetransitionFilter
parameter specifies the attitude time derivatives that should match at the boundaries between past attitude law and transition law on one side, and between transition law and future law on the other side.AngularDerivativesFilter.USE_R
means only the rotation should be identical,AngularDerivativesFilter.USE_RR
means both rotation and rotation rate should be identical,AngularDerivativesFilter.USE_RRA
means both rotation, rotation rate and rotation acceleration should be identical. During the transition, the attitude law is computed by interpolating between past attitude law at switch time and future attitude law at current intermediate time.- Type Parameters:
T
- class type for the switch event- Parameters:
past
- attitude provider applicable for times in the switch event occurrence pastfuture
- attitude provider applicable for times in the switch event occurrence futureswitchEvent
- event triggering the attitude providers switchswitchOnIncrease
- if true, switch is triggered on increasing eventswitchOnDecrease
- if true, switch is triggered on decreasing eventtransitionTime
- duration of the transition between the past and future attitude lawstransitionFilter
- specification of transition law time derivatives that should match past and future attitude lawsswitchHandler
- handler to call for notifying when switch occurs (may be null)- Since:
- 13.0
-
getEventDetectors
public Stream<EventDetector> getEventDetectors()
Description copied from interface:AttitudeProvider
Get the discrete events related to the model.This method is not intended to be called several time, only once by a propagator, as it has the side effect of rebuilding the events detectors when called
- Returns:
- stream of event detectors
-
getFieldEventDetectors
public <T extends CalculusFieldElement<T>> Stream<FieldEventDetector<T>> getFieldEventDetectors(Field<T> field)
Description copied from interface:AttitudeProvider
Get the discrete events related to the model.This method is not intended to be called several time, only once by a propagator, as it has the side effect of rebuilding the events detectors when called
- Type Parameters:
T
- extends CalculusFieldElement<T>- Parameters:
field
- field to which the state belongs- Returns:
- stream of event detectors
-
getSwitches
public List<AttitudesSequence.Switch> getSwitches()
Gets a deep copy of the switches stored in this instance.- Returns:
- deep copy of the switches stored in this instance
-
resetActiveProvider
public void resetActiveProvider(AttitudeProvider provider)
Reset the active provider.Calling this method clears all already seen switch history, so it should not be used during the propagation itself, it is intended to be used only at start
- Parameters:
provider
- provider to activate
-
setActivated
protected void setActivated(TimeSpanMap<AttitudeProvider> activated)
Setter for map of activate attitude providers.- Parameters:
activated
- new map
-
getActivated
protected TimeSpanMap<AttitudeProvider> getActivated()
Getter for map of activated attitude providers.- Returns:
- map of providers
-
getAttitude
public Attitude getAttitude(PVCoordinatesProvider pvProv, AbsoluteDate date, Frame frame)
Compute the attitude corresponding to an orbital state.- Specified by:
getAttitude
in interfaceAttitudeProvider
- Parameters:
pvProv
- local position-velocity provider around current datedate
- current dateframe
- 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 interfaceAttitudeProvider
- Type Parameters:
T
- type of the field elements- Parameters:
pvProv
- local position-velocity provider around current datedate
- current dateframe
- 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 interfaceAttitudeProvider
- Parameters:
pvProv
- local position-velocity provider around current datedate
- current dateframe
- 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)
Description copied from interface:AttitudeProvider
Compute the attitude-related rotation corresponding to an orbital state.- Specified by:
getAttitudeRotation
in interfaceAttitudeProvider
- Type Parameters:
T
- type of the field elements- Parameters:
pvProv
- local position-velocity provider around current datedate
- current dateframe
- reference frame from which attitude is computed- Returns:
- rotation on the specified date and position-velocity state
-
getFieldEventDetector
protected <T extends CalculusFieldElement<T>> FieldEventDetector<T> getFieldEventDetector(Field<T> field, org.orekit.attitudes.AbstractSwitchingAttitudeProvider.AbstractAttitudeSwitch attitudeSwitch)
Method creating a Field attitude switch from a non-Field one.- Type Parameters:
T
- field type- Parameters:
field
- fieldattitudeSwitch
- attitude switch- Returns:
- Field detector
-
-