Skip to content

Instantly share code, notes, and snippets.

@antimodular
Created March 17, 2016 14:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save antimodular/75abe99baacb3aee0dab to your computer and use it in GitHub Desktop.
Save antimodular/75abe99baacb3aee0dab to your computer and use it in GitHub Desktop.
OF 0.9.x and PCL attempts
#pragma once
//this is ofApp.h
#include "ofMain.h"
//taken from ofxPCL.h file
// file io
#include <pcl/io/pcd_io.h>
// transform
#include <pcl/common/transforms.h>
// thresold
#include <pcl/filters/passthrough.h>
// outlier removal
#include <pcl/filters/statistical_outlier_removal.h>
#include <pcl/filters/radius_outlier_removal.h>
// segmentation
#include <pcl/sample_consensus/model_types.h>
// downsample
#include <pcl/filters/voxel_grid.h>
// segmentation
#include <pcl/ModelCoefficients.h>
#include <pcl/segmentation/sac_segmentation.h>
#include <pcl/sample_consensus/method_types.h>
#include <pcl/filters/extract_indices.h>
// cluster extraction
#include <pcl/sample_consensus/model_types.h>
#include <pcl/segmentation/extract_clusters.h>
// triangulate
#include <pcl/features/normal_3d.h>
#include <pcl/surface/gp3.h>
#include <pcl/surface/grid_projection.h>
#include <pcl/Vertices.h>
// mls
#include <pcl/surface/mls.h>
#include <pcl/io/pcd_io.h>
#include <pcl/surface/organized_fast_mesh.h>
#include <pcl/features/integral_image_normal.h>
//taken from ofxPCL utility.h file
#include <pcl/common/io.h>
//taken from types.h file
#include <pcl/point_cloud.h>
#include <pcl/point_types.h>
//taken from tree.h
// octree
#include <pcl/octree/octree.h>
// kdtree
#include <pcl/search/pcl_search.h>
class ofApp : public ofBaseApp{
public:
void setup();
void update();
void draw();
void keyPressed(int key);
};
@antimodular
Copy link
Author

As suggested i downloaded PCL_1.6.0.dmg for OS X here:
http://www.pointclouds.org/downloads/macosx.html
I ran the included PCL_1.6.0.mpkg installer. Not sure where it got installed.

I did not touch the dependencies listed there for OS X.

But at some point in the past i did go through the homebrew steps listed here but i am not sure where it got installed:
http://www.pointclouds.org/documentation/tutorials/installing_homebrew.php

Then i copy an empty OF project and placed the PCL libs folder i got from https://github.com/satoruhiga/ofxPCL, added a whole bunch of #include xxx.h files that where in the ofxPCL addon header files.

Then edited header and library search paths as shown in this screen shot:
screen shot 2016-03-17 at 10 55 59 am

and then i get a whole bunch of compile errors:
screen shot 2016-03-17 at 10 39 28 am

@antimodular
Copy link
Author

turns out my version of boost was old and dusty.
i went and deleted libs/pcl/include/boost

installed homebrew via http://brew.sh
use homebrew to install boost via terminal command brew install boost

went to /usr/local/Cellar/boost/1.60.0_1/include and copied this new boost folder to where i just deleted the old one -> libs/pcl/include/boost

then recompiled my project in Xcode.

now let's see if i can make use of PCL

@antimodular
Copy link
Author

now i started combining PCL with the OF kinect example, so that i can feed the track object x,y,z mesh in to the ICP function.

i get a bunch of FLANN related compile errors.

screen shot 2016-03-17 at 2 44 30 pm

@antimodular
Copy link
Author

downloaded a fresh / new version of PCL this time it is version 1.7.2 via brew install pcl

went to /usr/local/Cellar/pcl/1.7.2/pcl/1.7.2/lib and copied the content in to my local ofProject/libs/pcl/lib/osx folder. but removed the old stuff before.

then drag all those dylib files in to Xcode

screen shot 2016-03-17 at 4 19 16 pm

adjust the the header search path in project settings:
screen shot 2016-03-17 at 4 22 50 pm

it compiles fine now BUT does not run.

shows this error:
screen shot 2016-03-17 at 4 15 12 pm

@antimodular
Copy link
Author

strange compile error:
dyld: Library not loaded: /usr/local/lib/libvtkDomainsChemistry-6.3.1.dylib
Referenced from: /usr/local/opt/pcl/lib/libpcl_cc_tool_normal_estimation.1.7.dylib
Reason: image not found

which is strange because /usr/local/lib/ already has a lot of vtk stuff in it.
even libvtkDomainsChemistry-7.0.1.dylib and libvtkDomainsChemistry-7.0.dylib
but no 6.3.1

so i tried to remove all vtk stuff by doing
brew uninstall vtk
brew uninstall pcl

and then build pcl as suggested here:
http://www.pointclouds.org/documentation/tutorials/installing_homebrew.php
brew install pcl --without-apps --without-tools --without-vtk --without-qt

now the compile error is a bit different but still looks for libvtkDomainsChemistry-6.3.1.dylib
dyld: Library not loaded: /usr/local/lib/libvtkDomainsChemistry-6.3.1.dylib
Referenced from: /usr/local/opt/pcl/lib/libpcl_io.1.7.dylib
Reason: image not found

@antimodular
Copy link
Author

worked out a stable setup:
https://github.com/antimodular/ofxPCL

@stephanschulz
Copy link

stephanschulz commented Aug 20, 2016

i am in the process to make some changes to a project that uses ofxPCL.
after committing the changes to git and then going back to the old commit i got these errors. _freenect_destroy_registration
had to command-shift k to make a clean build, which solved this
screen shot 2016-08-19 at 8 25 56 pm

@stephanschulz
Copy link

after trying to build a new version that used kinectv2 and ofxpcl i got the following build.
but i forgot to build setting->set to target-> general tab -> linked frameworks and libraries
screen shot 2016-08-20 at 9 42 57 am

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment