public class AttitudesSequence extends Object implements AttitudeProvider
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 |
---|---|
<T extends EventDetector> |
addSwitchingCondition(AttitudeProvider before,
T switchEvent,
boolean switchOnIncrease,
boolean switchOnDecrease,
AttitudeProvider after)
Add a switching condition between two attitude providers.
|
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(AttitudeProvider provider)
Reset the active provider.
|
public AttitudesSequence()
public void resetActiveProvider(AttitudeProvider provider)
provider
- providerprovider 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(AttitudeProvider, EventDetector, boolean, boolean, AttitudeProvider)
.
propagator
- propagator that will handle the eventspublic <T extends EventDetector> void addSwitchingCondition(AttitudeProvider before, T switchEvent, boolean switchOnIncrease, boolean switchOnDecrease, AttitudeProvider 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.
T
- class type for the generic versionbefore
- attitude provider before the switch event occurrenceswitchEvent
- event triggering the attitude providers switch (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 Attitude getAttitude(PVCoordinatesProvider pvProv, AbsoluteDate date, Frame frame) throws OrekitException
getAttitude
in interface AttitudeProvider
pvProv
- local position-velocity provider around current datedate
- current dateframe
- reference frame from which attitude is computedOrekitException
- if attitude cannot be computedCopyright © 2002-2015 CS Systèmes d'information. All rights reserved.