# include <iostream>
# include <pcl/point_cloud.h>
# include <pcl/io/pcd_io.h>
# include <pcl/common/transforms.h>
# include <pcl/io/ply_io.h>
int main ( ) {
pcl:: PointCloud< pcl:: PointXYZ> :: Ptr source_cloud ( new pcl:: PointCloud< pcl:: PointXYZ> ) ;
pcl:: PointCloud< pcl:: PointXYZ> :: Ptr target_cloud ( new pcl:: PointCloud< pcl:: PointXYZ> ) ;
pcl:: io:: loadPLYFile < pcl:: PointXYZ> ( "bunny.ply" , * source_cloud) ;
Eigen:: Matrix3d R = Eigen:: Matrix3d :: Identity ( ) ;
Eigen:: AngleAxisd yaw ( 0.06 , Eigen:: Vector3d :: UnitZ ( ) ) ;
Eigen:: AngleAxisd pitch ( 0 , Eigen:: Vector3d :: UnitY ( ) ) ;
Eigen:: AngleAxisd roll ( 0 , Eigen:: Vector3d :: UnitX ( ) ) ;
Eigen:: Vector3d T;
T. x ( ) = 0 ;
T. y ( ) = 0 ;
T. z ( ) = 0 ;
R = yaw * pitch * roll;
Eigen:: Quaterniond Q ( R) ;
pcl:: transformPointCloud ( * source_cloud, * target_cloud, T, Q) ;
pcl:: io:: savePLYFile ( "bunnyzzz.ply" , * target_cloud) ;
}