4 #include <pcl/io/pcd_io.h> 5 #include <pcl/io/ply_io.h> 6 #include <pcl/point_cloud.h> 7 #include <pcl/console/parse.h> 8 #include <pcl/common/transforms.h> 12 main (
int argc,
char** argv)
15 pcl::PointCloud<pcl::PointXYZRGB> pos1, pos2, pos1_t;
33 Eigen::Matrix4d transform1 = Eigen::Matrix4d::Identity();
34 Eigen::Matrix4d transform2 = Eigen::Matrix4d::Identity();
36 std::ifstream infile(
"../data/rts.txt");
38 for(
int i=0; i<4; i++)
40 for(
int j=0; j<4; j++)
42 infile >> transform1(i,j);
45 for(
int i=0; i<4; i++)
47 for(
int j=0; j<4; j++)
49 infile >> transform2(i,j);
64 std::cout << transform1 <<
"\n" << transform2 <<
"\n";
66 Eigen::Matrix4d
transform = transform2*(transform1.inverse());
68 std::cout <<
"Final transform from camera1 to camera2 is:\n" << transform <<
"\n";
73 pcl::transformPointCloud (pos1, pos1_t, transform);
76 pcl::io::savePCDFileASCII (
"../data/final_cloud.pcd", pos2);
pcl::PointCloud< myPointXYZRID > transform(pcl::PointCloud< myPointXYZRID > pc, float x, float y, float z, float rot_x, float rot_y, float rot_z)
int main(int argc, char **argv)
int loadPCDFile(const std::string &file_name, sensor_msgs::PointCloud2 &cloud)