Class EventBasedManeuverTriggers
- java.lang.Object
-
- org.orekit.forces.maneuvers.trigger.EventBasedManeuverTriggers
-
- All Implemented Interfaces:
ManeuverTriggers
,EventHandler<EventDetector>
public class EventBasedManeuverTriggers extends Object implements ManeuverTriggers, EventHandler<EventDetector>
Maneuver triggers based on start and stop detectors. This allow a succession of burn interval. The thruster starts firing when the start detector becomes positive. The thruster stops firing when the stop detector becomes positive. The 2 detectors should not be positive at the same time. A date detector is not suited as it does not delimit an interval. They can be both negative at the same time.- Since:
- 10.2
- Author:
- Mikael Fillastre, Andrea Fiorentino
-
-
Constructor Summary
Constructors Constructor Description EventBasedManeuverTriggers(AbstractDetector<? extends EventDetector> startFiringDetector, AbstractDetector<? extends EventDetector> stopFiringDetector)
Constructor.EventBasedManeuverTriggers(AbstractDetector<? extends EventDetector> startFiringDetector, AbstractDetector<? extends EventDetector> stopFiringDetector, boolean allowBackwardPropagation)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
checkInitialFiringState(SpacecraftState initialState)
Method to set the firing state on initialization.Action
eventOccurred(SpacecraftState s, EventDetector detector, boolean increasing)
eventOccurred method mirrors the same interface method as inEventDetector
and its subclasses, but with an additional parameter that allows the calling method to pass in an object from the detector which would have potential additional data to allow the implementing class to determine the correct return state.Stream<EventDetector>
getEventsDetectors()
Get the event detectors associated with the triggers.<T extends CalculusFieldElement<T>>
Stream<FieldEventDetector<T>>getFieldEventsDetectors(Field<T> field)
Get the event detectors associated with the triggers.AbstractDetector<? extends EventDetector>
getStartFiringDetector()
Getter for the start firing detector.AbstractDetector<? extends EventDetector>
getStopFiringDetector()
Getter for the stop firing detector.AbsoluteDate
getTriggeredEnd()
Getter for the triggered date of engine stop.AbsoluteDate
getTriggeredStart()
Getter triggered date of engine start.void
init(SpacecraftState initialState, AbsoluteDate target)
Initialization method called at propagation start.boolean
isFiring(AbsoluteDate date)
Check if maneuvering is on.boolean
isFiring(AbsoluteDate date, double[] parameters)
Find out if the maneuver is firing or not.<T extends CalculusFieldElement<T>>
booleanisFiring(FieldAbsoluteDate<T> date, T[] parameters)
Find out if the maneuver is firing or not.protected boolean
isFiringOnInitialState(SpacecraftState initialState)
Method to check if the thruster is firing on initialization.void
setFiring(boolean firing, AbsoluteDate date)
Set the firing start or end date depending on the firing flag.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.orekit.propagation.events.handlers.EventHandler
init, resetState
-
Methods inherited from interface org.orekit.forces.maneuvers.trigger.ManeuverTriggers
getName, getParametersDrivers, init
-
-
-
-
Constructor Detail
-
EventBasedManeuverTriggers
public EventBasedManeuverTriggers(AbstractDetector<? extends EventDetector> startFiringDetector, AbstractDetector<? extends EventDetector> stopFiringDetector)
Constructor.This legacy constructor forbids backward propagation.
- Parameters:
startFiringDetector
- Detector to start firing, only detect increasing sign changestopFiringDetector
- Detector to stop firing, only detect increasing sign change. e.g. it can be a negate detector of the start detector.
-
EventBasedManeuverTriggers
public EventBasedManeuverTriggers(AbstractDetector<? extends EventDetector> startFiringDetector, AbstractDetector<? extends EventDetector> stopFiringDetector, boolean allowBackwardPropagation)
Constructor.- Parameters:
startFiringDetector
- Detector to start firing, only detect increasing sign changestopFiringDetector
- Detector to stop firing, only detect increasing sign change. e.g. it can be a negate detector of the start detector.allowBackwardPropagation
- if true, backward propagation is allowed- Since:
- 11.1
-
-
Method Detail
-
getStartFiringDetector
public AbstractDetector<? extends EventDetector> getStartFiringDetector()
Getter for the start firing detector.- Returns:
- Detectors to start firing,
-
getStopFiringDetector
public AbstractDetector<? extends EventDetector> getStopFiringDetector()
Getter for the stop firing detector.- Returns:
- Detectors to stop firing
-
init
public void init(SpacecraftState initialState, AbsoluteDate target)
Initialization method called at propagation start.The default implementation does nothing.
- Specified by:
init
in interfaceManeuverTriggers
- Parameters:
initialState
- initial spacecraft state (at the start of propagation).target
- date of propagation. Not equal toinitialState.getDate()
.
-
checkInitialFiringState
protected void checkInitialFiringState(SpacecraftState initialState)
Method to set the firing state on initialization. can be overloaded by sub classes.- Parameters:
initialState
- initial spacecraft state
-
isFiringOnInitialState
protected boolean isFiringOnInitialState(SpacecraftState initialState)
Method to check if the thruster is firing on initialization. can be called by sub classes- Parameters:
initialState
- initial spacecraft state- Returns:
- true if firing
-
getEventsDetectors
public Stream<EventDetector> getEventsDetectors()
Get the event detectors associated with the triggers.- Specified by:
getEventsDetectors
in interfaceManeuverTriggers
- Returns:
- the event detectors
-
getFieldEventsDetectors
public <T extends CalculusFieldElement<T>> Stream<FieldEventDetector<T>> getFieldEventsDetectors(Field<T> field)
Get the event detectors associated with the triggers.- Specified by:
getFieldEventsDetectors
in interfaceManeuverTriggers
- Type Parameters:
T
- type of the field elements- Parameters:
field
- field to which the state belongs- Returns:
- the event detectors
-
setFiring
public void setFiring(boolean firing, AbsoluteDate date)
Set the firing start or end date depending on the firing flag. There is no effect if the firing state is not changing.- Parameters:
firing
- true to start a maneuver, false to stopdate
- date of event
-
isFiring
public boolean isFiring(AbsoluteDate date, double[] parameters)
Find out if the maneuver is firing or not.- Specified by:
isFiring
in interfaceManeuverTriggers
- Parameters:
date
- current dateparameters
- maneuver triggers parameters- Returns:
- true if the maneuver is firing, false otherwise
-
isFiring
public <T extends CalculusFieldElement<T>> boolean isFiring(FieldAbsoluteDate<T> date, T[] parameters)
Find out if the maneuver is firing or not.- Specified by:
isFiring
in interfaceManeuverTriggers
- Type Parameters:
T
- type of the field elements- Parameters:
date
- current dateparameters
- maneuver triggers parameters- Returns:
- true if the maneuver is firing, false otherwise
-
eventOccurred
public Action eventOccurred(SpacecraftState s, EventDetector detector, boolean increasing)
eventOccurred method mirrors the same interface method as inEventDetector
and its subclasses, but with an additional parameter that allows the calling method to pass in an object from the detector which would have potential additional data to allow the implementing class to determine the correct return state.- Specified by:
eventOccurred
in interfaceEventHandler<EventDetector>
- Parameters:
s
- SpaceCraft state to be used in the evaluationdetector
- object with appropriate type that can be used in determining correct return stateincreasing
- with the event occurred in an "increasing" or "decreasing" slope direction- Returns:
- the Action that the calling detector should pass back to the evaluation system
-
isFiring
public boolean isFiring(AbsoluteDate date)
Check if maneuvering is on.- Parameters:
date
- current date- Returns:
- true if maneuver is on at this date
-
getTriggeredEnd
public AbsoluteDate getTriggeredEnd()
Getter for the triggered date of engine stop.- Returns:
- Triggered date of engine stop
-
getTriggeredStart
public AbsoluteDate getTriggeredStart()
Getter triggered date of engine start.- Returns:
- Triggered date of engine start
-
-