Closed mcmingchang closed 4 months ago
If you are using small_gicp::PointCloud
, you can fill normal values as follows:
auto points = std::make_shared<small_gicp::PointCloud>();
points->resize(1024);
for (int i = 0; i < 1024; i++) {
Eigen::Vector4d& point = points->points[i];
point << 1.0, 0.0, 0.0, 1.0;
Eigen::Vector4d& normal = points->normals[i]
normal << 1.0, 0.0, 0.0, 0.0;
}
In case with pcl::PointCloud<pcl::PointNormal>
:
auto points = pcl::make_shared<pcl::PointCloud<pcl::PointNormal>>();
points->resize(1024);
for(int i=0; i<1024; i++) {
points->at(i).getNormalVector4fMap() << 1.0, 0.0, 0.0, 0.0;
}
thanks
If I have normals, how can I manually add them to the point cloud to avoid duplicate calculations and improve calculation speed?