GraspItHelpers.cpp
Go to the documentation of this file.
00001 
00021 #include <grasp_planning_graspit/GraspItHelpers.h>
00022 #include <graspit/matvec3D.h>
00023 
00024 transf GraspIt::getGraspitTransform(const GraspIt::EigenTransform& transform)
00025 {
00026     Eigen::Vector3d trans = transform.translation();
00027     Eigen::Quaterniond quat(transform.rotation());
00028 
00029     transf t;
00030     vec3 translation(trans.x(), trans.y(), trans.z());
00031     Quaternion quaternion(quat.w(), quat.x(), quat.y(), quat.z());
00032     t.set(quaternion, translation);
00033 
00034     return t;
00035 }
00036 
00037 GraspIt::EigenTransform GraspIt::getEigenTransform(const transf& trans)
00038 {
00039     GraspIt::EigenTransform transform;
00040     transform.setIdentity();
00041 
00042     Quaternion q = trans.rotation();
00043     vec3 t = trans.translation();
00044 
00045     Eigen::Vector3d translation(t.x(), t.y(), t.z());
00046     Eigen::Quaterniond quaternion(q.w(), q.x(), q.y(), q.z());
00047 
00048     transform = transform.translate(translation);
00049     transform = transform.rotate(quaternion);
00050 
00051     return transform;
00052 }
00053 


grasp_planning_graspit
Author(s): Jennifer Buehler
autogenerated on Wed May 8 2019 02:53:36