Hi,
I met a problem with “InterSatellitesRange”. I’m not sure if it’s a bug or I don’t get it and made some mistakes. I hope you could help me.
I have a constellation with several satellites (assume 60) that connect with each other by ISL. Now I would like to simulate some measurements used for orbit determination. So I created one Generator and registered propagators of all satellites to it (so the propagatorIndex would be 0-59). Then I created the schedulers for each ISL and attached them to the Generator. After generating the measurements, I used BatchLSEstimator to do the estimation.
But when I did estimator.estimate();
I met an error:
Java exception occurred:
java.lang.ArrayIndexOutOfBoundsException: 41
at org.orekit.estimation.measurements.InterSatellitesRange.theoreticalEvaluation(InterSatellitesRange.java:128)
at org.orekit.estimation.measurements.AbstractMeasurement.estimate(AbstractMeasurement.java:204)
at org.orekit.estimation.leastsquares.MeasurementHandler.handleStep(MeasurementHandler.java:95)
at org.orekit.propagation.PropagatorsParallelizer.propagate(PropagatorsParallelizer.java:205)
at org.orekit.estimation.leastsquares.BatchLSModel.value(BatchLSModel.java:245)
at org.hipparchus.optim.nonlinear.vector.leastsquares.LeastSquaresFactory$LocalLeastSquaresProblem.evaluate(LeastSquaresFactory.java:440)
at org.orekit.estimation.leastsquares.BatchLSEstimator$TappedLSProblem.evaluate(BatchLSEstimator.java:602)
at org.hipparchus.optim.nonlinear.vector.leastsquares.LevenbergMarquardtOptimizer.optimize(LevenbergMarquardtOptimizer.java:333)
at org.orekit.estimation.leastsquares.BatchLSEstimator.estimate(BatchLSEstimator.java:422)
I checked the source code of “InterSatellitesRange”. I noticed on the lines 126-132
// coordinates of both satellites
final ObservableSatellite local = getSatellites().get(0);
final SpacecraftState stateL = states[local.getPropagatorIndex()];
final TimeStampedFieldPVCoordinates<DerivativeStructure> pvaL = getCoordinates(stateL, 0, factory);
final ObservableSatellite remote = getSatellites().get(1);
final SpacecraftState stateR = states[remote.getPropagatorIndex()];
final TimeStampedFieldPVCoordinates<DerivativeStructure> pvaR = getCoordinates(stateR, 6, factory);
So I think the problem here is that since it’s an ISL measurement, the size of variable states
is 2 (local and remote satellites). But the propagatorIndex it gets from local.getPropagatorIndex()
is no longer 0 or 1 (in this case is 41).
I think a simple way to solve this problem is just changing the index directly as 0 and 1 (since the line above uses getSatellites().get(0)
and getSatellites().get(1)
respectively), like
final SpacecraftState stateL = states[0];
final SpacecraftState stateR = states[1];
Or maybe I don’t quite get the reason why it designs like that, and I made some other mistakes led to this? Do you have any suggestion?
Thanks a lot!