Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to represent Compact isometry transformation matrix in Eigen?

I have a bunch of isometry [R | t] transformation matrices, i.e. they are 3D rigid transformations. Currently I store them as Eigen Affine transformations, represented in the compact form e.g. Eigen::AffineCompact3d which does not stores the redundant last row of [0 0 0 1].

I am also aware that there is a Eigen::Isometry3d which I guess is typedef of Transform<double, 3, AffineCompact, Isometry>.

I am after Isometry since, the inverse tranformation is much cheaper (transpose) than a general affine inverse. I also know that I can pass a hint, when I use inverse() as affine_mat.inverse(Eigen::Isometry);

But I would like to get the isometric inverse behavior without every-time manually passing a hint. In other words, I want to know, what is the best way to replicate the behavior of Eigen::IsometryCompact3d which is surprisingly absent in the Eigen API?

like image 328
iNFINITEi Avatar asked Nov 12 '22 13:11

iNFINITEi


1 Answers

To represent isometries I am currently using twists. This parametrization can be described by a 6 element vector.

To transform back and forth to the standard homogeneous matrix formulation you will need a couple of functions based on log() and exp() (thus converting will be a slow operation).

This soluiton is favourable if you do not have performance constraint on going back and forth between the two formulation (or you do it rarely) or if you want to exploit the properties of the twists (for instance in numerical optimization)

like image 170
Pierluigi Avatar answered Nov 15 '22 06:11

Pierluigi