Created
July 8, 2015 19:54
-
-
Save davidlandry93/9195d205c727d63baaa0 to your computer and use it in GitHub Desktop.
eigenTransformOfPoses
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Eigen::Transform<double,3,Eigen::Affine> eigenTransformOfPoses(geometry_msgs::Pose from, geometry_msgs::Pose to) | |
{ | |
Eigen::Quaternionf fromQuat = rosQuatToEigenQuat(from.orientation); | |
Eigen::Quaternionf toQuat = rosQuatToEigenQuat(to.orientation); | |
Eigen::Quaternionf quaternionRotation = transFromQuatToQuat(fromQuat, toQuat); | |
Eigen::Transform<float,3,Eigen::Affine> rotation(quaternionRotation); | |
Eigen::Translation<double,3> translation(vectorOfPoints(from.position, to.position)); | |
Eigen::Transform<float,3,Eigen::Affine> T = rotation * translation.cast<float>(); | |
return T.cast<double>(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment