Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

About the schmidt function during initialization process #317

Closed
mingrenzhu opened this issue Mar 13, 2023 · 1 comment
Closed

About the schmidt function during initialization process #317

mingrenzhu opened this issue Mar 13, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@mingrenzhu
Copy link

Hi,
The rotation matrix between gravity direction and imu is calculated using stationary imu measurements. The code is implemented as follows:

static void gram_schmidt(const Eigen::Vector3d &gravity_inI, Eigen::Matrix3d &R_GtoI) {

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 goldbattle added the debugging Might be a bug, looking into the issue label Mar 13, 2023
@goldbattle goldbattle added bug Something isn't working and removed debugging Might be a bug, looking into the issue labels Apr 15, 2023
@goldbattle
Copy link
Member

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

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants