Class AttitudesSwitcher
- java.lang.Object
-
- org.orekit.attitudes.AttitudesSwitcher
-
- All Implemented Interfaces:
AttitudeProvider
,AttitudeRotationModel
,EventDetectorsProvider
,ParameterDriversProvider
public class AttitudesSwitcher extends Object
This classes manages a sequence of different attitude providers that are activated in turn according to switching events. Changes in attitude mode are instantaneous, so state derivatives need to be reset and theAction
returned by the event handler is ignored.- Since:
- 13.0
- Author:
- Luc Maisonobe, Romain Serra
- See Also:
AttitudesSequence
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
AttitudesSwitcher.InstantaneousSwitch
Switch specification.
-
Field Summary
-
Fields inherited from interface org.orekit.propagation.events.EventDetectorsProvider
DATATION_ACCURACY
-
-
Constructor Summary
Constructors Constructor Description AttitudesSwitcher()
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, 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.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, 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.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.- 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 eventswitchHandler
- 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
-
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
-
-