pcl::transformPointCloud 函数使用

method 1

#include <pcl/common/transforms.h>

pcl::PointCloud<pcl::PointXYZRGB>::Ptr cloudsWorld(new pcl::PointCloud<pcl::PointXYZRGB>);

Eigen::AngleAxisd zAngleAxis(posRet.theta, Eigen::Vector3d(0, 0, 1));
Eigen::Quaterniond q(zAngleAxis);
Eigen::Isometry3d pose(q);
pose(0, 3) = pos.x_pos; 
pose(1, 3) = pos.y_pos; 
pose(2, 3) = 0;

pcl::transformPointCloud(*clouds, *cloudsWorld, pose.matrix());

method 2

#include <pcl/common/transforms.h>

pcl::PointCloud<pcl::PointXYZRGB>::Ptr cloudsWorld(new pcl::PointCloud<pcl::PointXYZRGB>);

Eigen::Affine3f pose = Eigen::Affine3f::Identity();
pose.translation() << pos.x_pos, pos.y_pos, 0.0;
pose.rotate(Eigen::AngleAxisf(pos.theta, Eigen::Vector3f::UnitZ()));
pcl::transformPointCloud(*clouds, *cloudsWorld, pose);

pcl::Point::Ptr

如果此类的sensor_origin_/orientation被配置,PCLViewer在显示时候会做相应的旋转和平移

相关文章:

  • 2022-12-23
  • 2021-12-10
  • 2021-11-26
  • 2021-11-09
  • 2021-07-07
  • 2021-08-02
  • 2021-08-14
猜你喜欢
  • 2021-07-08
  • 2022-01-04
相关资源
相似解决方案