Multiplication of transformation types and matrices in Eigen

For me, this should work, so this does not happen, it almost certainly means that I'm wrong. Although in principle Transform <double, 3, Affine> matches the matrix <double, 4, 4>, they cannot be used together intelligently:

Affine3d rotMat( AngleAxisd( 45.0, ( Vector3d() << 0.0, 1.0, 0.0 ).finished() ) ); Matrix4d m; m << 1.0, 0.0, 0.0, 6.0, 0.0, 1.0, 0.0, 6.0, 0.0, 0.0, 1.0, 6.0, 0.0, 0.0, 0.0, 1.0; m = m * rotMat; 

The results in the error "there is no match for the operator =" in the last line, and the multiplication operator in place leads to the same, an attempt to initialize Matrix4d with Affine3d does not work either. Does anyone know how to actually use the Transform class in any useful way?

Thanks Cam

+6
c ++ matrix transform eigen
source share
1 answer

Just write:

 m = m * rotMat.matrix(); 

I don’t know if the supervision that Eigen does not define this multiplication implicitly or may interfere with other use cases of the library.

+8
source share

All Articles