Hi everyone,
First of all, I’m working with orekit through Python.
My objective: from an initial circular low-earth orbit, implement an impulse maneuver at a certain argument of latitude on the orbit, and then propagate this orbit for 1 hour, let’s say.
To do so, I have created an initial CircularOrbit
and a DSSTPropagator
first, and then an ImpulseManeuver
using a PositionAngleDetector
, with the argument of latitude wanted for the maneuver, as trigger. And finally I have added this maneuver to the propagator.
See code below:
orekit.initVM()
setup_orekit_curdir()
# create initial orbit
initialDate = AbsoluteDate(2020, 1, 1, 00, 00, 00.000, TimeScalesFactory.getUTC())
initialSemiMajorAxis = 600e3 + Constants.WGS84_EARTH_EQUATORIAL_RADIUS
initialEccentricityX = 0.0
initialEccentricityY = 0.001
initialInclination = math.radians(98.0)
initialRaan = math.radians(0.0)
initialAol = math.radians(0.0)
mass = 100.0
initialOrbit = CircularOrbit(initialSemiMajorAxis, initialEccentricityX,
initialEccentricityY, initialInclination,
initialRaan, initialAol,
PositionAngle.TRUE,
FramesFactory.getEME2000(),
initialDate,
Constants.WGS84_EARTH_MU)
# create propagator
builder = DSSTPropagatorBuilder(initialOrbit,
DormandPrince853IntegratorBuilder(600.0, 86400.0, 100.0),
1.0, PropagationType.MEAN, PropagationType.MEAN)
builder.setMass(mass)
propagator = builder.buildPropagator(builder.getSelectedNormalizedParameters())
# create maneuver's trigger
angle = math.radians(100.0)
trigger = PositionAngleDetector(OrbitType.CIRCULAR, PositionAngle.TRUE, angle)
# create maneuver
attitudeOverride = LofOffset(FramesFactory.getEME2000(), LOFType.TNW)
deltaVSat = Vector3D.PLUS_I
isp = 1500.0
maneuver = ImpulseManeuver(trigger, attitudeOverride, deltaVSat, isp)
# add maneuver to propagator
propagator.addEventDetector(maneuver)
# propagation
finalState = propagator.propagate(initialDate.shiftedBy(3600.0))
But, when I run this script I get the following error:
Traceback: finalState = propagator.propagate(initialDate.shiftedBy(3600.0))
JavaError: <super: <class 'JavaError'>, <JavaError object>>
Java stacktrace:
java.lang.NullPointerException
at org.orekit.propagation.events.PositionAngleDetector.g(PositionAngleDetector.java:203)
at org.orekit.forces.maneuvers.ImpulseManeuver.g(ImpulseManeuver.java:151)
at org.orekit.propagation.integration.AbstractIntegratedPropagator$AdaptedEventDetector.g(AbstractIntegratedPropagator.java:784)
at org.hipparchus.ode.events.EventState.reinitializeBegin(EventState.java:173)
at org.hipparchus.ode.AbstractIntegrator.acceptStep(AbstractIntegrator.java:299)
at org.hipparchus.ode.nonstiff.EmbeddedRungeKuttaIntegrator.integrate(EmbeddedRungeKuttaIntegrator.java:290)
at org.orekit.propagation.integration.AbstractIntegratedPropagator.propagate(AbstractIntegratedPropagator.java:468)
at org.orekit.propagation.integration.AbstractIntegratedPropagator.propagate(AbstractIntegratedPropagator.java:414)
at org.orekit.propagation.integration.AbstractIntegratedPropagator.propagate(AbstractIntegratedPropagator.java:397)
Surprisingly, no error is raised when implemeting an ImpulseManeuver
using another EventDetector
such as DataDetector
or NodeDetector
…
Could someone help me understand why an ImpulseManeuver
triggered by a PositionAngleDetector
doesn’t work on my case so I can fix it please?
Thank you very much for your help!
Kind regards,
Melvin