Hi Orekit developers,
I am currently trying to implement a Kalman estimator for orbit determination. I tried to follow the tutorials in Gitlab, but I’m still having some trouble getting the parameter drivers to work. When I run the estimator using .processMeasurements() I end up with this error:
at org.orekit.estimation.sequential.KalmanModel.checkDimension(Int32 , ParameterDriversList , ParameterDriversList , ParameterDriversList )
at org.orekit.estimation.sequential.KalmanModel.getEvolution(Double previousTime, RealVector previousState, MeasurementDecorator measurement)
at org.orekit.estimation.sequential.KalmanModel.getEvolution(Double d, RealVector rv, Measurement m)
at org.hipparchus.filtering.kalman.extended.ExtendedKalmanFilter.estimationStep(Measurement measurement)
at org.orekit.estimation.sequential.KalmanEstimator.estimationStep(ObservedMeasurement observedMeasurement)
at org.orekit.estimation.sequential.KalmanEstimator.processMeasurements(Iterable observedMeasurements)
My code is as follows:
ODEIntegratorBuilder integrator = new DormandPrince853IntegratorBuilder(0.001, 1000, 1);
PositionAngle angle = PositionAngle.MEAN;
double scale = 1; // scaling factor used for orbital parameters normalization (typically set to the expected standard deviation of the position)
NumericalPropagatorBuilder propagatorBuilder = new NumericalPropagatorBuilder(initialGuess, integrator, angle, scale);
// Define the univariate functions for the standard deviations
UnivariateFunction[] lofCartesianOrbitalParametersEvolution = new UnivariateFunction[6];
// Evolution for position error
lofCartesianOrbitalParametersEvolution[0] = new PolynomialFunction(new double[] { 100, 0, 1e-4 });
lofCartesianOrbitalParametersEvolution[1] = new PolynomialFunction(new double[] { 100, 1e-1, 0 });
lofCartesianOrbitalParametersEvolution[2] = new PolynomialFunction(new double[] { 100, 0, 0 });
// Evolution for velocity error
lofCartesianOrbitalParametersEvolution[3] = new PolynomialFunction(new double[] { 1, 0, 1e-6 });
lofCartesianOrbitalParametersEvolution[4] = new PolynomialFunction(new double[] { 1, 1e-3, 0 });
lofCartesianOrbitalParametersEvolution[5] = new PolynomialFunction(new double[] { 1, 0, 0 });
UnivariateFunction[] propagationParametersEvolution = new UnivariateFunction[]
{
new PolynomialFunction(new double[] { 10, 1, 1e-4 }),
new PolynomialFunction(new double[] { 1000, 0, 0 }),
};
double threshold = 1e-10; // threshold to identify matrix singularity
RealMatrix cov = blse.getPhysicalCovariances(threshold);
UnivariateProcessNoise covarianceMatricesProvider = new UnivariateProcessNoise(cov, LOFType.TNW, angle, lofCartesianOrbitalParametersEvolution, propagationParametersEvolution);
// Get estimatedMeasurementParameters
ParameterDriversList estimatedMeasurementParameters = new ParameterDriversList();
foreach (ObservedMeasurement ob in obs)
foreach (ParameterDriver driver in ob.getParametersDrivers().toArray())
estimatedMeasurementParameters.add(driver);
//foreach (DelegatingDriver delegating in propagatorBuilder.getOrbitalParametersDrivers().getDrivers().toArray())
// foreach (ParameterDriver driver in delegating.getRawDrivers().toArray())
// estimatedMeasurementParameters.add(driver);
//foreach (DelegatingDriver delegating in propagatorBuilder.getPropagationParametersDrivers().getDrivers().toArray())
// foreach (ParameterDriver driver in delegating.getRawDrivers().toArray())
// estimatedMeasurementParameters.add(driver);
KalmanEstimator kalman = new KalmanEstimatorBuilder()
.addPropagationConfiguration(propagatorBuilder, covarianceMatricesProvider)
.estimatedMeasurementsParameters(estimatedMeasurementParameters)
.build();
I’ve tried adding the parameter drivers from the measurements themselves and the numerical propagator (propagation parameters and/or orbital parameters). It seems that there may be some issue either with the way I am inputting the measurements (I’m adding the measurements using the Position class with a sigma = 1) or with the drivers themselves. It may also be possible that I am using the Kalman estimator entirely wrong.
Any help is appreciated, as this is my first time building a Kalman estimator for orbit determination.
Thanks,