public class AttitudesSequence extends Object implements AttitudeLaw
Only one attitude provider in the sequence is in an active state. When one of the switch event associated with the active provider occurs, the active provider becomes the one specified with the event. A simple example is a provider for the sun lighted part of the orbit and another provider for the eclipse time. When the sun lighted provider is active, the eclipse entry event is checked and when it occurs the eclipse provider is activated. When the eclipse provider is active, the eclipse exit event is checked and when it occurs the sun lighted provider is activated again. This sequence is a simple loop.
An active attitude provider may have several switch events and next provider settings, leading to different activation patterns depending on which events are triggered first. An example of this feature is handling switches to safe mode if some contingency condition is met, in addition to the nominal switches that correspond to proper operations. Another example is handling of maneuver mode.
Constructor and Description |
---|
AttitudesSequence()
Constructor for an initially empty sequence.
|
Modifier and Type | Method and Description |
---|---|
void |
addSwitchingCondition(AttitudeLaw before,
EventDetector switchEvent,
boolean switchOnIncrease,
boolean switchOnDecrease,
AttitudeLaw after)
Add a switching condition between two attitude providers.
|
Attitude |
getAttitude(Orbit orbit)
Compute the attitude corresponding to an orbital state.
|
Attitude |
getAttitude(PVCoordinatesProvider pvProv,
AbsoluteDate date,
Frame frame)
Compute the attitude corresponding to an orbital state.
|
void |
registerSwitchEvents(Propagator propagator)
Register all wrapped switch events to the propagator.
|
void |
resetActiveProvider(AttitudeLaw provider)
Reset the active provider.
|
void |
setSpinDerivativesComputation(boolean computeSpinDerivatives)
Method to activate spin derivative computation.
|
String |
toString() |
public AttitudesSequence()
public void resetActiveProvider(AttitudeLaw provider)
provider
- the provider to activatepublic void registerSwitchEvents(Propagator propagator)
This method must be called once before propagation, after the switching conditions have been set up by calls to
addSwitchingCondition(AttitudeLaw, EventDetector, boolean, boolean, AttitudeLaw)
.
propagator
- propagator that will handle the eventspublic void addSwitchingCondition(AttitudeLaw before, EventDetector switchEvent, boolean switchOnIncrease, boolean switchOnDecrease, AttitudeLaw after)
An attitude provider may have several different switch events associated to it. Depending on which event is triggered, the appropriate provider is switched to.
The switch events specified here must not be registered to the propagator directly. The proper way to
register these events is to call registerSwitchEvents(Propagator)
once after all switching conditions
have been set up. The reason for this is that the events will be wrapped before being registered.
before
- attitude provider before the switch event occurrenceswitchEvent
- event triggering the attitude providers switch ; the event should generate
ACTION.RESET_STATE when event occured. (may be null for a provider without any ending
condition, in this case the after provider is not referenced and may be null too)switchOnIncrease
- if true, switch is triggered on increasing eventswitchOnDecrease
- if true, switch is triggered on decreasing eventafter
- attitude provider to activate after the switch event occurrence (used only if
switchEvent is non null)public void setSpinDerivativesComputation(boolean computeSpinDerivatives) throws PatriusException
Spin derivatives computation does not apply to provided law. Call setSpinDerivativesComputation(boolean)
on each law to activate/deactivate underlying law spin derivative computation.
setSpinDerivativesComputation
in interface AttitudeProvider
computeSpinDerivatives
- true if spin derivatives should be computedPatriusException
- if spin derivatives can not be computedpublic Attitude getAttitude(PVCoordinatesProvider pvProv, AbsoluteDate date, Frame frame) throws PatriusException
getAttitude
in interface AttitudeProvider
pvProv
- local position-velocity provider around current datedate
- current dateframe
- reference frame from which attitude is computedPatriusException
- if attitude cannot be computedpublic Attitude getAttitude(Orbit orbit) throws PatriusException
getAttitude
in interface AttitudeProvider
orbit
- current orbitPatriusException
- if attitude cannot be computedCopyright © 2019 CNES. All rights reserved.