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

Commit 6c9b653b authored by Patrik Schmidt's avatar Patrik Schmidt 🤖
Browse files

finishes basic io tutorial

parent 9ee25ddb
/*
* PCL sample for filtering
*/
#include <iostream>
#include <pcl/io/pcd_io.h>
#include <pcl/point_types.h>
......
......@@ -3,6 +3,7 @@ project(pcl_io)
include_directories(${PCL_INCLUDE_DIRS})
link_directories(${PCL_LIBRARY_DIRS})
add_definitions(${PCL_DEFINTIONS})
add_definitions(-DRESOURCES_PATH="${RESOURCES_PATH}")
set(CMAKE_CXX_STANDARD 14)
add_executable(pcl_io main.cpp)
......
/*
* PCL sample for IO
*/
#include <iostream>
#include <pcl/io/pcd_io.h>
#include <pcl/point_types.h>
#include <pcl/visualization/cloud_viewer.h>
int
main (int argc, char** argv)
{
//Filtering
pcl::PointCloud<pcl::PointXYZ>::Ptr cloud (new pcl::PointCloud<pcl::PointXYZ>);
pcl::io::loadPCDFile ("../../room_scan1.pcd", *cloud);
pcl::visualization::CloudViewer viewer ("Demo Viewer");
viewer.showCloud(cloud);
while(!viewer.wasStopped()){
cloud->width = 5;
cloud->height = 1;
cloud->points.resize(cloud->width * cloud->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);
return (0);
}
\ No newline at end of file
......@@ -6,4 +6,4 @@ add_definitions(${PCL_DEFINTIONS})
set(CMAKE_CXX_STANDARD 14)
add_executable(pcl_segmentation main.cpp)
target_link_libraries(pcl_io ${PCL_COMMON_LIBRARIES} ${PCL_IO_LIBRARIES})
target_link_libraries(pcl_segmentation ${PCL_COMMON_LIBRARIES} ${PCL_IO_LIBRARIES})
/*
* PCL sample for segmentation
*/
#include <iostream>
#include <pcl/io/pcd_io.h>
#include <pcl/point_types.h>
......
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