Error instantiating maneuver triggers in Python

Hello

I’m trying to implement a maneuver trigger that would fire only around the apogee for a specified arc length. I wanted to use StartStopEventsTrigger (which replaced EventBasedManeuverTriggers) but I noticed that its constructor is protected (not sure why, since the one in the previous class was public).
So instead I tried using IntervalEventTrigger. However, when I do, I always get this error:

JavaError: <super: <class 'JavaError'>, <JavaError object>>
    Java stacktrace:
java.lang.InstantiationException: org.orekit.forces.maneuvers.trigger.IntervalEventTrigger

I’m not sure what I’m doing wrong… I get this error even when using default Orekit detectors like ApsideDetector or ElevationDetector.

Ok, apparently there’s a Python equivalent of both StartStopEventsTrigger and IntervalEventTrigger which seem to not raise the instantiation exception. I now run into a new issue though…

If I create a PythonStartStopEventsTrigger from two PositionAngleDetector I get this error:

JavaError: <super: <class 'JavaError'>, <JavaError object>>
    Java stacktrace:
java.lang.RuntimeException: AttributeError
        at org.orekit.forces.maneuvers.trigger.PythonStartStopEventsTrigger.getParametersDrivers(Native Method)
        at org.orekit.forces.maneuvers.Maneuver.getParametersDrivers(Maneuver.java:275)
        at org.orekit.utils.ParameterDriversProvider.getParameters(ParameterDriversProvider.java:82)
        at org.orekit.forces.maneuvers.Maneuver.addContribution(Maneuver.java:159)
        at org.orekit.propagation.numerical.NumericalPropagator$Main.computeDerivatives(NumericalPropagator.java:949)
        at org.orekit.propagation.integration.AbstractIntegratedPropagator$ConvertedMainStateEquations.computeDerivatives(AbstractIntegratedPropagator.java:756)
        at org.hipparchus.ode.ExpandableODE.computeDerivatives(ExpandableODE.java:134)
        at org.hipparchus.ode.AbstractIntegrator.computeDerivatives(AbstractIntegrator.java:259)
        at org.hipparchus.ode.AbstractIntegrator.initIntegration(AbstractIntegrator.java:204)
        at org.hipparchus.ode.nonstiff.EmbeddedRungeKuttaIntegrator.integrate(EmbeddedRungeKuttaIntegrator.java:195)
        at org.orekit.propagation.integration.AbstractIntegratedPropagator.integrateDynamics(AbstractIntegratedPropagator.java:477)
        at org.orekit.propagation.integration.AbstractIntegratedPropagator.propagate(AbstractIntegratedPropagator.java:424)
        at org.orekit.propagation.integration.AbstractIntegratedPropagator.propagate(AbstractIntegratedPropagator.java:384)

I tested my custom ThrustDirectionProvider with a DateBasedManeuverTrigger and here it works just fine…

Greetings @Emiliano

Please try the following StartStopEventsTrigger class

class ActualStartStopTriggerEvents(PythonStartStopEventsTrigger):

    def __init__(self, start_detector, stop_detector):
        super().__init__(start_detector, stop_detector)

    def getParametersDrivers(self):
        """
        Overrides the `ParameterDriversProvider.getParametersDrivers()` method to return an empty list
        as this class does not require any additional parameters. This avoids potential breaking changes
        for downstream code.
        """
        return Collections.emptyList()