Hi everyone,
I try to get the innovation from a KalmanEstimator
object. I use the KalmanObserver
interface as mentioned in this topic1 but it seems that the method evaluationPerformed
is not called. Bellow an example:
#My Kalman Observer class
class MyObserverTest(KalmanObserver):
def __init__(self):
pass
def evaluationPerformed(self, estimation):
print('step')
# Setting up the estimator
kalman_estimator_builder = KalmanEstimatorBuilder()
kalman_estimator_builder.addPropagationConfiguration(numerical_propagator_builder,ConstantProcessNoise(Q, initial_covariance_matrix))
kalman_estimator = kalman_estimator_builder.build()
#Adding the observer
my_observer_test = MyObserverTest()
kalman_estimator.setObserver(my_observer_test)
for spacecraft_state in list_spacecraft_state:
#Creating the measurement from the spacecraft state
date = spacecraft_state.getDate()
pv_coordinates = spacecraft_state.getPVCoordinates()
position = pv_coordinates.getPosition()
velocity = pv_coordinates.getVelocity()
pv_measurement = PV(date, position, velocity, sigma_pv, base_weight, obs_satellite)
#Estimation step
propagator_estimated = kalman_estimator.estimationStep(pv_measurement)[0]
#Testing the estimation
print(kalman_estimator.getPhysicalEstimatedCovarianceMatrix())
It only prints the covariance matrix but not the ‘step’ string from the evaluationPerformed
method.
Do you have any idea where the error is ?
Otherwise I have a doubt an another issue. When I use a NumericalPropagatorBuilder
in the KalmanEstimatorBuilder
it rises me the error of negative eccentricity for some initial state during the estimation steps. However there is no setOrbitType
method in NumericalPropagatorBuilder
as in NumericalPropagator
, so I can’t use it as in topic2. I found a solution by setting the initial orbit as an equinoctial one. Bellow an example:
orbit = EquinoctialOrbit(initial_spacecraft_state.getOrbit())
propagator_builder = NumericalPropagatorBuilder(orbit, integrator_builder, PositionAngle.MEAN, 1.0, attitude_provider)
Is it the right way to solve this issue ?
Thanks a lot,
Kind regards,
Stéfan