int main (int, char**) { typedef pcl::PointCloud<pcl::PointXYZ> CloudType; CloudType::Ptr cloud (new CloudType); cloud->is_dense = false; CloudType::Ptr output_cloud (new CloudType); CloudType::PointType p_nan; p_nan.x = std::numeric_limits<float>::quiet_NaN(); p_nan.y = std::numeric_limits<float>::quiet_NaN(); p_nan.z = std::numeric_limits<float>::quiet_NaN(); cloud->push_back(p_nan); CloudType::PointType p_valid; p_valid.x = 1.0f; cloud->push_back(p_valid); std::cout << "size: " << cloud->points.size () << std::endl; std::vector<int> indices; pcl::removeNaNFromPointCloud(*cloud, *output_cloud, indices); std::cout << "size: " << output_cloud->points.size () << std::endl; return 0; }
int main (int argc, char** argv) { // Create an organized point cloud CloudType::Ptr cloud (new CloudType); cloud->height = 10; cloud->width = 10; cloud->is_dense = true; cloud->resize(cloud->height * cloud->width); // Make a scan of a square for(unsigned int row = 0; row < cloud->height; ++row) { for(unsigned int col = 0; col < cloud->width; ++col) { PointType p; p.x = col; p.y = row; p.z = 10; (*cloud)(col, row) = p; } } pcl::RangeImageNew range_image; range_image.CreateFromPointCloud(cloud); return 0; }
int main (int argc, char** argv) { typedef pcl::PointXYZRGB PointType; typedef pcl::PointCloud<PointType> CloudType; CloudType::Ptr cloud (new CloudType); CloudType::PointType p; p.x = 1; p.y = 2; p.z = 3; p.r = 5; p.g = 10; p.b = 15; std::cout << p << std::endl; std::cout << p.x << " " << p.y << " " << p.z << " " << static_cast<int>(p.r) << " " << static_cast<int>(p.g) << " " << static_cast<int>(p.b) << std::endl; std::cout << "size: " << cloud->points.size () << std::endl; cloud->push_back(p); return 0; }