Last active
May 1, 2018 07:20
-
-
Save Kyungpyo-Kim/8ec5118b1f8da701dd7f80920213e55b to your computer and use it in GitHub Desktop.
PCL, calibration, transformation
This file contains 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
// calibaration | |
Eigen::Affine3f PCLTransformationMat(float x, float y, float z, float roll, float pitch, float yaw) | |
{ | |
Eigen::Affine3f transformation; | |
transformation.setIdentity(); | |
Eigen::AngleAxisf rollAngle(roll, Eigen::Vector3f::UnitX()); | |
Eigen::AngleAxisf pitchAngle(pitch, Eigen::Vector3f::UnitY()); | |
Eigen::AngleAxisf yawAngle(yaw, Eigen::Vector3f::UnitZ()); | |
Eigen::Quaternion<float> q = rollAngle*pitchAngle*yawAngle; | |
transformation.translate(Eigen::Vector3f(x, y, z)); | |
transformation.rotate(q); | |
return transformation; | |
} | |
/* Example | |
/* pcl::PointCloud<pcl::PointXYZ>::Ptr _current_sensor_cloud_ptr (new pcl::PointCloud<pcl::PointXYZ>); | |
/* pcl::PointCloud<pcl::PointXYZ>::Ptr _calib_sensor_cloud_ptr (new pcl::PointCloud<pcl::PointXYZ>); | |
/* Eigen::Affine3f transformation = PCLTransformationMat(x, y, z, roll, pitch, yaw); | |
/* pcl::transformPointCloud(*_current_sensor_cloud_ptr, *_calib_sensor_cloud_ptr, transformation); | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment