Das Problem mit der Erreichbarkeit der HS-Koblenz ist behoben. Es können sich wieder alle anmelden.

Commit ef30cafd authored by Patrik Schmidt's avatar Patrik Schmidt 🤖
Browse files

final tutorial files

parent 410a1e10
......@@ -17,29 +17,14 @@ main (int argc, char** argv)
pcl::io::loadPCDFile (RESOURCES_PATH "/table.pcd", *cloud);
pcl::visualization::CloudViewer viewer ("Demo Viewer");
viewer.showCloud(cloud);
while(!viewer.wasStopped()){
}
//TODO: setup statistical outlier removal and filter cloud
pcl::StatisticalOutlierRemoval<pcl::PointXYZ> sor;
sor.setInputCloud (cloud);
sor.setMeanK (50);
sor.setStddevMulThresh (1.0);
sor.filter (*cloud_filtered);
//TODO: write final cloud to cloud_filtered
std::cerr << "Cloud after filtering: " << std::endl;
std::cerr << *cloud_filtered << std::endl;
pcl::PCDWriter writer;
writer.write<pcl::PointXYZ> (RESOURCES_PATH "/table_filtered.pcd", *cloud_filtered, false);
sor.setNegative (true);
sor.filter (*cloud_filtered);
writer.write<pcl::PointXYZ> ("table_scene_lms400_outliers.pcd", *cloud_filtered, false);
pcl::visualization::CloudViewer viewer ("Demo Viewer");
viewer.showCloud(cloud_filtered);
while(!viewer.wasStopped()){
......
......@@ -11,17 +11,13 @@ main (int argc, char** argv)
{
pcl::PointCloud<pcl::PointXYZ>::Ptr cloud (new pcl::PointCloud<pcl::PointXYZ>);
cloud->width = 5;
cloud->height = 1;
cloud->points.resize(cloud->width * cloud->height);
//TODO: set cloud width to 5 and height to 1
//TODO: resize points in cloud to width * height
for(int i = 0; i < cloud->size(); i++)
{
cloud->points[i].x = 1024 * rand() / (RAND_MAX + 1.f);
cloud->points[i].y = 1024 * rand() / (RAND_MAX + 1.f);
cloud->points[i].z = 1024 * rand() / (RAND_MAX + 1.f);
}
pcl::io::savePCDFileASCII(RESOURCES_PATH "/sample_write.pcd", *cloud);
//TODO: iterate of cloud size and fill it with random float values
//TODO: save cloud with ASCII encoding to resource path
return (0);
}
\ No newline at end of file
......@@ -12,20 +12,14 @@ main (int argc, char** argv)
{
pcl::PointCloud<pcl::PointXYZ>::Ptr cloud (new pcl::PointCloud<pcl::PointXYZ>);
pcl::PointCloud<pcl::PointXYZ>::Ptr cloud2 (new pcl::PointCloud<pcl::PointXYZ>);
pcl::PointCloud<pcl::PointXYZ>::Ptr final (new pcl::PointCloud<pcl::PointXYZ>);
pcl::io::loadPCDFile(RESOURCES_PATH "/room_scan1.pcd", *cloud);
pcl::io::loadPCDFile(RESOURCES_PATH "/room_scan2.pcd", *cloud2);
//TODO: declare final point cloud after transformation
//TODO: load room1.pcd and room2.pcd from resources folder into cloud and cloud2
//TODO: setup icp
pcl::IterativeClosestPoint<pcl::PointXYZ, pcl::PointXYZ> icp;
icp.setInputSource(cloud);
icp.setInputTarget(cloud2);
icp.align(*final);
std::cout << "has converged:" << icp.hasConverged() << " score: " <<
icp.getFitnessScore() << std::endl;
std::cout << icp.getFinalTransformation() << std::endl;
pcl::visualization::CloudViewer viewer ("Demo Viewer");
viewer.showCloud(Final);
return (0);
}
\ No newline at end of file
......@@ -7,14 +7,11 @@ int
main (int argc, char** argv)
{
pcl::PointCloud<pcl::PointXYZ>::Ptr cloud (new pcl::PointCloud<pcl::PointXYZ>);
pcl::io::loadPCDFile (RESOURCES_PATH "/room_scan2.pcd", *cloud);
pcl::io::loadPCDFile (RESOURCES_PATH "/room_scan1.pcd", *cloud);
pcl::visualization::CloudViewer viewer ("Demo Viewer");
viewer.showCloud(cloud);
//TODO: instanciate cloud viewer and assign cloud to be shown
while(!viewer.wasStopped()){
}
//TODO: while loop with viewer
return (0);
}
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment