Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Eigen - Re-orthogonalization of Rotation Matrix

After multiplying a lot of rotation matrices, the end result might not be a valid rotation matrix any more, due to rounding issues (de-orthogonalized)

One way to re-orthogonalize is to follow these steps:

  1. Convert the rotation matrix to an axis-angle representation (link)
  2. Convert back the axis-angle to a rotation matrix (link)

Is there something in Eigen library that does the same thing by hiding all the details? Or is there any better recipe?

This procedure has to be handled with care due to special singularity cases, so if Eigen provides a better tool for this it would be great.

like image 589
dim_tz Avatar asked Apr 15 '14 10:04

dim_tz


People also ask

Are there eigenvalues and eigenvectors of rotation matrices?

Eigenvalues and eigenvectors of rotation matrices These notes are a supplement to a previous class handout entitled, Rotation Matrices in two, three and many dimensions. In these notes, we shall focus on the eigenvalues and eigenvectors of proper and improper rotation matrices in two and three dimensions. 1.

How do you find the eigenvalues of a real orthogonal matrix?

Thus, the eigenvalues of a real orthogonal matrix must be complex numbers of unit modulus. That is, λ = eiαfor some α in the interval 0 ≤ α < 2π. Consider the following product of matrices, where A satisfies ATA = I, AT(I−A) = A − I= −(I− A)T. Taking the determinant of both sides of this equation, it follows that4

What is the difference between eigen decomposition and orthogonalization?

Eigen decomposition is the process of representing vectors or a matrix by its eigenvalues and eigenvectors. The eigenvalue is like a scalar, but we will go over this in more detail in the article. Orthogonalization is the process of making vectors orthogonal.

How to re-orthogonalize a matrix?

You can use a QR decomposition to systematically re-orthogonalize, where you replace the original matrix with the Q factor. In the library routines you have to check and correct, if necessary, by negating the corresponding column in Q, that the diagonal entries of R are positive (close to 1 if the original matrix was close to orthogonal).


1 Answers

An alternative is to use Eigen::Quaternion to represent your rotation. This is much easier to normalize, and rotation*rotation products are generally faster. If you have a lot of rotation*vector products (with the same matrix), you should locally convert the quaternion to a 3x3 matrix.

like image 105
chtz Avatar answered Oct 01 '22 14:10

chtz