Eigen library: matrix block operation:
http://eigen.tuxfamily.org/dox-devel/group__TutorialBlockOperations.html
//Code snippet to define a 4x4 transformation matrix:
Eigen::Matrix4f txform;
.........
// Get Rotation Matrix and translation vector: T = [R | t]
Eigen::Matrix3f rotation = txform.block<3,3>(0, 0);
Eigen::Vector3f translation = txform.block<3,1>(0, 3);
//Print he individual values
printf ("\n");
printf (" | %6.3f %6.3f %6.3f | \n", rotation (0,0), rotation (0,1), rotation (0,2));
printf (" R = | %6.3f %6.3f %6.3f | \n", rotation (1,0), rotation (1,1), rotation (1,2));
printf (" | %6.3f %6.3f %6.3f | \n", rotation (2,0), rotation (2,1), rotation (2,2));
printf ("\n");
printf (" t = < %0.3f, %0.3f, %0.3f >\n", translation (0), translation (1), translation (2));
No comments:
Post a Comment