rpng / open_vins

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

About the schmidt function during initialization process #317

Closed mingrenzhu closed 1 year ago

mingrenzhu commented 1 year ago

Hi, The rotation matrix between gravity direction and imu is calculated using stationary imu measurements. The code is implemented as follows: https://github.com/rpng/open_vins/blob/98c55256a45b5518cf0a02e0f984cd2afafe99e0/ov_init/src/utils/helper.h#L138

Seem to have a problem with following code: if (fabs(inner1) >= fabs(inner2)) In the extreme case e_1 is parallel to z_axis, then if the following operation is performed, so the cross product is zero, and the x_axis vector is not computed x_axis = z_axis.cross(e_1); So I think the correct operation to do is to modify the "if judgment" to be less than or equal, as following if (fabs(inner1) <= fabs(inner2))

Looking forward to your reply, thanks !

goldbattle commented 1 year ago

Yep, looks like this would fail in that case. Thanks for the report.