Cling_PCL
1. 설치
$ sudo apt install zeromq
$ sudo apt instal libzmq3-dev
$ wget https://gist.githubusercontent.com/katopz/8b766a5cb0ca96c816658e9407e83d00/raw/bc93fda1fe2fe5c6f45648ba131596134d92f7dc/setup-zeromq.sh
$ tar xvf cling_2020-03-11_ubuntu18.tar.bz2
$ cd cling_2020-03-11_ubuntu18/share/cling/Jupyter/kernel/
$ pip3 install -e .
$ jupyter-kernelspec install --user cling-cpp17
소스 설치 [스크립트]
2. 테스트
2.1 print
#pragma cling add_library_path("/usr/lib/x86_64-linux-gnu")
#pragma cling load("libboost_system.so")
#pragma cling load("libpcl_io.so")
#pragma cling add_include_path("/usr/include/pcl-1.8")
#pragma cling add_include_path("/usr/include/eigen3")
#pragma cling add_include_path("/usr/include/vtk-6.3")
#include <iostream>
#include <pcl/ModelCoefficients.h>
#include <pcl/io/pcd_io.h>
#include <pcl/point_types.h>
#include <pcl/sample_consensus/method_types.h>
#include <pcl/sample_consensus/model_types.h>
#include <pcl/segmentation/sac_segmentation.h>
#include <pcl/filters/extract_indices.h>
pcl::PointCloud<pcl::PointXYZRGB>::Ptr cloud (new pcl::PointCloud<pcl::PointXYZRGB>);
pcl::io::loadPCDFile<pcl::PointXYZRGB> ("tabletop_passthrough.pcd", *cloud);
std::cerr << "PointCloud before filtering: " << cloud->width * cloud->height << " data points (" << pcl::getFieldsList (*cloud) << ").";
#pragma cling add_library_path("/usr/lib/x86_64-linux-gnu")
#pragma cling load("libpcl_visualization.so")
#pragma cling add_include_path("/usr/include/pcl-1.8")
#pragma cling add_include_path("/usr/include/eigen3")
#pragma cling add_include_path("/usr/include/vtk-6.3")
#include <pcl/visualization/pcl_visualizer.h>
auto viewer = pcl::visualization::PCLVisualizer("test");
viewer.setBackgroundColor(0,0,0);
viewer.addCoordinateSystem(0.5);
viewer.initCameraParameters();
viewer.addSphere(pcl::PointXYZ{1,1,1}, 0.2, 0.3, 0.3, 0.0, "sphere");
viewer.spin();
.?
.I <path>
.include
.L <library | filename.cxx>
.files
.q
.L file.C
.x file.C
.U file.C
.class C
.O0
.! cmd
.@
.printAST
Advices and Gotchas when using cling and jupyter