rpng / open_vins

An open source platform for visual-inertial navigation research.
https://docs.openvins.com
GNU General Public License v3.0
2.07k stars 619 forks source link

measurement noise should _noises.sigma_w_2 * dt * dt in Zupt ? #273

Closed chennuo0125-HIT closed 1 year ago

chennuo0125-HIT commented 1 year ago

when I see the code UpdaterZeroVelocity.cpp, and I found the follow measurement noise may be false, noise should be proportional to dt^2 ?
https://github.com/rpng/open_vins/blob/cd866b5ba58f1b59f0d6983c0a379753d25d1308/ov_msckf/src/update/UpdaterZeroVelocity.cpp#L165

goldbattle commented 1 year ago

It should depend on the definition of Q. https://github.com/rpng/open_vins/blob/cd866b5ba58f1b59f0d6983c0a379753d25d1308/ov_msckf/src/update/UpdaterZeroVelocity.cpp#L178-L182

I will try to find some time to more closely remind myself of this code, and see if you are correct.

EDIT: this Q is only used to compensate for bias errors, the R you point to is a separate problem.

chennuo0125-HIT commented 1 year ago

@goldbattle the R measure noise matrix will be used in EKFUpdate(), should proportion to dt ? https://github.com/rpng/open_vins/blob/cd866b5ba58f1b59f0d6983c0a379753d25d1308/ov_msckf/src/update/UpdaterZeroVelocity.cpp#L260

goldbattle commented 1 year ago

I believe this should be correct. The noises that we have are continuous time, thus we need to convert them into a discrete time one. This is described in Trawny's report: image

The random walks are related by a sqrt(dt) while the white noises are related by a 1/sqrt(dt). When you find the uncertainty of this measurement, you get sigma^2 which equates to a times dt for random walks, and a 1/dt for white noise terms.

This definition here actually is incorrect and should use the random walk noises squared, which I will push a fix to the master in a bit https://github.com/rpng/open_vins/commit/38610105652a7bc9843f3fb35c7b93a528725680: https://github.com/rpng/open_vins/blob/cd866b5ba58f1b59f0d6983c0a379753d25d1308/ov_msckf/src/update/UpdaterZeroVelocity.cpp#L178-L182

Let me know if this helps.