pcl自带的每个点乘以矩阵是右乘,
pcl::transformPointCloud(*source_cloud, *target_cloud, transform):
这里实现左乘
pcl::PointCloud<pcl::PointXYZRGB> xxx;
xxx.width = cloud_source->points.size();
xxx.height = 1;
xxx.is_dense = false;
xxx.points.resize(xxx.width * xxx.height);
/*xxx.points.size() = cloud_source->points.size();*/
for (int i = 0; i < cloud_source->points.size(); i++)
{
Eigen::Matrix4f cloud111,cloud222;
cloud111 << 1, 0, 0, cloud_source->points[i].x,
0, 1, 0, cloud_source->points[i].y,
0, 0, 1, cloud_source->points[i].z,
0, 0, 0, 1;
cloud222 = b2t * tras*cloud111;
xxx.points[i].x = cloud222(0,3);
xxx.points[i].y = cloud222(1,3);
xxx.points[i].z = cloud222(2,3);
//cout << i << endl;
}
//pcl::PointCloud<pcl::PointXYZRGB>::Ptr transformed_cloud(new pcl::PointCloud<pcl::PointXYZRGB>);
transformed_cloud = xxx.makeShared();