HKUST-Aerial-Robotics / VINS-Mono

A Robust and Versatile Monocular Visual-Inertial State Estimator
GNU General Public License v3.0
5.01k stars 2.1k forks source link

IMU jacobian and covariance matrix #183

Closed LeRoii closed 6 years ago

LeRoii commented 6 years ago

Hi there, As I read this explanation of IMU pre-integration part and did my own deduction, I've found some differences between the code and my result In the code, the matrix V looks like this, https://github.com/HKUST-Aerial-Robotics/VINS-Mono/blob/65b4390cfd3d902086d4b60800ce58a0ebccfa7f/vins_estimator/src/factor/integration_base.h#L115 https://github.com/HKUST-Aerial-Robotics/VINS-Mono/blob/65b4390cfd3d902086d4b60800ce58a0ebccfa7f/vins_estimator/src/factor/integration_base.h#L116 https://github.com/HKUST-Aerial-Robotics/VINS-Mono/blob/65b4390cfd3d902086d4b60800ce58a0ebccfa7f/vins_estimator/src/factor/integration_base.h#L117

while what I got looks like this

V.block<3, 3>(6, 0) =  -0.5 * delta_q.toRotationMatrix() * _dt;
V.block<3, 3>(6, 3) =  0.5 * -result_delta_q.toRotationMatrix() * R_a_1_x  * _dt *_dt * 0.5 * _dt;
V.block<3, 3>(6, 6) =  -0.5 * result_delta_q.toRotationMatrix() * _dt;

I don't understand why I got a minus in first and third terms, and get one more _dt in second term. If anyone has a full detailed deduction pls show me

Thanks in advance

IbaDup commented 6 years ago

Hi, you can find the detailed deductions in https://github.com/HKUST-Aerial-Robotics/VINS-Mono/issues/14 Hope this helps.

vbtang commented 6 years ago

@IbaDup thanks for your reply, but I think i should describe my question with more details.

From the ESKF, I got this formula: image

And for midpoint integration: image

Form the above formulas, I think these items(In the following figure, the box is selected) should have the same sign(negative). image

but in this topic https://github.com/HKUST-Aerial-Robotics/VINS-Mono/issues/14. the last two items are positive(same in the code).

I modified the code and complied it. the program works as well.

PeiliangLi commented 6 years ago

@vbtang You can change any of the sign in the noise jacobian, since adding or subtracting a Gaussian noise have the same effect.

vbtang commented 6 years ago

@PeiliangLi got it, thanks.