Hi all, I wrote in another topic about a GNSS sim that I am writing. I made some progress and I’m trying to use InterSatDirectViewDetector and FieldOfViewDetector for the event based scheduler. My current code is working with the only inclusion of the first detector. Once I introduce also the second one the following error is displayed
org.orekit.errors.OrekitException: zero norm
at org.orekit.errors.OrekitException.unwrap(OrekitException.java:154)
at org.orekit.propagation.integration.AbstractIntegratedPropagator.integrateDynamics(AbstractIntegratedPropagator.java:565)
at org.orekit.propagation.integration.AbstractIntegratedPropagator.propagate(AbstractIntegratedPropagator.java:474)
at org.orekit.propagation.PropagatorsParallelizer$PropagatorMonitoring.lambda$new$0(PropagatorsParallelizer.java:417)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:750)
Caused by: org.hipparchus.exception.MathRuntimeException: zero norm
at org.hipparchus.geometry.euclidean.threed.Vector3D.angle(Vector3D.java:359)
at org.orekit.geometry.fov.CircularFieldOfView.offsetFromBoundary(CircularFieldOfView.java:75)
at org.orekit.propagation.events.FieldOfViewDetector.g(FieldOfViewDetector.java:160)
at org.orekit.propagation.events.NegateDetector.g(NegateDetector.java:86)
I do not show all the traceback for the sake of brevity. I do not understand how to fix it: as far as I understood InterSat detector acts on the secondary (I am using GNSS satellite read from SP3 as suggested) but it is attached to the primary in the propagation, whereas for FieldOfViewDetector it seems the opposite (as PVCoordinateProvider I am using my LEO satellite). I report a piece of code hereinafter
for item in sp3_ephemeris.keySet():
sp3_prop = EphemerisFile.SatelliteEphemeris.cast_(sp3_ephemeris.get(item)).getPropagator()
sp3_att = LofOffset(sp3_prop.getFrame(), LOFType.LVLH)
sp3_prop.setAttitudeProvider(sp3_att)
gnss_satellite = generator.addPropagator(sp3_prop)
visib_inter_sat = InterSatDirectViewDetector(ear_shape, sp3_prop)
field_of_view = CircularFieldOfView(Vector3D.MINUS_I, FOV_HA, 0.0)
visib_field_of_view = FieldOfViewDetector(generator.getPropagator(satellite), field_of_view).withHandler(ContinueOnEvent())
visib_metric = BooleanDetector.andCombine([visib_inter_sat, BooleanDetector.notCombine(visib_field_of_view)])
Do you have any ideas where is the error? Thanks