SemiAnalyticalKalmanEstimator.java

  1. /* Copyright 2002-2022 CS GROUP
  2.  * Licensed to CS GROUP (CS) under one or more
  3.  * contributor license agreements.  See the NOTICE file distributed with
  4.  * this work for additional information regarding copyright ownership.
  5.  * CS licenses this file to You under the Apache License, Version 2.0
  6.  * (the "License"); you may not use this file except in compliance with
  7.  * the License.  You may obtain a copy of the License at
  8.  *
  9.  *   http://www.apache.org/licenses/LICENSE-2.0
  10.  *
  11.  * Unless required by applicable law or agreed to in writing, software
  12.  * distributed under the License is distributed on an "AS IS" BASIS,
  13.  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14.  * See the License for the specific language governing permissions and
  15.  * limitations under the License.
  16.  */
  17. package org.orekit.estimation.sequential;

  18. import java.util.Collections;
  19. import java.util.List;

  20. import org.hipparchus.exception.MathRuntimeException;
  21. import org.hipparchus.filtering.kalman.extended.ExtendedKalmanFilter;
  22. import org.hipparchus.linear.MatrixDecomposer;
  23. import org.orekit.errors.OrekitException;
  24. import org.orekit.estimation.measurements.ObservedMeasurement;
  25. import org.orekit.propagation.conversion.DSSTPropagatorBuilder;
  26. import org.orekit.propagation.semianalytical.dsst.DSSTPropagator;
  27. import org.orekit.utils.ParameterDriver;
  28. import org.orekit.utils.ParameterDriversList;

  29. /**
  30.  * Implementation of an Extended Semi-analytical Kalman Filter (ESKF) to perform orbit determination.
  31.  * <p>
  32.  * The filter uses a {@link DSSTPropagatorBuilder}.
  33.  * </p>
  34.  * <p>
  35.  * The estimated parameters are driven by {@link ParameterDriver} objects. They are of 3 different types:<ol>
  36.  *   <li><b>Orbital parameters</b>:The position and velocity of the spacecraft, or, more generally, its orbit.<br>
  37.  *       These parameters are retrieved from the reference trajectory propagator builder when the filter is initialized.</li>
  38.  *   <li><b>Propagation parameters</b>: Some parameters modelling physical processes (SRP or drag coefficients).<br>
  39.  *       They are also retrieved from the propagator builder during the initialization phase.</li>
  40.  *   <li><b>Measurements parameters</b>: Parameters related to measurements (station biases, positions etc...).<br>
  41.  *       They are passed down to the filter in its constructor.</li>
  42.  * </ol>
  43.  * <p>
  44.  * The Kalman filter implementation used is provided by the underlying mathematical library Hipparchus.
  45.  * All the variables seen by Hipparchus (states, covariances, measurement matrices...) are normalized
  46.  * using a specific scale for each estimated parameters or standard deviation noise for each measurement components.
  47.  * </p>
  48.  *
  49.  * @see "Folcik Z., Orbit Determination Using Modern Filters/Smoothers and Continuous Thrust Modeling,
  50.  *       Master of Science Thesis, Department of Aeronautics and Astronautics, MIT, June, 2008."
  51.  *
  52.  * @see "Cazabonne B., Bayard J., Journot M., and Cefola P. J., A Semi-analytical Approach for Orbit
  53.  *       Determination based on Extended Kalman Filter, AAS Paper 21-614, AAS/AIAA Astrodynamics
  54.  *       Specialist Conference, Big Sky, August 2021."
  55.  *
  56.  * @author Julie Bayard
  57.  * @author Bryan Cazabonne
  58.  * @author Maxime Journot
  59.  * @since 11.1
  60.  */
  61. public class SemiAnalyticalKalmanEstimator extends AbstractKalmanEstimator {

  62.     /** Kalman filter process model. */
  63.     private final SemiAnalyticalKalmanModel processModel;

  64.     /** Filter. */
  65.     private final ExtendedKalmanFilter<MeasurementDecorator> filter;

  66.     /** Kalman filter estimator constructor (package private).
  67.      * @param decomposer decomposer to use for the correction phase
  68.      * @param propagatorBuilder propagator builder used to evaluate the orbit.
  69.      * @param covarianceMatrixProvider provider for process noise matrix
  70.      * @param estimatedMeasurementParameters measurement parameters to estimate
  71.      * @param measurementProcessNoiseMatrix provider for measurement process noise matrix
  72.      */
  73.     public SemiAnalyticalKalmanEstimator(final MatrixDecomposer decomposer,
  74.                                          final DSSTPropagatorBuilder propagatorBuilder,
  75.                                          final CovarianceMatrixProvider covarianceMatrixProvider,
  76.                                          final ParameterDriversList estimatedMeasurementParameters,
  77.                                          final CovarianceMatrixProvider measurementProcessNoiseMatrix) {
  78.         super(Collections.singletonList(propagatorBuilder));
  79.         // Build the process model and measurement model
  80.         this.processModel = new SemiAnalyticalKalmanModel(propagatorBuilder, covarianceMatrixProvider,
  81.                                                           estimatedMeasurementParameters,  measurementProcessNoiseMatrix);

  82.         // Extended Kalman Filter of Hipparchus
  83.         this.filter = new ExtendedKalmanFilter<>(decomposer, processModel, processModel.getEstimate());

  84.     }

  85.     /** {@inheritDoc}. */
  86.     @Override
  87.     protected KalmanEstimation getKalmanEstimation() {
  88.         return processModel;
  89.     }

  90.     /** Set the observer.
  91.      * @param observer the observer
  92.      */
  93.     public void setObserver(final KalmanObserver observer) {
  94.         processModel.setObserver(observer);
  95.     }

  96.     /** Process a single measurement.
  97.      * <p>
  98.      * Update the filter with the new measurement by calling the estimate method.
  99.      * </p>
  100.      * @param observedMeasurements the list of measurements to process
  101.      * @return estimated propagators
  102.      */
  103.     public DSSTPropagator processMeasurements(final List<ObservedMeasurement<?>> observedMeasurements) {
  104.         try {
  105.             return processModel.processMeasurements(observedMeasurements, filter);
  106.         } catch (MathRuntimeException mrte) {
  107.             throw new OrekitException(mrte);
  108.         }
  109.     }

  110. }