Registered Member
|
Hi all,
I am trying to store some euclidean transformation (3D rotation and translation) which is just a an affine transformation with linear part as a 3D rotation matrix. I am currently using the Transform class to store [R t] in affine-compact form (See the code below). However when I take an inverse, I want to really get [R' -R't] instead computing an generic affine inverse. I can see that Tranform::inverse documentation has something called isometry, which is probably what I am looking for. But I couldn't figure out how to use that?
Would really appreciate some help regarding this. |
Registered Member
|
Just pass Isometry as the first argument to .inverse(). Like this:
In fact, since the argument defaults to the _Mode template parameter of Eigen::Transform, you could just use
|
Registered Member
|
Thanks a lot Oxyd, for your reply.
I have some more questions. If I want a Compact version (3x4) matrix version, how do I typedef it?
Also how do I check the actual expression produced by Eigen (pardon my c++ knowledge). Right now I using the following code to check the runtime and the above typedef takes more time than using Isometry3d or directly using inverse(Isometry) function.
|
Registered Member
|
Above all, I'd start by actually trusting the documentation and Eigen developers. You could step through the call with a debugger or read the source code:
As you can see, if hint == Isometry, the inverse amounts to transposing the linear part and setting the last column to the product of the transposed linear part and the original last column, with the sign inverted. Your typedef
However, it appears that if you use Eigen::Isometry3d, AKA Eigen::Transform<double, 3, Eigen::Isometry>, you won't get the compact 3x4 representation, and if you choose the compact 3x4 representation, you won't get the fast inverse you're after as a default behaviour. So I'd say the best option here is to use
|
Registered Member
|
Registered users: Bing [Bot], Google [Bot], Yahoo [Bot]