EventBasedManoeuvreTriggers unexpected behaviour with EclipseDetector


I have been using the EventBasedManoeuvreTriggers to perform low-thrust manoeuvres only when the spacecraft is not in eclipse. To do so, I have created an EclipseDetector, and I have used the eclipse detector and its Negate as start and stop triggers for the manoeuvre as follows:

ManeuverTriggers triggers =
              new EventBasedManeuverTriggers(eclipseDetector, new NegateDetector(eclipseDetector));
propagator.addForceModel(new Maneuver(null, triggers, propulsionModel));

To my surprise, with such an implementation, the manoeuvre is performed when the spacecraft is in eclipse and not the opposite as I would have expected. In fact, according to the EventBasedManoeuvreTriggers docs, the firing detectors only detect increasing sign changes and, according to the EclipseDetector docs, the detector increases its sign when exiting the eclipse. Therefor I would have expected the aforementioned implementation to work. Instead, to have it working properly I had to switch the position of the detectors in the trigger as follows:

ManeuverTriggers triggers =
              new EventBasedManeuverTriggers(new NegateDetector(eclipseDetector), eclipseDetector);

Am I missing something? Or this is the expected behaviour.

Thanks in advance for the help,


Hello @mirkotrisolini

Sorry for the late reply.
Please be aware that EventBasedManeuverTriggers has been obsoleted by StartStopEventsTrigger since Orekit 11.1. The class was not declared as deprecated though, I am sorry about this, I just forgot. The EventBasedManeuverTriggers has been removed from the development branch that will become the future 12.0 version.

The StartStopEventsTrigger class is however more difficult to use because it is an abstract class and needs to be specialized by user code. The reason is that the trigger feature is used by continuous maneuvers which are force model, and all force models must be compatible with fields. So there is a (ugly) hack that allows to convert on the fly regular event detectors into field detectors. The javadoc explains how to implement this hack for any detector that users may need, look at the convertStartDetector and convertStopDetector javadoc in the abstract class for details.

Could you have a look at this new class and check it it behaves properly with respect to its documentation about the function signs ?


sorry for the very late reply. I haven’t been able to work on this for a while. I am checking the StartStopEventsTrigger class and I would like to use it with BooleanDetectors (I am now combining the eclipse detector with other detectors that I need); however I cannot seem to make it work correctly the convertStartDetector and convertStopDetector. Would it be possible to have an example on how to implement them with a BooleanDetector.

Thanks in advance.