hku-mars / IKFoM

A computationally efficient and convenient toolkit of iterated Kalman filter.
GNU General Public License v2.0
419 stars 75 forks source link

A question about the S2 manifold #4

Closed daijicheng closed 2 years ago

daijicheng commented 2 years ago

Thank you so much for your wonderful work. I would like to ask how to determine the orthogonal basis B in the tangent space of S2 manifold. The relevant code seems to be

                if (vec[0] + length > tolerance<scalar>())
                {

                    res << -vec[1], -vec[2],
                        length - vec[1] * vec[1] / (length + vec[0]), -vec[2] * vec[1] / (length + vec[0]),
                        -vec[2] * vec[1] / (length + vec[0]), length - vec[2] * vec[2] / (length + vec[0]);
                    res /= length;
                }
                else
                {
                    res = Eigen::Matrix<scalar, 3, 2>::Zero();
                    res(1, 1) = -1;
                    res(2, 0) = 1;
                }

Can you list some relevant materials for me to learn about this and the M and N matrix used in S2 manifold?

Joanna-HE commented 2 years ago

Hi, thanks for your interest in our work. To determine the basis of a certain point x of S2 manifold, firstly, determine an identity (x_0) of the S2 manifold, for example, x_0 = (0, 0, 1), then b1_0 = (1, 0, 0) and b2_0 = (0, 1, 0) could be chosen as the basis of the tangent space at point x_0. Next, calculate the rotation matrix R_x for rotating x_0 to the certain point x along a certain geodesic of the S2 manifold, such as R_x x_0 = x, finally, R_x b1_0 = b1, and R_x * b2_0 = b2 are two basis vectors of the tangent space of the S2 manifold at point x.

daijicheng commented 2 years ago

Thanks for the the useful answer.