giacomodabisias / libfreenect2pclgrabber Goto Github PK
View Code? Open in Web Editor NEWa grabber for the kinect2 which returns a registered pcl point cloud
a grabber for the kinect2 which returns a registered pcl point cloud
cmake : was successful; with
CMake Deprecation Warning at CMakeLists.txt:21 (cmake_minimum_required):
Compatibility with CMake < 2.8.12 will be removed from a future version of
CMake.
Update the VERSION argument value or use a ... suffix to tell
CMake that the project does not need compatibility with older versions.
but While make it is throwing errors
make : not successful
[ 25%] Building CXX object CMakeFiles/Kinect2Grabber.dir/test.cpp.o
In file included from /Users/manideepreddytamma/Desktop/IRP/Setup/Data_Capturing/libfreenect2pclgrabber/test.cpp:19:
/Users/manideepreddytamma/Desktop/IRP/Setup/Data_Capturing/libfreenect2pclgrabber/include/k2g.h:343:11: warning: self-comparison always evaluates to false [-Wtautological-compare]
mirror_ != mirror_;
^
/Users/manideepreddytamma/Desktop/IRP/Setup/Data_Capturing/libfreenect2pclgrabber/include/k2g.h:343:11: warning: inequality comparison result unused [-Wunused-comparison]
mirror_ != mirror_;
~~~~~~~~^~~~~~~~~~
/Users/manideepreddytamma/Desktop/IRP/Setup/Data_Capturing/libfreenect2pclgrabber/include/k2g.h:343:11: note: use '|=' to turn this inequality comparison into an or-assignment
mirror_ != mirror_;
^~
|=
/Users/manideepreddytamma/Desktop/IRP/Setup/Data_Capturing/libfreenect2pclgrabber/test.cpp:101:9: error: no viable overloaded '='
cloud = k2g.getCloud();
/usr/local/include/boost/smart_ptr/shared_ptr.hpp:583:18: note: candidate function not viable: no known conversion from 'pcl::PointCloud<pcl::PointXYZRGB>::Ptr' (aka 'shared_ptr<PointCloud<pcl::PointXYZRGB>>') to 'const boost::shared_ptr<pcl::PointCloud<pcl::PointXYZRGB>>' for 1st argument
shared_ptr & operator=( shared_ptr const & r ) BOOST_SP_NOEXCEPT
^
/usr/local/include/boost/smart_ptr/shared_ptr.hpp:592:18: note: candidate template ignored: could not match 'boost::shared_ptr' against 'std::shared_ptr'
shared_ptr & operator=(shared_ptr<Y> const & r) BOOST_SP_NOEXCEPT
^
/usr/local/include/boost/smart_ptr/shared_ptr.hpp:603:18: note: candidate template ignored: could not match 'auto_ptr' against 'shared_ptr'
shared_ptr & operator=( std::auto_ptr<Y> & r )
^
/usr/local/include/boost/smart_ptr/shared_ptr.hpp:612:18: note: candidate template ignored: could not match 'auto_ptr' against 'shared_ptr'
shared_ptr & operator=( std::auto_ptr<Y> && r )
^
/usr/local/include/boost/smart_ptr/shared_ptr.hpp:634:18: note: candidate template ignored: could not match 'unique_ptr' against 'shared_ptr'
shared_ptr & operator=( std::unique_ptr<Y, D> && r )
^
/usr/local/include/boost/smart_ptr/shared_ptr.hpp:643:18: note: candidate template ignored: could not match 'unique_ptr' against 'shared_ptr'
shared_ptr & operator=( boost::movelib::unique_ptr<Y, D> r )
^
/usr/local/include/boost/smart_ptr/shared_ptr.hpp:694:18: note: candidate function not viable: no known conversion from 'pcl::PointCloud<pcl::PointXYZRGB>::Ptr' (aka 'shared_ptr<PointCloud<pcl::PointXYZRGB>>') to 'boost::shared_ptr<pcl::PointCloud<pcl::PointXYZRGB>>' for 1st argument
shared_ptr & operator=( shared_ptr && r ) BOOST_SP_NOEXCEPT
^
/usr/local/include/boost/smart_ptr/shared_ptr.hpp:701:18: note: candidate template ignored: could not match 'boost::shared_ptr' against 'std::shared_ptr'
shared_ptr & operator=( shared_ptr<Y> && r ) BOOST_SP_NOEXCEPT
^
/usr/local/include/boost/smart_ptr/shared_ptr.hpp:719:18: note: candidate function not viable: no known conversion from 'pcl::PointCloud<pcl::PointXYZRGB>::Ptr' (aka 'shared_ptr<PointCloud<pcl::PointXYZRGB>>') to 'boost::detail::sp_nullptr_t' (aka 'nullptr_t') for 1st argument
shared_ptr & operator=( boost::detail::sp_nullptr_t ) BOOST_SP_NOEXCEPT
^
/Users/manideepreddytamma/Desktop/IRP/Setup/Data_Capturing/libfreenect2pclgrabber/test.cpp:112:72: error: no matching constructor for initialization of 'pcl::visualization::PointCloudColorHandlerRGBField<pcl::PointXYZRGB>'
pcl::visualization::PointCloudColorHandlerRGBField<pcl::PointXYZRGB> rgb(cloud);
^ ~~~~~
/usr/local/include/pcl-1.12/pcl/visualization/point_cloud_color_handlers.h:247:11: note: candidate constructor (the implicit copy constructor) not viable: no known conversion from 'boost::shared_ptr<pcl::PointCloud<pcl::PointXYZRGB>>' to 'const pcl::visualization::PointCloudColorHandlerRGBField<pcl::PointXYZRGB>' for 1st argument
class PointCloudColorHandlerRGBField : public PointCloudColorHandler<PointT>
^
/usr/local/include/pcl-1.12/pcl/visualization/point_cloud_color_handlers.h:264:9: note: candidate constructor not viable: no known conversion from 'boost::shared_ptr<pcl::PointCloud<pcl::PointXYZRGB>>' to 'const pcl::visualization::PointCloudColorHandlerRGBField<pcl::PointXYZRGB>::PointCloudConstPtr' (aka 'const shared_ptr<const PointCloud<pcl::PointXYZRGB>>') for 1st argument
PointCloudColorHandlerRGBField (const PointCloudConstPtr &cloud)
^
/usr/local/include/pcl-1.12/pcl/visualization/point_cloud_color_handlers.h:258:9: note: candidate constructor not viable: requires 0 arguments, but 1 was provided
PointCloudColorHandlerRGBField ()
^
/Users/manideepreddytamma/Desktop/IRP/Setup/Data_Capturing/libfreenect2pclgrabber/test.cpp:113:11: error: no matching member function for call to 'addPointCloud'
viewer->addPointCloud<pcl::PointXYZRGB>(cloud, rgb, "sample cloud");
~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/include/pcl-1.12/pcl/visualization/impl/pcl_visualizer.hpp:195:36: note: candidate function template not viable: no known conversion from 'boost::shared_ptr<pcl::PointCloud<pcl::PointXYZRGB>>' to 'const typename pcl::PointCloud<PointXYZRGB>::ConstPtr' (aka 'const shared_ptr<const PointCloud<pcl::PointXYZRGB>>') for 1st argument
pcl::visualization::PCLVisualizer::addPointCloud (
^
/usr/local/include/pcl-1.12/pcl/visualization/impl/pcl_visualizer.hpp:88:36: note: candidate function template not viable: no known conversion from 'boost::shared_ptr<pcl::PointCloud<pcl::PointXYZRGB>>' to 'const typename pcl::PointCloud<PointXYZRGB>::ConstPtr' (aka 'const shared_ptr<const PointCloud<pcl::PointXYZRGB>>') for 1st argument
pcl::visualization::PCLVisualizer::addPointCloud (
^
/usr/local/include/pcl-1.12/pcl/visualization/impl/pcl_visualizer.hpp:131:36: note: candidate function template not viable: no known conversion from 'boost::shared_ptr<pcl::PointCloud<pcl::PointXYZRGB>>' to 'const typename pcl::PointCloud<PointXYZRGB>::ConstPtr' (aka 'const shared_ptr<const PointCloud<pcl::PointXYZRGB>>') for 1st argument
pcl::visualization::PCLVisualizer::addPointCloud (
^
/usr/local/include/pcl-1.12/pcl/visualization/impl/pcl_visualizer.hpp:110:36: note: candidate function template not viable: no known conversion from 'boost::shared_ptr<pcl::PointCloud<pcl::PointXYZRGB>>' to 'const typename pcl::PointCloud<PointXYZRGB>::ConstPtr' (aka 'const shared_ptr<const PointCloud<pcl::PointXYZRGB>>') for 1st argument
pcl::visualization::PCLVisualizer::addPointCloud (
^
/usr/local/include/pcl-1.12/pcl/visualization/impl/pcl_visualizer.hpp:153:36: note: candidate function template not viable: no known conversion from 'boost::shared_ptr<pcl::PointCloud<pcl::PointXYZRGB>>' to 'const typename pcl::PointCloud<PointXYZRGB>::ConstPtr' (aka 'const shared_ptr<const PointCloud<pcl::PointXYZRGB>>') for 1st argument
pcl::visualization::PCLVisualizer::addPointCloud (
^
/usr/local/include/pcl-1.12/pcl/visualization/impl/pcl_visualizer.hpp:77:36: note: candidate function template not viable: no known conversion from 'boost::shared_ptr<pcl::PointCloud<pcl::PointXYZRGB>>' to 'const typename pcl::PointCloud<PointXYZRGB>::ConstPtr' (aka 'const shared_ptr<const PointCloud<pcl::PointXYZRGB>>') for 1st argument
pcl::visualization::PCLVisualizer::addPointCloud (
^
/usr/local/include/pcl-1.12/pcl/visualization/impl/pcl_visualizer.hpp:174:36: note: candidate function template not viable: no known conversion from 'boost::shared_ptr<pcl::PointCloud<pcl::PointXYZRGB>>' to 'const typename pcl::PointCloud<PointXYZRGB>::ConstPtr' (aka 'const shared_ptr<const PointCloud<pcl::PointXYZRGB>>') for 1st argument
pcl::visualization::PCLVisualizer::addPointCloud (
^
/Users/manideepreddytamma/Desktop/IRP/Setup/Data_Capturing/libfreenect2pclgrabber/test.cpp:126:9: error: no matching member function for call to 'get'
k2g.get(color, depth, cloud);
~~~~^~~
/Users/manideepreddytamma/Desktop/IRP/Setup/Data_Capturing/libfreenect2pclgrabber/include/k2g.h:398:7: note: candidate function not viable: no known conversion from 'boost::shared_ptr<pcl::PointCloud<pcl::PointXYZRGB>>' to 'const bool' for 3rd argument
void get(cv::Mat & color_mat, cv::Mat & depth_mat, const bool full_hd = true, const bool remove_points = false){
^
/Users/manideepreddytamma/Desktop/IRP/Setup/Data_Capturing/libfreenect2pclgrabber/include/k2g.h:425:7: note: candidate function not viable: no known conversion from 'boost::shared_ptr<pcl::PointCloud<pcl::PointXYZRGB>>' to 'cv::Mat &' for 3rd argument
void get(cv::Mat & color_mat, cv::Mat & depth_mat, cv::Mat & ir_mat, const bool full_hd = true, const bool remove_points = false){
^
/Users/manideepreddytamma/Desktop/IRP/Setup/Data_Capturing/libfreenect2pclgrabber/include/k2g.h:457:7: note: candidate function not viable: no known conversion from 'boost::shared_ptr<pcl::PointCloud<pcl::PointXYZRGB>>' to 'pcl::PointCloud<pcl::PointXYZRGB>::Ptr' (aka 'shared_ptr<PointCloud<pcl::PointXYZRGB>>') for 3rd argument
void get(cv::Mat & color_mat, cv::Mat & depth_mat, pcl::PointCloud<pcl::PointXYZRGB>::Ptr cloud,
^
/Users/manideepreddytamma/Desktop/IRP/Setup/Data_Capturing/libfreenect2pclgrabber/test.cpp:133:74: error: no matching constructor for initialization of 'pcl::visualization::PointCloudColorHandlerRGBField<pcl::PointXYZRGB>'
pcl::visualization::PointCloudColorHandlerRGBField<pcl::PointXYZRGB> rgb(cloud);
^ ~~~~~
/usr/local/include/pcl-1.12/pcl/visualization/point_cloud_color_handlers.h:247:11: note: candidate constructor (the implicit copy constructor) not viable: no known conversion from 'boost::shared_ptr<pcl::PointCloud<pcl::PointXYZRGB>>' to 'const pcl::visualization::PointCloudColorHandlerRGBField<pcl::PointXYZRGB>' for 1st argument
class PointCloudColorHandlerRGBField : public PointCloudColorHandler<PointT>
^
/usr/local/include/pcl-1.12/pcl/visualization/point_cloud_color_handlers.h:264:9: note: candidate constructor not viable: no known conversion from 'boost::shared_ptr<pcl::PointCloud<pcl::PointXYZRGB>>' to 'const pcl::visualization::PointCloudColorHandlerRGBField<pcl::PointXYZRGB>::PointCloudConstPtr' (aka 'const shared_ptr<const PointCloud<pcl::PointXYZRGB>>') for 1st argument
PointCloudColorHandlerRGBField (const PointCloudConstPtr &cloud)
^
/usr/local/include/pcl-1.12/pcl/visualization/point_cloud_color_handlers.h:258:9: note: candidate constructor not viable: requires 0 arguments, but 1 was provided
PointCloudColorHandlerRGBField ()
^
/Users/manideepreddytamma/Desktop/IRP/Setup/Data_Capturing/libfreenect2pclgrabber/test.cpp:134:13: error: no matching member function for call to 'updatePointCloud'
viewer->updatePointCloud<pcl::PointXYZRGB> (cloud, rgb, "sample cloud");
~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/include/pcl-1.12/pcl/visualization/impl/pcl_visualizer.hpp:1559:36: note: candidate function template not viable: no known conversion from 'boost::shared_ptr<pcl::PointCloud<pcl::PointXYZRGB>>' to 'const typename pcl::PointCloud<PointXYZRGB>::ConstPtr' (aka 'const shared_ptr<const PointCloud<pcl::PointXYZRGB>>') for 1st argument
pcl::visualization::PCLVisualizer::updatePointCloud (const typename pcl::PointCloud<PointT>::ConstPtr &,
^
/usr/local/include/pcl-1.12/pcl/visualization/impl/pcl_visualizer.hpp:1594:36: note: candidate function template not viable: no known conversion from 'boost::shared_ptr<pcl::PointCloud<pcl::PointXYZRGB>>' to 'const typename pcl::PointCloud<PointXYZRGB>::ConstPtr' (aka 'const shared_ptr<const PointCloud<pcl::PointXYZRGB>>') for 1st argument
pcl::visualization::PCLVisualizer::updatePointCloud (const typename pcl::PointCloud<PointT>::ConstPtr &cloud,
^
/usr/local/include/pcl-1.12/pcl/visualization/impl/pcl_visualizer.hpp:1526:36: note: candidate function template not viable: requires at most 2 arguments, but 3 were provided
pcl::visualization::PCLVisualizer::updatePointCloud (const typename pcl::PointCloud<PointT>::ConstPtr &cloud,
^
2 warnings and 6 errors generated.
make[2]: *** [CMakeFiles/Kinect2Grabber.dir/test.cpp.o] Error 1
make[1]: *** [CMakeFiles/Kinect2Grabber.dir/all] Error 2
make: *** [all] Error 2
================================================================================
Hi ,
I've just test the code you provide I', in Ubuntu 18.04 ,I've installed Libfreenect2 , PCL , OpenCv etc
the Exact terminal code I wrote is :
mkdir build
cd build
cmake ..
And here is the complete terminal massage :
-- The CXX compiler identification is GNU 7.3.0
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Checking for module 'eigen3'
-- Found eigen3, version 3.3.4
-- Found eigen: /usr/include/eigen3
-- Looking for C++ include pthread.h
-- Looking for C++ include pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- Boost version: 1.65.1
-- Found the following Boost libraries:
-- system
-- filesystem
-- thread
-- date_time
-- iostreams
-- serialization
-- chrono
-- atomic
-- regex
-- Checking for module 'libopenni'
-- Found libopenni, version 1.5.4.0
-- Found openni: /usr/lib/libOpenNI.so
-- Checking for module 'libopenni2'
-- Found libopenni2, version 2.2.0.3
-- Found OpenNI2: /usr/lib/libOpenNI2.so
-- Could NOT find ensenso (missing: ENSENSO_LIBRARY ENSENSO_INCLUDE_DIR)
** WARNING ** io features related to ensenso will be disabled
-- Could NOT find DAVIDSDK (missing: DAVIDSDK_LIBRARY DAVIDSDK_INCLUDE_DIR)
** WARNING ** io features related to davidSDK will be disabled
-- Could NOT find DSSDK (missing: _DSSDK_LIBRARIES)
** WARNING ** io features related to dssdk will be disabled
** WARNING ** io features related to pcap will be disabled
** WARNING ** io features related to png will be disabled
-- The imported target "vtkRenderingPythonTkWidgets" references the file
"/usr/lib/x86_64-linux-gnu/libvtkRenderingPythonTkWidgets.so"
but this file does not exist. Possible reasons include:
-- The imported target "vtk" references the file
"/usr/bin/vtk"
but this file does not exist. Possible reasons include:
-- Found libusb-1.0: /usr/include
** WARNING ** io features related to libusb-1.0 will be disabled
-- Checking for module 'flann'
-- Found flann, version 1.9.1
-- Found Flann: /usr/lib/x86_64-linux-gnu/libflann_cpp_s.a
-- Could NOT find ensenso (missing: ENSENSO_LIBRARY ENSENSO_INCLUDE_DIR)
** WARNING ** visualization features related to ensenso will be disabled
-- Could NOT find DAVIDSDK (missing: DAVIDSDK_LIBRARY DAVIDSDK_INCLUDE_DIR)
** WARNING ** visualization features related to davidSDK will be disabled
-- Could NOT find DSSDK (missing: _DSSDK_LIBRARIES)
** WARNING ** visualization features related to dssdk will be disabled
-- Could NOT find RSSDK (missing: _RSSDK_LIBRARIES)
** WARNING ** visualization features related to rssdk will be disabled
-- Found qhull: /usr/lib/x86_64-linux-gnu/libqhull.so
-- looking for PCL_COMMON
-- Found PCL_COMMON: /usr/lib/x86_64-linux-gnu/libpcl_common.so
-- looking for PCL_OCTREE
-- Found PCL_OCTREE: /usr/lib/x86_64-linux-gnu/libpcl_octree.so
-- looking for PCL_IO
-- Found PCL_IO: /usr/lib/x86_64-linux-gnu/libpcl_io.so
-- looking for PCL_KDTREE
-- Found PCL_KDTREE: /usr/lib/x86_64-linux-gnu/libpcl_kdtree.so
-- looking for PCL_SEARCH
-- Found PCL_SEARCH: /usr/lib/x86_64-linux-gnu/libpcl_search.so
-- looking for PCL_SAMPLE_CONSENSUS
-- Found PCL_SAMPLE_CONSENSUS: /usr/lib/x86_64-linux-gnu/libpcl_sample_consensus.so
-- looking for PCL_FILTERS
-- Found PCL_FILTERS: /usr/lib/x86_64-linux-gnu/libpcl_filters.so
-- looking for PCL_2D
-- Found PCL_2D: /usr/include/pcl-1.8
-- looking for PCL_GEOMETRY
-- Found PCL_GEOMETRY: /usr/include/pcl-1.8
-- looking for PCL_FEATURES
-- Found PCL_FEATURES: /usr/lib/x86_64-linux-gnu/libpcl_features.so
-- looking for PCL_ML
-- Found PCL_ML: /usr/lib/x86_64-linux-gnu/libpcl_ml.so
-- looking for PCL_SEGMENTATION
-- Found PCL_SEGMENTATION: /usr/lib/x86_64-linux-gnu/libpcl_segmentation.so
-- looking for PCL_VISUALIZATION
-- Found PCL_VISUALIZATION: /usr/lib/x86_64-linux-gnu/libpcl_visualization.so
-- looking for PCL_SURFACE
-- Found PCL_SURFACE: /usr/lib/x86_64-linux-gnu/libpcl_surface.so
-- looking for PCL_REGISTRATION
-- Found PCL_REGISTRATION: /usr/lib/x86_64-linux-gnu/libpcl_registration.so
-- looking for PCL_KEYPOINTS
-- Found PCL_KEYPOINTS: /usr/lib/x86_64-linux-gnu/libpcl_keypoints.so
-- looking for PCL_TRACKING
-- Found PCL_TRACKING: /usr/lib/x86_64-linux-gnu/libpcl_tracking.so
-- looking for PCL_RECOGNITION
-- Found PCL_RECOGNITION: /usr/lib/x86_64-linux-gnu/libpcl_recognition.so
-- looking for PCL_STEREO
-- Found PCL_STEREO: /usr/lib/x86_64-linux-gnu/libpcl_stereo.so
-- looking for PCL_APPS
-- Found PCL_APPS: /usr/lib/x86_64-linux-gnu/libpcl_apps.so
-- looking for PCL_IN_HAND_SCANNER
-- Found PCL_IN_HAND_SCANNER: /usr/include/pcl-1.8
-- looking for PCL_MODELER
-- Found PCL_MODELER: /usr/include/pcl-1.8
-- looking for PCL_POINT_CLOUD_EDITOR
-- Found PCL_POINT_CLOUD_EDITOR: /usr/include/pcl-1.8
-- looking for PCL_OUTOFCORE
-- Found PCL_OUTOFCORE: /usr/lib/x86_64-linux-gnu/libpcl_outofcore.so
-- looking for PCL_PEOPLE
-- Found PCL_PEOPLE: /usr/lib/x86_64-linux-gnu/libpcl_people.so
-- Found PCL: /usr/lib/x86_64-linux-gnu/libboost_system.so;/usr/lib/x86_64-linux-gnu/libboost_filesystem.so;/usr/lib/x86_64-linux-gnu/libboost_thread.so;/usr/lib/x86_64-linux-gnu/libboost_date_time.so;/usr/lib/x86_64-linux-gnu/libboost_iostreams.so;/usr/lib/x86_64-linux-gnu/libboost_serialization.so;/usr/lib/x86_64-linux-gnu/libboost_chrono.so;/usr/lib/x86_64-linux-gnu/libboost_atomic.so;/usr/lib/x86_64-linux-gnu/libboost_regex.so;/usr/lib/x86_64-linux-gnu/libpthread.so;optimized;/usr/lib/x86_64-linux-gnu/libpcl_common.so;debug;/usr/lib/x86_64-linux-gnu/libpcl_common.so;optimized;/usr/lib/x86_64-linux-gnu/libpcl_octree.so;debug;/usr/lib/x86_64-linux-gnu/libpcl_octree.so;/usr/lib/libOpenNI.so;/usr/lib/libOpenNI2.so;vtkChartsCore;vtkCommonColor;vtkCommonDataModel;vtkCommonMath;vtkCommonCore;vtksys;vtkCommonMisc;vtkCommonSystem;vtkCommonTransforms;vtkInfovisCore;vtkFiltersExtraction;vtkCommonExecutionModel;vtkFiltersCore;vtkFiltersGeneral;vtkCommonComputationalGeometry;vtkFiltersStatistics;vtkImagingFourier;vtkImagingCore;vtkalglib;vtkRenderingContext2D;vtkRenderingCore;vtkFiltersGeometry;vtkFiltersSources;vtkRenderingFreeType;/usr/lib/x86_64-linux-gnu/libfreetype.so;/usr/lib/x86_64-linux-gnu/libz.so;vtkftgl;vtkDICOMParser;vtkDomainsChemistry;vtkIOXML;vtkIOGeometry;vtkIOCore;vtkIOXMLParser;/usr/lib/x86_64-linux-gnu/libexpat.so;vtkFiltersAMR;vtkParallelCore;vtkIOLegacy;vtkFiltersFlowPaths;vtkFiltersGeneric;vtkFiltersHybrid;vtkImagingSources;vtkFiltersHyperTree;vtkFiltersImaging;vtkImagingGeneral;vtkFiltersModeling;vtkFiltersParallel;vtkFiltersParallelFlowPaths;vtkParallelMPI;vtkFiltersParallelGeometry;vtkFiltersParallelImaging;vtkFiltersParallelMPI;vtkFiltersParallelStatistics;vtkFiltersProgrammable;vtkFiltersPython;/usr/lib/x86_64-linux-gnu/libpython2.7.so;vtkWrappingPythonCore;vtkWrappingTools;vtkFiltersReebGraph;vtkFiltersSMP;vtkFiltersSelection;vtkFiltersTexture;vtkFiltersVerdict;verdict;vtkGUISupportQt;vtkInteractionStyle;vtkRenderingOpenGL;vtkImagingHybrid;vtkIOImage;vtkmetaio;/usr/lib/x86_64-linux-gnu/libjpeg.so;/usr/lib/x86_64-linux-gnu/libpng.so;/usr/lib/x86_64-linux-gnu/libtiff.so;vtkGUISupportQtOpenGL;vtkGUISupportQtSQL;vtkIOSQL;sqlite3;vtkGUISupportQtWebkit;vtkViewsQt;vtkViewsInfovis;vtkInfovisLayout;vtkInfovisBoostGraphAlgorithms;vtkRenderingLabel;vtkViewsCore;vtkInteractionWidgets;vtkRenderingAnnotation;vtkImagingColor;vtkRenderingVolume;vtkGeovisCore;/usr/lib/x86_64-linux-gnu/libproj.so;vtkIOAMR;/usr/lib/x86_64-linux-gnu/hdf5/openmpi/libhdf5.so;/usr/lib/x86_64-linux-gnu/libsz.so;/usr/lib/x86_64-linux-gnu/libdl.so;/usr/lib/x86_64-linux-gnu/libm.so;/usr/lib/x86_64-linux-gnu/openmpi/lib/libmpi.so;vtkIOEnSight;vtkIOExodus;vtkexoIIc;/usr/lib/x86_64-linux-gnu/libnetcdf_c++.so;/usr/lib/x86_64-linux-gnu/libnetcdf.so;vtkIOExport;vtkRenderingGL2PS;vtkRenderingContextOpenGL;/usr/lib/x86_64-linux-gnu/libgl2ps.so;vtkIOFFMPEG;vtkIOMovie;/usr/lib/x86_64-linux-gnu/libtheoraenc.so;/usr/lib/x86_64-linux-gnu/libtheoradec.so;/usr/lib/x86_64-linux-gnu/libogg.so;vtkIOGDAL;vtkIOGeoJSON;vtkIOImport;vtkIOInfovis;/usr/lib/x86_64-linux-gnu/libxml2.so;vtkIOLSDyna;vtkIOMINC;vtkIOMPIImage;vtkIOMPIParallel;vtkIOParallel;vtkIONetCDF;/usr/lib/x86_64-linux-gnu/libjsoncpp.so;vtkIOMySQL;vtkIOODBC;vtkIOPLY;vtkIOParallelExodus;vtkIOParallelLSDyna;vtkIOParallelNetCDF;vtkIOParallelXML;vtkIOPostgreSQL;vtkIOVPIC;VPIC;vtkIOVideo;vtkIOXdmf2;vtkxdmf2;vtkImagingMath;vtkImagingMorphological;vtkImagingStatistics;vtkImagingStencil;vtkInteractionImage;vtkLocalExample;vtkParallelMPI4Py;vtkPythonInterpreter;vtkRenderingExternal;vtkRenderingFreeTypeFontConfig;vtkRenderingImage;vtkRenderingLIC;vtkRenderingLOD;vtkRenderingMatplotlib;vtkRenderingParallel;vtkRenderingParallelLIC;vtkRenderingQt;vtkRenderingVolumeAMR;vtkRenderingVolumeOpenGL;vtkTestingGenericBridge;vtkTestingIOSQL;vtkTestingRendering;vtkViewsContext2D;vtkViewsGeovis;vtkWrappingJava;optimized;/usr/lib/x86_64-linux-gnu/libpcl_io.so;debug;/usr/lib/x86_64-linux-gnu/libpcl_io.so;optimized;/usr/lib/x86_64-linux-gnu/libflann_cpp_s.a;debug;/usr/lib/x86_64-linux-gnu/libflann_cpp_s.a;optimized;/usr/lib/x86_64-linux-gnu/libpcl_kdtree.so;debug;/usr/lib/x86_64-linux-gnu/libpcl_kdtree.so;optimized;/usr/lib/x86_64-linux-gnu/libpcl_search.so;debug;/usr/lib/x86_64-linux-gnu/libpcl_search.so;optimized;/usr/lib/x86_64-linux-gnu/libpcl_sample_consensus.so;debug;/usr/lib/x86_64-linux-gnu/libpcl_sample_consensus.so;optimized;/usr/lib/x86_64-linux-gnu/libpcl_filters.so;debug;/usr/lib/x86_64-linux-gnu/libpcl_filters.so;optimized;/usr/lib/x86_64-linux-gnu/libpcl_features.so;debug;/usr/lib/x86_64-linux-gnu/libpcl_features.so;optimized;/usr/lib/x86_64-linux-gnu/libpcl_ml.so;debug;/usr/lib/x86_64-linux-gnu/libpcl_ml.so;optimized;/usr/lib/x86_64-linux-gnu/libpcl_segmentation.so;debug;/usr/lib/x86_64-linux-gnu/libpcl_segmentation.so;optimized;/usr/lib/x86_64-linux-gnu/libpcl_visualization.so;debug;/usr/lib/x86_64-linux-gnu/libpcl_visualization.so;optimized;/usr/lib/x86_64-linux-gnu/libqhull.so;debug;/usr/lib/x86_64-linux-gnu/libqhull.so;optimized;/usr/lib/x86_64-linux-gnu/libpcl_surface.so;debug;/usr/lib/x86_64-linux-gnu/libpcl_surface.so;optimized;/usr/lib/x86_64-linux-gnu/libpcl_registration.so;debug;/usr/lib/x86_64-linux-gnu/libpcl_registration.so;optimized;/usr/lib/x86_64-linux-gnu/libpcl_keypoints.so;debug;/usr/lib/x86_64-linux-gnu/libpcl_keypoints.so;optimized;/usr/lib/x86_64-linux-gnu/libpcl_tracking.so;debug;/usr/lib/x86_64-linux-gnu/libpcl_tracking.so;optimized;/usr/lib/x86_64-linux-gnu/libpcl_recognition.so;debug;/usr/lib/x86_64-linux-gnu/libpcl_recognition.so;optimized;/usr/lib/x86_64-linux-gnu/libpcl_stereo.so;debug;/usr/lib/x86_64-linux-gnu/libpcl_stereo.so;optimized;/usr/lib/x86_64-linux-gnu/libpcl_apps.so;debug;/usr/lib/x86_64-linux-gnu/libpcl_apps.so;optimized;/usr/lib/x86_64-linux-gnu/libpcl_outofcore.so;debug;/usr/lib/x86_64-linux-gnu/libpcl_outofcore.so;optimized;/usr/lib/x86_64-linux-gnu/libpcl_people.so;debug;/usr/lib/x86_64-linux-gnu/libpcl_people.so;/usr/lib/x86_64-linux-gnu/libboost_system.so;/usr/lib/x86_64-linux-gnu/libboost_filesystem.so;/usr/lib/x86_64-linux-gnu/libboost_thread.so;/usr/lib/x86_64-linux-gnu/libboost_date_time.so;/usr/lib/x86_64-linux-gnu/libboost_iostreams.so;/usr/lib/x86_64-linux-gnu/libboost_serialization.so;/usr/lib/x86_64-linux-gnu/libboost_chrono.so;/usr/lib/x86_64-linux-gnu/libboost_atomic.so;/usr/lib/x86_64-linux-gnu/libboost_regex.so;/usr/lib/x86_64-linux-gnu/libpthread.so;optimized;/usr/lib/x86_64-linux-gnu/libqhull.so;debug;/usr/lib/x86_64-linux-gnu/libqhull.so;/usr/lib/libOpenNI.so;/usr/lib/libOpenNI2.so;optimized;/usr/lib/x86_64-linux-gnu/libflann_cpp_s.a;debug;/usr/lib/x86_64-linux-gnu/libflann_cpp_s.a;vtkChartsCore;vtkCommonColor;vtkCommonDataModel;vtkCommonMath;vtkCommonCore;vtksys;vtkCommonMisc;vtkCommonSystem;vtkCommonTransforms;vtkInfovisCore;vtkFiltersExtraction;vtkCommonExecutionModel;vtkFiltersCore;vtkFiltersGeneral;vtkCommonComputationalGeometry;vtkFiltersStatistics;vtkImagingFourier;vtkImagingCore;vtkalglib;vtkRenderingContext2D;vtkRenderingCore;vtkFiltersGeometry;vtkFiltersSources;vtkRenderingFreeType;/usr/lib/x86_64-linux-gnu/libfreetype.so;/usr/lib/x86_64-linux-gnu/libz.so;vtkftgl;vtkDICOMParser;vtkDomainsChemistry;vtkIOXML;vtkIOGeometry;vtkIOCore;vtkIOXMLParser;/usr/lib/x86_64-linux-gnu/libexpat.so;vtkFiltersAMR;vtkParallelCore;vtkIOLegacy;vtkFiltersFlowPaths;vtkFiltersGeneric;vtkFiltersHybrid;vtkImagingSources;vtkFiltersHyperTree;vtkFiltersImaging;vtkImagingGeneral;vtkFiltersModeling;vtkFiltersParallel;vtkFiltersParallelFlowPaths;vtkParallelMPI;vtkFiltersParallelGeometry;vtkFiltersParallelImaging;vtkFiltersParallelMPI;vtkFiltersParallelStatistics;vtkFiltersProgrammable;vtkFiltersPython;/usr/lib/x86_64-linux-gnu/libpython2.7.so;vtkWrappingPythonCore;vtkWrappingTools;vtkFiltersReebGraph;vtkFiltersSMP;vtkFiltersSelection;vtkFiltersTexture;vtkFiltersVerdict;verdict;vtkGUISupportQt;vtkInteractionStyle;vtkRenderingOpenGL;vtkImagingHybrid;vtkIOImage;vtkmetaio;/usr/lib/x86_64-linux-gnu/libjpeg.so;/usr/lib/x86_64-linux-gnu/libpng.so;/usr/lib/x86_64-linux-gnu/libtiff.so;vtkGUISupportQtOpenGL;vtkGUISupportQtSQL;vtkIOSQL;sqlite3;vtkGUISupportQtWebkit;vtkViewsQt;vtkViewsInfovis;vtkInfovisLayout;vtkInfovisBoostGraphAlgorithms;vtkRenderingLabel;vtkViewsCore;vtkInteractionWidgets;vtkRenderingAnnotation;vtkImagingColor;vtkRenderingVolume;vtkGeovisCore;/usr/lib/x86_64-linux-gnu/libproj.so;vtkIOAMR;/usr/lib/x86_64-linux-gnu/hdf5/openmpi/libhdf5.so;/usr/lib/x86_64-linux-gnu/libsz.so;/usr/lib/x86_64-linux-gnu/libdl.so;/usr/lib/x86_64-linux-gnu/libm.so;/usr/lib/x86_64-linux-gnu/openmpi/lib/libmpi.so;vtkIOEnSight;vtkIOExodus;vtkexoIIc;/usr/lib/x86_64-linux-gnu/libnetcdf_c++.so;/usr/lib/x86_64-linux-gnu/libnetcdf.so;vtkIOExport;vtkRenderingGL2PS;vtkRenderingContextOpenGL;/usr/lib/x86_64-linux-gnu/libgl2ps.so;vtkIOFFMPEG;vtkIOMovie;/usr/lib/x86_64-linux-gnu/libtheoraenc.so;/usr/lib/x86_64-linux-gnu/libtheoradec.so;/usr/lib/x86_64-linux-gnu/libogg.so;vtkIOGDAL;vtkIOGeoJSON;vtkIOImport;vtkIOInfovis;/usr/lib/x86_64-linux-gnu/libxml2.so;vtkIOLSDyna;vtkIOMINC;vtkIOMPIImage;vtkIOMPIParallel;vtkIOParallel;vtkIONetCDF;/usr/lib/x86_64-linux-gnu/libjsoncpp.so;vtkIOMySQL;vtkIOODBC;vtkIOPLY;vtkIOParallelExodus;vtkIOParallelLSDyna;vtkIOParallelNetCDF;vtkIOParallelXML;vtkIOPostgreSQL;vtkIOVPIC;VPIC;vtkIOVideo;vtkIOXdmf2;vtkxdmf2;vtkImagingMath;vtkImagingMorphological;vtkImagingStatistics;vtkImagingStencil;vtkInteractionImage;vtkLocalExample;vtkParallelMPI4Py;vtkPythonInterpreter;vtkRenderingExternal;vtkRenderingFreeTypeFontConfig;vtkRenderingImage;vtkRenderingLIC;vtkRenderingLOD;vtkRenderingMatplotlib;vtkRenderingParallel;vtkRenderingParallelLIC;vtkRenderingQt;vtkRenderingVolumeAMR;vtkRenderingVolumeOpenGL;vtkTestingGenericBridge;vtkTestingIOSQL;vtkTestingRendering;vtkViewsContext2D;vtkViewsGeovis;vtkWrappingJava
-- Found OpenCV: /usr/local (found version "4.0.0")
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
FREENECT2_INCLUDE_DIRS
used as include directory in directory /home/aligh/Downloads/KinectV2_PCL/libfreenect2pclgrabber-master
used as include directory in directory /home/aligh/Downloads/KinectV2_PCL/libfreenect2pclgrabber-master
used as include directory in directory /home/aligh/Downloads/KinectV2_PCL/libfreenect2pclgrabber-master
used as include directory in directory /home/aligh/Downloads/KinectV2_PCL/libfreenect2pclgrabber-master
FREENECT2_LIBRARY
linked by target "Kinect2Grabber" in directory /home/aligh/Downloads/KinectV2_PCL/libfreenect2pclgrabber-master
linked by target "MultiKinect2Grabber" in directory /home/aligh/Downloads/KinectV2_PCL/libfreenect2pclgrabber-master
-- Configuring incomplete, errors occurred!
See also "/home/aligh/Downloads/KinectV2_PCL/libfreenect2pclgrabber-master/build/CMakeFiles/CMakeOutput.log".
See also "/home/aligh/Downloads/KinectV2_PCL/libfreenect2pclgrabber-master/build/CMakeFiles/CMakeError.log".
I'm trying to modify the test to write out a PLY file:
/*
Copyright 2015, Giacomo Dabisias"
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
@Author
Giacomo. Dabisias, PhD Student
PERCRO, (Laboratory of Perceptual Robotics)
Scuola Superiore Sant'Anna
via Luigi Alamanni 13D, San Giuliano Terme 56010 (PI), Italy
*/
#include "k2g.h"
#include <pcl/visualization/cloud_viewer.h>
#include <chrono>
// extra headers for writing out ply file
#include <pcl/console/print.h>
#include <pcl/console/parse.h>
#include <pcl/console/time.h>
#include <pcl/io/ply_io.h>
#include <pcl/PCLPointCloud2.h>
using namespace pcl;
using namespace pcl::io;
using namespace pcl::console;
template<typename Cloud>
void
saveCloud (const std::string &filename, const Cloud &cloud, bool binary, bool use_camera)
{
TicToc tt;
tt.tic ();
print_highlight ("Saving "); print_value ("%s ", filename.c_str ());
pcl::PLYWriter writer;
writer.write (filename, cloud, Eigen::Vector4f::Zero (), Eigen::Quaternionf::Identity (), binary, use_camera);
print_info ("[done, "); print_value ("%g", tt.toc ()); print_info (" ms : "); print_value ("%d", cloud.width * cloud.height); print_info (" points]\n");
}
int main(int argc, char *argv[])
{
std::cout << "Syntax is: " << argv[0] << " [-processor 0|1|2] [output.ply]\n -processor options 0,1,2 correspond to CPU, OPENCL, and OPENGL respectively\n";
processor freenectprocessor = OPENGL;
std::vector<int> ply_file_indices;
if(argc>1){
int fnpInt;
ply_file_indices = parse_file_extension_argument (argc, argv, ".ply");
parse_argument (argc, argv, "-processor", fnpInt);
freenectprocessor = static_cast<processor>(fnpInt);
}
boost::shared_ptr<pcl::PointCloud<pcl::PointXYZRGB>> cloud;
K2G k2g(freenectprocessor);
std::cout << "getting cloud" << std::endl;
cloud = k2g.getCloud();
cloud->sensor_orientation_.w() = 0.0;
cloud->sensor_orientation_.x() = 1.0;
cloud->sensor_orientation_.y() = 0.0;
cloud->sensor_orientation_.z() = 0.0;
boost::shared_ptr<pcl::visualization::PCLVisualizer> viewer (new pcl::visualization::PCLVisualizer ("3D Viewer"));
viewer->setBackgroundColor (0, 0, 0);
pcl::visualization::PointCloudColorHandlerRGBField<pcl::PointXYZRGB> rgb(cloud);
viewer->addPointCloud<pcl::PointXYZRGB> (cloud, rgb, "sample cloud");
viewer->setPointCloudRenderingProperties (pcl::visualization::PCL_VISUALIZER_POINT_SIZE, 1, "sample cloud");
bool done = false;
while ((!viewer->wasStopped()) && (!done)) {
viewer->spinOnce ();
using namespace std::chrono;
static high_resolution_clock::time_point last;
auto tnow = high_resolution_clock::now();
cloud = k2g.getCloud();
auto tpost = high_resolution_clock::now();
std::cout << "delta " << duration_cast<duration<double>>(tpost-tnow).count()*1000 << std::endl;
pcl::visualization::PointCloudColorHandlerRGBField<pcl::PointXYZRGB> rgb(cloud);
viewer->updatePointCloud<pcl::PointXYZRGB> (cloud, rgb, "sample cloud");
if(ply_file_indices.size() > 0 ){
saveCloud(std::string(argv[ply_file_indices[0]]),*cloud,false,false);
done = true;
}
}
k2g.shutDown();
return 0;
}
I'm getting an error as follows:
± make
Scanning dependencies of target Kinect2Grabber
[ 50%] Building CXX object CMakeFiles/Kinect2Grabber.dir/test.cpp.o
In file included from /Users/athundt/source/git/libfreenect2pclgrabber/test.cpp:19:
/Users/athundt/source/git/libfreenect2pclgrabber/k2g.h:132:33: warning: using integer
absolute value function 'abs' when argument is of floating point type
[-Wabsolute-value]
if(!isnan(depth_value) && !(abs(depth_value) < 0.0001)){
^
/Users/athundt/source/git/libfreenect2pclgrabber/k2g.h:132:33: note: use function
'std::abs' instead
if(!isnan(depth_value) && !(abs(depth_value) < 0.0001)){
^~~
std::abs
/Users/athundt/source/git/libfreenect2pclgrabber/test.cpp:44:10: error: no matching member
function for call to 'write'
writer.write (filename, cloud, Eigen::Vector4f::Zero (), Eigen::Quaternionf::Ide...
~~~~~~~^~~~~
/Users/athundt/source/git/libfreenect2pclgrabber/test.cpp:91:9: note: in instantiation of
function template specialization 'saveCloud<pcl::PointCloud<pcl::PointXYZRGB> >'
requested here
saveCloud(std::string(argv[ply_file_indices[0]]),*cloud,false,false);
^
/usr/local/include/pcl-1.8/pcl/io/ply_io.h:646:7: note: candidate function not viable: no
known conversion from 'const pcl::PointCloud<pcl::PointXYZRGB>' to
'const pcl::PCLPointCloud2' for 2nd argument
write (const std::string &file_name, const pcl::PCLPointCloud2 &cloud,
^
/usr/local/include/pcl-1.8/pcl/io/ply_io.h:669:7: note: candidate function not viable: no
known conversion from 'const pcl::PointCloud<pcl::PointXYZRGB>' to 'const
pcl::PCLPointCloud2::ConstPtr' (aka 'const shared_ptr<const ::pcl::PCLPointCloud2>')
for 2nd argument
write (const std::string &file_name, const pcl::PCLPointCloud2::ConstPtr &cloud,
^
/usr/local/include/pcl-1.8/pcl/io/ply_io.h:687:7: note: candidate function template not
viable: requires at most 4 arguments, but 6 were provided
write (const std::string &file_name,
^
/usr/local/include/pcl-1.8/pcl/io/ply_io.h:624:7: note: candidate function not viable:
requires at most 5 arguments, but 6 were provided
write (const std::string &file_name, const pcl::PCLPointCloud2 &cloud,
^
1 warning and 1 error generated.
make[2]: *** [CMakeFiles/Kinect2Grabber.dir/test.cpp.o] Error 1
make[1]: *** [CMakeFiles/Kinect2Grabber.dir/all] Error 2
make: *** [all] Error 2
In particular I'm not sure how to get the cloud into a format the ply writer will accept. If you perhaps know a little more of PCL I'd appreciate some advice! Once I have it working I'll also send you a pull request for the improved test.
Building CXX object libfreenect2pclgrabber/CMakeFiles/MultiKinect2Grabber.dir/multi_test.cpp.o
/home/pb/catkin_ws_02/src/libfreenect2pclgrabber/test.cpp:19:17: fatal error: k2g.h: No such file or directory
#include "k2g.h"
^
compilation terminated.
/home/pb/catkin_ws_02/src/libfreenect2pclgrabber/multi_test.cpp:19:17: fatal error: k2g.h: No such file or directory
#include "k2g.h"
^
compilation terminated.
make[2]: *** [libfreenect2pclgrabber/CMakeFiles/MultiKinect2Grabber.dir/multi_test.cpp.o] Error 1make[2]: *** [libfreenect2pclgrabber/CMakeFiles/Kinect2Grabber.dir/test.cpp.o] Error 1
make[1]: *** [libfreenect2pclgrabber/CMakeFiles/Kinect2Grabber.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
make[1]: *** [libfreenect2pclgrabber/CMakeFiles/MultiKinect2Grabber.dir/all] Error 2
make: *** [all] Error 2
Invoking "make CMAKE_PREFIX_PATH=/home/pb/freenect2/lib/cmake/freenect2 -j4 -l4" failed
I am having this error while catkin_make. I checked the file - test.cpp but there you have included #include "k2g_ros.h" however
Hi,
Do you plan to use the registration function used in https://github.com/code-iai/iai_kinect2 ? (instead of the one provided in freenect2)
It seems that you tried code-iai/iai_kinect2#21 (comment) maybe this is is another repository?
In others words, did you managed to use iai_kinect2 calibration in your code? as libfreenect2 extrinsics seems to not be compatible (shift_d: 863, shift_m: 52) whereas iai provided extrinsics depthShift(-21.5) and rotation/translation pose
Thanks!
how can i get rid of this error? which thing is causing the error.
hello, when we cmake this code libfreenect2pclgrabber in Cmake, we get this problem:
CMake Error at D:/applications/CMake/share/cmake-3.2/Modules/FindPkgConfig.cmake:548 (message):
None of the required 'glfw3' found
Call Stack (most recent call first):
CMakeLists.txt:10 (pkg_search_module)
What should I do? Can you help me.
I got the following error when trying compile on Ubuntu 15.04:
In file included from /home/user/code/libfreenect2pclgrabber/test.cpp:15:0:
/home/user/code/libfreenect2pclgrabber/Kinect2Grabber.hpp: In constructor ‘Kinect2Grabber::Kinect2Grabber<PointT>::Kinect2Grabber(std::string, std::string, int, const Size&, double)’:
/home/user/code/libfreenect2pclgrabber/Kinect2Grabber.hpp:114:12: warning: there are no arguments to ‘glfwInit’ that depend on a template parameter, so a declaration of ‘glfwInit’ must be available [-fpermissive]
glfwInit();
^
/home/user/code/libfreenect2pclgrabber/Kinect2Grabber.hpp: In constructor ‘Kinect2Grabber::Kinect2Grabber<PointT>::Kinect2Grabber(std::string, std::string, std::string)’:
/home/user/code/libfreenect2pclgrabber/Kinect2Grabber.hpp:140:12: warning: there are no arguments to ‘glfwInit’ that depend on a template parameter, so a declaration of ‘glfwInit’ must be available [-fpermissive]
glfwInit();
^
/home/user/code/libfreenect2pclgrabber/Kinect2Grabber.hpp: In instantiation of ‘Kinect2Grabber::Kinect2Grabber<PointT>::Kinect2Grabber(std::string, std::string, std::string) [with PointT = pcl::PointXYZRGB; std::string = std::basic_string<char>]’:
/home/user/code/libfreenect2pclgrabber/test.cpp:25:174: required from here
/home/user/code/libfreenect2pclgrabber/Kinect2Grabber.hpp:140:12: error: ‘glfwInit’ was not declared in this scope
CMakeFiles/Kinect2Grabber.dir/build.make:57: recipe for target 'CMakeFiles/Kinect2Grabber.dir/test.cpp.o' failed
Any help would be much appreciated.
Am I perhaps using the wrong GLFW library version?
Hey mate,
I'm having issues building k2g with cuda, it doesn't appear able to find libreenect2::CudaPacketPipeline when using 'make'.
[ 50%] Building CXX object CMakeFiles/detector.dir/detector.cpp.o
In file included from /home/grace/Code/cpp/detection/detector.cpp:31:0:
/home/grace/Code/cpp/detection/k2g.h: In constructor ‘K2G::K2G(processor, bool, std::__cxx11::string)’:
/home/grace/Code/cpp/detection/k2g.h:91:46: error: expected type-specifier
dev_ = freenect2_.openDefaultDevice(new *stack trace>*libfreenect2::CudaPacketPipeline());
/home/grace/Code/cpp/detection/k2g.h:93:47: error: expected type-specifier
dev_ = freenect2_.openDevice(serial, new *stack trace>*libfreenect2::CudaPacketPipeline())
Any ideas? I've looked through the libfreenect issues and can't seem to find anything related. Lfn just doesn't seem to agree with 'CudaPacketPipeline'.
Hello
First of all, thank you for sharing your hard work.
I am doing study using multi kinects . By the way, I got a question.
I have succeeded using a single kinect but I have faced problem to set the second kinect.
It wasn't work properly. So I am curious whether multi kinects are possible or not.
And I have one more question.
The values x,y and z which I got using PCL are same as output of Libfreenect2 data ?
Thank you.
When building I get this error:
make
[ 25%] Building CXX object CMakeFiles/MultiKinect2Grabber.dir/multi_test.cpp.o
In file included from /home/alejandro/dev/libfreenect2pclgrabber/multi_test.cpp:19:0:
/home/alejandro/dev/libfreenect2pclgrabber/include/k2g.h: In constructor ‘K2G::K2G(Processor, bool, std::__cxx11::string)’:
/home/alejandro/dev/libfreenect2pclgrabber/include/k2g.h:86:46: error: expected type-specifier
dev_ = freenect2_.openDefaultDevice(new libfreenect2::OpenCLPacketPipeline());
^
/home/alejandro/dev/libfreenect2pclgrabber/include/k2g.h:88:47: error: expected type-specifier
dev_ = freenect2_.openDevice(serial, new libfreenect2::OpenCLPacketPipeline());
^
/home/alejandro/dev/libfreenect2pclgrabber/include/k2g.h:102:46: error: expected type-specifier
dev_ = freenect2_.openDefaultDevice(new libfreenect2::CudaPacketPipeline());
^
/home/alejandro/dev/libfreenect2pclgrabber/include/k2g.h:104:47: error: expected type-specifier
dev_ = freenect2_.openDevice(serial, new libfreenect2::CudaPacketPipeline());
^
CMakeFiles/MultiKinect2Grabber.dir/build.make:62: recipe for target 'CMakeFiles/MultiKinect2Grabber.dir/multi_test.cpp.o' failed
make[2]: *** [CMakeFiles/MultiKinect2Grabber.dir/multi_test.cpp.o] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/MultiKinect2Grabber.dir/all' failed
make[1]: *** [CMakeFiles/MultiKinect2Grabber.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2
Not sure why, I am on the latest versions of libfreenect2 and libfreenect2pclgrabber
hello,
i got an error while cmake ..
in build folder. changed nothing, just git clone. i have successfully installed libfreenect2: protonect and also iai_kinect2 as ros bridge are working fine.
it seems there is trouble with the include dirs and cmake. in other issues you mentioned to sudo make install
libfreenect2. this seems to be bad because this is not the standard installation advise from the github page for libfreenect2.
does find_package(Freenect2 REQUIRED)
fail?
can you please help
greetings
ben@ben-laptop:~/libfreenect2pclgrabber/build$ cmake ..
-- Boost version: 1.54.0
-- Found the following Boost libraries:
-- system
-- filesystem
-- thread
-- date_time
-- iostreams
-- serialization
-- checking for module 'openni-dev'
-- package 'openni-dev' not found
-- checking for module 'openni-dev'
-- package 'openni-dev' not found
-- checking for module 'openni-dev'
-- package 'openni-dev' not found
-- looking for PCL_COMMON
-- looking for PCL_OCTREE
-- looking for PCL_IO
-- looking for PCL_KDTREE
-- looking for PCL_SEARCH
-- looking for PCL_SAMPLE_CONSENSUS
-- looking for PCL_FILTERS
-- looking for PCL_FEATURES
-- looking for PCL_KEYPOINTS
-- looking for PCL_GEOMETRY
-- looking for PCL_SEGMENTATION
-- looking for PCL_VISUALIZATION
-- looking for PCL_OUTOFCORE
-- looking for PCL_REGISTRATION
-- looking for PCL_RECOGNITION
-- looking for PCL_SURFACE
-- looking for PCL_PEOPLE
-- looking for PCL_TRACKING
-- looking for PCL_APPS
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
FREENECT2_INCLUDE_DIRS
used as include directory in directory /home/ben/libfreenect2pclgrabber
used as include directory in directory /home/ben/libfreenect2pclgrabber
FREENECT2_LIBRARY
linked by target "Kinect2Grabber" in directory /home/ben/libfreenect2pclgrabber
linked by target "MultiKinect2Grabber" in directory /home/ben/libfreenect2pclgrabber
-- Configuring incomplete, errors occurred!
See also "/home/ben/libfreenect2pclgrabber/build/CMakeFiles/CMakeOutput.log".
ben@ben-laptop:~/libfreenect2pclgrabber/build$
when i build test.cpp i get this error.... here test.cpp is named as pcl.cpp.
installed libfreenect2 successfully. protonect working also......
please reply. I am stucked with grabber. i shall be thankful to you . Keep in mind that m very new to this ... so please elaborate ur answer...
CMakeFiles/Kinect2Grabber.dir/pcl.cpp.o: In function K2G::updateCloud(boost::shared_ptr<pcl::PointCloud<pcl::PointXYZRGB> >)': pcl.cpp:(.text._ZN3K2G11updateCloudEN5boost10shared_ptrIN3pcl10PointCloudINS2_11PointXYZRGBEEEEE[_ZN3K2G11updateCloudEN5boost10shared_ptrIN3pcl10PointCloudINS2_11PointXYZRGBEEEEE]+0x42): undefined reference to
libfreenect2::SyncMultiFrameListener::waitForNewFrame(std::map<libfreenect2::Frame::Type, libfreenect2::Frame*, std::lesslibfreenect2::Frame::Type, std::allocator<std::pair<libfreenect2::Frame::Type const, libfreenect2::Frame*> > >&)'
pcl.cpp:(.text.ZN3K2G11updateCloudEN5boost10shared_ptrIN3pcl10PointCloudINS2_11PointXYZRGBEEEEE[ZN3K2G11updateCloudEN5boost10shared_ptrIN3pcl10PointCloudINS2_11PointXYZRGBEEEEE]+0x152): undefined reference to libfreenect2::Registration::apply(libfreenect2::Frame const*, libfreenect2::Frame const*, libfreenect2::Frame*, libfreenect2::Frame*, bool, libfreenect2::Frame*, int*) const' pcl.cpp:(.text._ZN3K2G11updateCloudEN5boost10shared_ptrIN3pcl10PointCloudINS2_11PointXYZRGBEEEEE[_ZN3K2G11updateCloudEN5boost10shared_ptrIN3pcl10PointCloudINS2_11PointXYZRGBEEEEE]+0x331): undefined reference to
libfreenect2::SyncMultiFrameListener::release(std::map<libfreenect2::Frame::Type, libfreenect2::Frame*, std::lesslibfreenect2::Frame::Type, std::allocator<std::pair<libfreenect2::Frame::Type const, libfreenect2::Frame*> > >&)'
CMakeFiles/Kinect2Grabber.dir/pcl.cpp.o: In function main': pcl.cpp:(.text.startup+0x5aa): undefined reference to
libfreenect2::SyncMultiFrameListener::waitForNewFrame(std::map<libfreenect2::Frame::Type, libfreenect2::Frame*, std::lesslibfreenect2::Frame::Type, std::allocator<std::pair<libfreenect2::Frame::Type const, libfreenect2::Frame*> > >&)'
pcl.cpp:(.text.startup+0x68d): undefined reference to libfreenect2::Registration::apply(libfreenect2::Frame const*, libfreenect2::Frame const*, libfreenect2::Frame*, libfreenect2::Frame*, bool, libfreenect2::Frame*, int*) const' pcl.cpp:(.text.startup+0xa44): undefined reference to
libfreenect2::Registration::apply(libfreenect2::Frame const, libfreenect2::Frame const, libfreenect2::Frame_, libfreenect2::Frame_, bool, libfreenect2::Frame_, int_) const'
pcl.cpp:(.text.startup+0xc3f): undefined reference to libfreenect2::SyncMultiFrameListener::release(std::map<libfreenect2::Frame::Type, libfreenect2::Frame*, std::less<libfreenect2::Frame::Type>, std::allocator<std::pair<libfreenect2::Frame::Type const, libfreenect2::Frame*> > >&)' CMakeFiles/Kinect2Grabber.dir/pcl.cpp.o: In function
K2G::K2G(Processor, bool, std::string)':
pcl.cpp:(.text._ZN3K2GC2E9ProcessorbSs[_ZN3K2GC5E9ProcessorbSs]+0x2b): undefined reference to libfreenect2::Freenect2::Freenect2(void*)' pcl.cpp:(.text._ZN3K2GC2E9ProcessorbSs[_ZN3K2GC5E9ProcessorbSs]+0x50): undefined reference to
libfreenect2::SyncMultiFrameListener::SyncMultiFrameListener(unsigned int)'
pcl.cpp:(.text._ZN3K2GC2E9ProcessorbSs[ZN3K2GC5E9ProcessorbSs]+0x99): undefined reference to libfreenect2::Frame::Frame(unsigned long, unsigned long, unsigned long, unsigned char*)' pcl.cpp:(.text._ZN3K2GC2E9ProcessorbSs[_ZN3K2GC5E9ProcessorbSs]+0xc2): undefined reference to
libfreenect2::Frame::Frame(unsigned long, unsigned long, unsigned long, unsigned char)'
pcl.cpp:(.text._ZN3K2GC2E9ProcessorbSs[_ZN3K2GC5E9ProcessorbSs]+0xeb): undefined reference to libfreenect2::Frame::Frame(unsigned long, unsigned long, unsigned long, unsigned char_)' pcl.cpp:(.text._ZN3K2GC2E9ProcessorbSs[_ZN3K2GC5E9ProcessorbSs]+0x11e): undefined reference to
libfreenect2::Freenect2::enumerateDevices()'
pcl.cpp:(.text._ZN3K2GC2E9ProcessorbSs[ZN3K2GC5E9ProcessorbSs]+0x173): undefined reference tolibfreenect2::OpenGLPacketPipeline::OpenGLPacketPipeline(void_, bool)' pcl.cpp:(.text._ZN3K2GC2E9ProcessorbSs[_ZN3K2GC5E9ProcessorbSs]+0x181): undefined reference to
libfreenect2::Freenect2::openDevice(std::string const&, libfreenect2::PacketPipeline const)'
pcl.cpp:(.text._ZN3K2GC2E9ProcessorbSs[_ZN3K2GC5E9ProcessorbSs]+0x1a4): undefined reference to libfreenect2::Freenect2::getDefaultDeviceSerialNumber()' pcl.cpp:(.text._ZN3K2GC2E9ProcessorbSs[_ZN3K2GC5E9ProcessorbSs]+0x215): undefined reference to
libfreenect2::CpuPacketPipeline::CpuPacketPipeline()'
pcl.cpp:(.text._ZN3K2GC2E9ProcessorbSs[ZN3K2GC5E9ProcessorbSs]+0x252): undefined reference to libfreenect2::CpuPacketPipeline::CpuPacketPipeline()' pcl.cpp:(.text._ZN3K2GC2E9ProcessorbSs[_ZN3K2GC5E9ProcessorbSs]+0x260): undefined reference to
libfreenect2::Freenect2::openDevice(std::string const&, libfreenect2::PacketPipeline const)'
pcl.cpp:(.text._ZN3K2GC2E9ProcessorbSs[_ZN3K2GC5E9ProcessorbSs]+0x3de): undefined reference to libfreenect2::Registration::Registration(libfreenect2::Freenect2Device::IrCameraParams, libfreenect2::Freenect2Device::ColorCameraParams)' pcl.cpp:(.text._ZN3K2GC2E9ProcessorbSs[_ZN3K2GC5E9ProcessorbSs]+0xcbc): undefined reference to
libfreenect2::CpuPacketPipeline::CpuPacketPipeline()'
pcl.cpp:(.text._ZN3K2GC2E9ProcessorbSs[_ZN3K2GC5E9ProcessorbSs]+0xcc7): undefined reference to libfreenect2::Freenect2::openDefaultDevice(libfreenect2::PacketPipeline const_)' pcl.cpp:(.text._ZN3K2GC2E9ProcessorbSs[_ZN3K2GC5E9ProcessorbSs]+0xce0): undefined reference to
libfreenect2::OpenGLPacketPipeline::OpenGLPacketPipeline(void*, bool)'
pcl.cpp:(.text._ZN3K2GC2E9ProcessorbSs[_ZN3K2GC5E9ProcessorbSs]+0xceb): undefined reference tolibfreenect2::Freenect2::openDefaultDevice(libfreenect2::PacketPipeline const_)' pcl.cpp:(.text._ZN3K2GC2E9ProcessorbSs[_ZN3K2GC5E9ProcessorbSs]+0xd04): undefined reference to
libfreenect2::CpuPacketPipeline::CpuPacketPipeline()'
pcl.cpp:(.text._ZN3K2GC2E9ProcessorbSs[_ZN3K2GC5E9ProcessorbSs]+0xe1f): undefined reference tolibfreenect2::Frame::~Frame()' pcl.cpp:(.text._ZN3K2GC2E9ProcessorbSs[_ZN3K2GC5E9ProcessorbSs]+0xe2c): undefined reference to
libfreenect2::Frame::~Frame()'
pcl.cpp:(.text._ZN3K2GC2E9ProcessorbSs[_ZN3K2GC5E9ProcessorbSs]+0xe39): undefined reference tolibfreenect2::Frame::~Frame()' pcl.cpp:(.text._ZN3K2GC2E9ProcessorbSs[_ZN3K2GC5E9ProcessorbSs]+0xe4e): undefined reference to
libfreenect2::SyncMultiFrameListener::~SyncMultiFrameListener()'
pcl.cpp:(.text._ZN3K2GC2E9ProcessorbSs[_ZN3K2GC5E9ProcessorbSs]+0xe56): undefined reference tolibfreenect2::Freenect2::~Freenect2()' CMakeFiles/Kinect2Grabber.dir/pcl.cpp.o: In function
K2G::~K2G()':
pcl.cpp:(.text._ZN3K2GD2Ev[_ZN3K2GD5Ev]+0x25): undefined reference tolibfreenect2::Frame::~Frame()' pcl.cpp:(.text._ZN3K2GD2Ev[_ZN3K2GD5Ev]+0x31): undefined reference to
libfreenect2::Frame::~Frame()'
pcl.cpp:(.text._ZN3K2GD2Ev[_ZN3K2GD5Ev]+0x3a): undefined reference tolibfreenect2::Frame::~Frame()' pcl.cpp:(.text._ZN3K2GD2Ev[_ZN3K2GD5Ev]+0x50): undefined reference to
libfreenect2::SyncMultiFrameListener::~SyncMultiFrameListener()'
pcl.cpp:(.text._ZN3K2GD2Ev[ZN3K2GD5Ev]+0x58): undefined reference to`libfreenect2::Freenect2::~Freenect2()'
collect2: error: ld returned 1 exit status
make[2]: ** [Kinect2Grabber] Error 1
make[1]: *** [CMakeFiles/Kinect2Grabber.dir/all] Error 2
make: *** [all] Error 2
Hey there,
I'm having a bit of an issue trying to run the test.cpp example usage of this grabber, a display box will attempt to open and immediately close, and I'm getting an error:
[Error] [RgbPacketStreamParser] packetsize or sequence doesn't match!
The full CL trace:
$ ./Kinect2Grabber
Syntax is: ./Kinect2Grabber [-processor 0|1|2] -processor options 0,1,2 correspond to CPU, OPENCL, and OPENGL respectively
[Info] [Freenect2Impl] enumerating devices...
[Info] [Freenect2Impl] 12 usb devices connected
[Info] [Freenect2Impl] found valid Kinect v2 @4:6 with serial 056947440847
[Info] [Freenect2Impl] found 1 devices
creating OpenGL processor
[Info] [Freenect2DeviceImpl] opening...
[Info] [Freenect2DeviceImpl] opened
Processor initaliased
[Info] [Freenect2DeviceImpl] starting...
[Info] [Freenect2DeviceImpl] enabling usb transfer submission...
[Info] [Freenect2DeviceImpl] submitting usb transfers...
[Info] [Freenect2DeviceImpl] started
successfully started.
[Error] [RgbPacketStreamParser] packetsize or sequence doesn't match!
getting cloud
[Info] [DepthPacketStreamParser] 7 packets were lost
Segmentation fault (core dumped)
The same issue occurs irrespectively of which processor I choose.
Any help would be greatly appreciated!
Any chance you might be willing to dual license this with bsd in addition to gpl? I have a bsd licensed project where I think I'd like to use it which isn't gpl compatible.
CMakeFiles/Kinect2Grabber.dir/test.cpp.o: In function `K2G::updateCloud(boost::shared_ptr<pcl::PointCloud<pcl::PointXYZRGB> >)':
test.cpp:(.text._ZN3K2G11updateCloudEN5boost10shared_ptrIN3pcl10PointCloudINS2_11PointXYZRGBEEEEE[_ZN3K2G11updateCloudEN5boost10shared_ptrIN3pcl10PointCloudINS2_11PointXYZRGBEEEEE]+0x42): undefined reference to `libfreenect2::SyncMultiFrameListener::waitForNewFrame(std::map<libfreenect2::Frame::Type, libfreenect2::Frame*, std::less<libfreenect2::Frame::Type>, std::allocator<std::pair<libfreenect2::Frame::Type const, libfreenect2::Frame*> > >&)'
test.cpp:(.text._ZN3K2G11updateCloudEN5boost10shared_ptrIN3pcl10PointCloudINS2_11PointXYZRGBEEEEE[_ZN3K2G11updateCloudEN5boost10shared_ptrIN3pcl10PointCloudINS2_11PointXYZRGBEEEEE]+0x152): undefined reference to `libfreenect2::Registration::apply(libfreenect2::Frame const*, libfreenect2::Frame const*, libfreenect2::Frame*, libfreenect2::Frame*, bool, libfreenect2::Frame*, int*) const'
test.cpp:(.text._ZN3K2G11updateCloudEN5boost10shared_ptrIN3pcl10PointCloudINS2_11PointXYZRGBEEEEE[_ZN3K2G11updateCloudEN5boost10shared_ptrIN3pcl10PointCloudINS2_11PointXYZRGBEEEEE]+0x339): undefined reference to `libfreenect2::SyncMultiFrameListener::release(std::map<libfreenect2::Frame::Type, libfreenect2::Frame*, std::less<libfreenect2::Frame::Type>, std::allocator<std::pair<libfreenect2::Frame::Type const, libfreenect2::Frame*> > >&)'
CMakeFiles/Kinect2Grabber.dir/test.cpp.o: In function `main':
test.cpp:(.text.startup+0xd3a): undefined reference to `libfreenect2::SyncMultiFrameListener::waitForNewFrame(std::map<libfreenect2::Frame::Type, libfreenect2::Frame*, std::less<libfreenect2::Frame::Type>, std::allocator<std::pair<libfreenect2::Frame::Type const, libfreenect2::Frame*> > >&)'
test.cpp:(.text.startup+0xe1d): undefined reference to `libfreenect2::Registration::apply(libfreenect2::Frame const*, libfreenect2::Frame const*, libfreenect2::Frame*, libfreenect2::Frame*, bool, libfreenect2::Frame*, int*) const'
test.cpp:(.text.startup+0x11d4): undefined reference to `libfreenect2::Registration::apply(libfreenect2::Frame const*, libfreenect2::Frame const*, libfreenect2::Frame*, libfreenect2::Frame*, bool, libfreenect2::Frame*, int*) const'
test.cpp:(.text.startup+0x13cf): undefined reference to `libfreenect2::SyncMultiFrameListener::release(std::map<libfreenect2::Frame::Type, libfreenect2::Frame*, std::less<libfreenect2::Frame::Type>, std::allocator<std::pair<libfreenect2::Frame::Type const, libfreenect2::Frame*> > >&)'
CMakeFiles/Kinect2Grabber.dir/test.cpp.o: In function `K2G::K2G(Processor, bool, std::string)':
test.cpp:(.text._ZN3K2GC2E9ProcessorbSs[_ZN3K2GC5E9ProcessorbSs]+0x2b): undefined reference to `libfreenect2::Freenect2::Freenect2(void*)'
test.cpp:(.text._ZN3K2GC2E9ProcessorbSs[_ZN3K2GC5E9ProcessorbSs]+0x50): undefined reference to `libfreenect2::SyncMultiFrameListener::SyncMultiFrameListener(unsigned int)'
test.cpp:(.text._ZN3K2GC2E9ProcessorbSs[_ZN3K2GC5E9ProcessorbSs]+0xa1): undefined reference to `libfreenect2::Frame::Frame(unsigned long, unsigned long, unsigned long, unsigned char*)'
test.cpp:(.text._ZN3K2GC2E9ProcessorbSs[_ZN3K2GC5E9ProcessorbSs]+0xca): undefined reference to `libfreenect2::Frame::Frame(unsigned long, unsigned long, unsigned long, unsigned char*)'
test.cpp:(.text._ZN3K2GC2E9ProcessorbSs[_ZN3K2GC5E9ProcessorbSs]+0xf3): undefined reference to `libfreenect2::Frame::Frame(unsigned long, unsigned long, unsigned long, unsigned char*)'
test.cpp:(.text._ZN3K2GC2E9ProcessorbSs[_ZN3K2GC5E9ProcessorbSs]+0x126): undefined reference to `libfreenect2::Freenect2::enumerateDevices()'
test.cpp:(.text._ZN3K2GC2E9ProcessorbSs[_ZN3K2GC5E9ProcessorbSs]+0x17c): undefined reference to `libfreenect2::OpenGLPacketPipeline::OpenGLPacketPipeline(void*, bool)'
test.cpp:(.text._ZN3K2GC2E9ProcessorbSs[_ZN3K2GC5E9ProcessorbSs]+0x18a): undefined reference to `libfreenect2::Freenect2::openDevice(std::string const&, libfreenect2::PacketPipeline const*)'
test.cpp:(.text._ZN3K2GC2E9ProcessorbSs[_ZN3K2GC5E9ProcessorbSs]+0x1ad): undefined reference to `libfreenect2::Freenect2::getDefaultDeviceSerialNumber()'
test.cpp:(.text._ZN3K2GC2E9ProcessorbSs[_ZN3K2GC5E9ProcessorbSs]+0x21d): undefined reference to `libfreenect2::CpuPacketPipeline::CpuPacketPipeline()'
test.cpp:(.text._ZN3K2GC2E9ProcessorbSs[_ZN3K2GC5E9ProcessorbSs]+0x262): undefined reference to `libfreenect2::CpuPacketPipeline::CpuPacketPipeline()'
test.cpp:(.text._ZN3K2GC2E9ProcessorbSs[_ZN3K2GC5E9ProcessorbSs]+0x270): undefined reference to `libfreenect2::Freenect2::openDevice(std::string const&, libfreenect2::PacketPipeline const*)'
test.cpp:(.text._ZN3K2GC2E9ProcessorbSs[_ZN3K2GC5E9ProcessorbSs]+0x2cd): undefined reference to `libfreenect2::getGlobalLogger()'
test.cpp:(.text._ZN3K2GC2E9ProcessorbSs[_ZN3K2GC5E9ProcessorbSs]+0x3f7): undefined reference to `libfreenect2::Registration::Registration(libfreenect2::Freenect2Device::IrCameraParams, libfreenect2::Freenect2Device::ColorCameraParams)'
test.cpp:(.text._ZN3K2GC2E9ProcessorbSs[_ZN3K2GC5E9ProcessorbSs]+0xcdc): undefined reference to `libfreenect2::CpuPacketPipeline::CpuPacketPipeline()'
test.cpp:(.text._ZN3K2GC2E9ProcessorbSs[_ZN3K2GC5E9ProcessorbSs]+0xce7): undefined reference to `libfreenect2::Freenect2::openDefaultDevice(libfreenect2::PacketPipeline const*)'
test.cpp:(.text._ZN3K2GC2E9ProcessorbSs[_ZN3K2GC5E9ProcessorbSs]+0xd00): undefined reference to `libfreenect2::OpenGLPacketPipeline::OpenGLPacketPipeline(void*, bool)'
test.cpp:(.text._ZN3K2GC2E9ProcessorbSs[_ZN3K2GC5E9ProcessorbSs]+0xd0b): undefined reference to `libfreenect2::Freenect2::openDefaultDevice(libfreenect2::PacketPipeline const*)'
test.cpp:(.text._ZN3K2GC2E9ProcessorbSs[_ZN3K2GC5E9ProcessorbSs]+0xd24): undefined reference to `libfreenect2::CpuPacketPipeline::CpuPacketPipeline()'
test.cpp:(.text._ZN3K2GC2E9ProcessorbSs[_ZN3K2GC5E9ProcessorbSs]+0xe3f): undefined reference to `libfreenect2::Frame::~Frame()'
test.cpp:(.text._ZN3K2GC2E9ProcessorbSs[_ZN3K2GC5E9ProcessorbSs]+0xe4c): undefined reference to `libfreenect2::Frame::~Frame()'
test.cpp:(.text._ZN3K2GC2E9ProcessorbSs[_ZN3K2GC5E9ProcessorbSs]+0xe59): undefined reference to `libfreenect2::Frame::~Frame()'
test.cpp:(.text._ZN3K2GC2E9ProcessorbSs[_ZN3K2GC5E9ProcessorbSs]+0xe6e): undefined reference to `libfreenect2::SyncMultiFrameListener::~SyncMultiFrameListener()'
test.cpp:(.text._ZN3K2GC2E9ProcessorbSs[_ZN3K2GC5E9ProcessorbSs]+0xe76): undefined reference to `libfreenect2::Freenect2::~Freenect2()'
CMakeFiles/Kinect2Grabber.dir/test.cpp.o: In function `K2G::~K2G()':
test.cpp:(.text._ZN3K2GD2Ev[_ZN3K2GD5Ev]+0x25): undefined reference to `libfreenect2::Frame::~Frame()'
test.cpp:(.text._ZN3K2GD2Ev[_ZN3K2GD5Ev]+0x31): undefined reference to `libfreenect2::Frame::~Frame()'
test.cpp:(.text._ZN3K2GD2Ev[_ZN3K2GD5Ev]+0x3a): undefined reference to `libfreenect2::Frame::~Frame()'
test.cpp:(.text._ZN3K2GD2Ev[_ZN3K2GD5Ev]+0x50): undefined reference to `libfreenect2::SyncMultiFrameListener::~SyncMultiFrameListener()'
test.cpp:(.text._ZN3K2GD2Ev[_ZN3K2GD5Ev]+0x58): undefined reference to `libfreenect2::Freenect2::~Freenect2()'
collect2: error: ld returned 1 exit status
make[2]: *** [libfreenect2pclgrabber/Kinect2Grabber] Error 1
make[1]: *** [libfreenect2pclgrabber/CMakeFiles/Kinect2Grabber.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
I created a new workspace and sourced it and cloned the repo and trying to catkin it now. But getting the above error. Do I need to install it in the libfreenect2 folder?
Hi,
Thanks for writing this program, it's very helpful.
When running make, I am getting the following error:
# include <libfreenect2/config.h>```
This is my CMakeLists.txt file:
cmake_minimum_required(VERSION 2.8)
Project (Kinect2Grabber CXX)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=native")
set(CMAKE_BUILD_TYPE Release)
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/modules")
set(FREENECT2_INCLUDE_DIRS "/usr/local/include/libfreenect2/include")
set(FREENECT2_LIBRARY "/usr/local/include/libfreenect2")
option(WITH_OPENCL "adds opencl support for freenect2" OFF)
find_package(OpenCV REQUIRED)
find_package(PCL 1.7 REQUIRED)
find_package(Freenect2 REQUIRED)
link_directories(${PCL_LIBRARY_DIRS})
add_definitions(${PCL_DEFINITIONS})
include_directories(${OpenCV_INCLUDE_DIRS})
include_directories(${PCL_INCLUDE_DIRS})
include_directories(${FREENECT2_INCLUDE_DIRS})
add_executable(Kinect2Grabber test.cpp)
target_link_libraries(Kinect2Grabber ${OpenCV_LIBS} ${FREENECT2_LIBRARY} ${PCL_LIBRARIES})
What should I set my `FREENECT2_LIBRARY` to be?
Thanks
Hi,
I've been following your work on the libfreenect2pclgrabber. Its great work and I'd like to contribute if I can. I have checked out the latest master branch of your code and of libfreenect2 and successfully built both. I can run the single Kinect2Grabber and see the visualizer. When I run the MultiKinect2Grabber, it never gets past the k2g_1.getCloud() line. Instead I see a lot of packets lots.
I am running the multi-kinect grabber using the following
./MultiKinect2Grabber 3 031862135147 13249453374
[Info] [Freenect2Impl] enumerating devices...
[Info] [Freenect2Impl] 15 usb devices connected
[Info] [Freenect2Impl] found valid Kinect v2 @2:7 with serial 031862135147
[Info] [Freenect2Impl] found valid Kinect v2 @2:8 with serial 132494533747
[Info] [Freenect2Impl] found 2 devices
Then I see some more messages ...
creating Cpu processor
libva info: VA-API version 0.38.1
libva info: va_getDriverName() returns -1
libva error: va_getDriverName() failed with unknown libva error,driver_name=(null)
[Error] [VaapiRgbPacketProcessorImpl] vaInitialize(display, &major_ver, &minor_ver): unknown libva error
[Info] [Freenect2DeviceImpl] opening...
[Error] [usb::TransferPool] failed to submit transfer: LIBUSB_ERROR_IO Input/Output Error
[Error] [usb::TransferPool] failed to submit transfer: LIBUSB_ERROR_IO Input/Output Error
[Error] [usb::TransferPool] failed to submit transfer: LIBUSB_ERROR_IO Input/Output Error
[Error] [usb::TransferPool] failed to submit transfer: LIBUSB_ERROR_IO Input/Output Error
[Error] [usb::TransferPool] failed to submit transfer: LIBUSB_ERROR_IO Input/Output Error
[Error] [usb::TransferPool] failed to submit transfer: LIBUSB_ERROR_IO Input/Output Error
[Error] [usb::TransferPool] failed to submit transfer: LIBUSB_ERROR_IO Input/Output Error
[Error] [usb::TransferPool] failed to submit transfer: LIBUSB_ERROR_IO Input/Output Error
[Error] [usb::TransferPool] failed to submit transfer: LIBUSB_ERROR_IO Input/Output Error
[Info] [Freenect2DeviceImpl] transfer pool sizes rgb: 20_16384 ir: 60_8*33792
And then I see that many packets are lost.
[Info] [DepthPacketStreamParser] 30 packets were lost
[Info] [DepthPacketStreamParser] 32 packets were lost
[Info] [DepthPacketStreamParser] 33 packets were lost
[Info] [TurboJpegRgbPacketProcessor] avg. time: 18.1056ms -> ~55.2315Hz
I have modified my usbfs_memory_mb as well.
more /sys/module/usbcore/parameters/usbfs_memory_mb
64
I should also mention I am using Ubuntu 14.04 and a recent build of the master branch of pcl.
Protonect runs fine on my system.
Just wondering if you encountered this and what your solution was?
Thanks!
I want to use it to grab a PointCloud, But I found the RGB image and Depth Image can't register together, Can you help me to resolve this problem?
Hi
I've tried to modify a small part so that it can save as .pcd file, following are my changes:
pcl::PCDWriter writer;
std::chrono::high_resolution_clock::time_point p
=std::chrono::high_resolution_clock::now();
std::string now
=std::to_string((long)std::chrono::duration_caststd::chrono::milliseconds(p.time_since_epoch()).count());
writer.write("cloud_"+now +".pcd", *(s->cloud_), s->binary_);
std::cout << "saved" <<"cloud_"+now+".pcd" <<std::endl;
it also saves the data successfully, but when I use pcl_viewer to
visualize the saved .pcd file, everything is upside down and backward, only the z axis is correctly pointing to the objects.
Any ideas why is that and how can I visualize correctly? thanks in advance
Hi there,
I'm in the process of replacing iai_kinect2 with k2g in our application. I've noticed that the pointcloud created through k2g has a much lower range than what is created by depth_image_proc. I've attempted to step through the code and find a way to increase the maximum depth but I'm totally lost. Do you have any pointers for me?
Cheers
[ 25%] Building CXX object CMakeFiles/MultiKinect2Grabber.dir/multi_test.cpp.o
/home/alvin/libfreenect2pclgrabber/multi_test.cpp: In function ‘int main(int, char**)’:
/home/alvin/libfreenect2pclgrabber/multi_test.cpp:122:28: error: ‘class K2G’ has no member named ‘getCloud’
clouds[i] = kinects[i]->getCloud();
^
/home/alvin/libfreenect2pclgrabber/multi_test.cpp:148:30: error: ‘class K2G’ has no member named ‘updateCloud’
clouds[i] = kinects[i]->updateCloud(clouds[i]);
^
CMakeFiles/MultiKinect2Grabber.dir/build.make:62: recipe for target 'CMakeFiles/MultiKinect2Grabber.dir/multi_test.cpp.o' failed
make[2]: *** [CMakeFiles/MultiKinect2Grabber.dir/multi_test.cpp.o] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/MultiKinect2Grabber.dir/all' failed
make[1]: *** [CMakeFiles/MultiKinect2Grabber.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2
I am building libfreenect2pclgrabber on Odroid XU4 platform (ARM, http://www.hardkernel.com/main/products/prdt_info.php ), running Ubuntu 16.04. Built libfreenect2 without issues, but without OpenGL support, since the board supports only OpenGL ES (but it supports OpenCL). Protonect works in CPU and OpenCL mode, but there is no display, since it needs OpenGL to show the video.
However, when trying to build libfreenect2pclgrabber, the compilation fails:
odroid@odroid:~/libfreenect2pclgrabber/build$ make Scanning dependencies of target MultiKinect2Grabber [ 25%] Building CXX object CMakeFiles/MultiKinect2Grabber.dir/multi_test.cpp.o In file included from /home/odroid/libfreenect2pclgrabber/multi_test.cpp:19:0: /home/odroid/libfreenect2pclgrabber/include/k2g.h: In constructor âK2G::K2G(Processor, bool, std::__cxx11::string)â: /home/odroid/libfreenect2pclgrabber/include/k2g.h:94:47: error: expected type-specifier dev_ = freenect2_.openDefaultDevice (new libfreenect2::OpenGLPacketPipeline ()); ^ /home/odroid/libfreenect2pclgrabber/include/k2g.h:96:48: error: expected type-specifier dev_ = freenect2_.openDevice (serial, new libfreenect2::OpenGLPacketPipeline ()); ^ In file included from /home/odroid/libfreenect2pclgrabber/multi_test.cpp:20:0: /usr/include/pcl-1.7/pcl/visualization/cloud_viewer.h: At global scope: /usr/include/pcl-1.7/pcl/visualization/cloud_viewer.h:202:14: warning: âtemplate<class> class std::auto_ptrâ is deprecated [-Wdeprecated-declarations] std::auto_ptr<CloudViewer_impl> impl_; ^ In file included from /usr/include/c++/5/memory:81:0, from /usr/include/boost/config/no_tr1/memory.hpp:21, from /usr/include/boost/smart_ptr/shared_ptr.hpp:23, from /usr/include/boost/shared_ptr.hpp:17, from /usr/include/pcl-1.7/pcl/PCLHeader.h:10, from /usr/include/pcl-1.7/pcl/point_cloud.h:48, from /home/odroid/libfreenect2pclgrabber/include/k2g.h:29, from /home/odroid/libfreenect2pclgrabber/multi_test.cpp:19: /usr/include/c++/5/bits/unique_ptr.h:49:28: note: declared here template<typename> class auto_ptr; ^ CMakeFiles/MultiKinect2Grabber.dir/build.make:62: recipe for target 'CMakeFiles/MultiKinect2Grabber.dir/multi_test.cpp.o' failed make[2]: *** [CMakeFiles/MultiKinect2Grabber.dir/multi_test.cpp.o] Error 1 CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/MultiKinect2Grabber.dir/all' failed make[1]: *** [CMakeFiles/MultiKinect2Grabber.dir/all] Error 2 Makefile:83: recipe for target 'all' failed make: *** [all] Error 2 odroid@odroid:~/libfreenect2pclgrabber/build$
with the key problem being apparently
/home/odroid/libfreenect2pclgrabber/include/k2g.h:94:47: error: expected type-specifier dev_ = freenect2_.openDefaultDevice (new libfreenect2::OpenGLPacketPipeline ());
Now, since there is no OpenGL, this line is problematic in any case - but I am not sure it is the cause of the problem. I tried to disable OpenGL with ccmake
, but there is no option to do so.
Any suggestions?
Hello!
I am attempting to project a texture onto a mesh which I generated via a PCL + libfreenect2pclgrabber. I have the texture file saved and the non-textured mesh generated. However, I am not sure what projection matrix is appropriate to go from the texture to the mesh.
Perhaps it is as simple as (somehow?) using one of the calibration matricies?
Ultimately I need a 3x3 affine matrix to be passed to the pcl::TextureMapping class. Any pointers would be much appreciated.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.