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))
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 computedx_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 followingif (fabs(inner1) <= fabs(inner2))
Looking forward to your reply, thanks !