KumarRobotics/msckf_vio

covariance update equation

Closed this issue · 2 comments

The right equation to update covariance matrix may be the one attached as follows:

screen shot 2018-07-04 at 10 51 50 am

But in your code , you used a simplified one, and commented out the right one.

void MsckfVio::measurementUpdate(
    const MatrixXd& H, const VectorXd& r) {
...
  // Update state covariance.
  MatrixXd I_KH = MatrixXd::Identity(K.rows(), H_thin.cols()) - K*H_thin;
  //state_server.state_cov = I_KH*state_server.state_cov*I_KH.transpose() +
  //  K*K.transpose()*Feature::observation_noise;
  state_server.state_cov = I_KH*state_server.state_cov;
...

I am thinking if you have tried to use the right one, but it did not work as expected?

Thanks!

Please correct me if I am wrong. I though the two equations are equivalent if K is the optimal Kalman gain. The advantage of the uncommented code is less operation.

I found a trustworthy explanation in Paper(Quaternion kinematics for the error-state Kalman filter, P63).

Screenshot 2019-05-09 at 4 05 12 PM