Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libfreenect2pclgrabber not working #18

Closed
nomi321 opened this issue Aug 2, 2016 · 29 comments
Closed

libfreenect2pclgrabber not working #18

nomi321 opened this issue Aug 2, 2016 · 29 comments

Comments

@nomi321
Copy link

nomi321 commented Aug 2, 2016

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 tolibfreenect2::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 tolibfreenect2::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 tolibfreenect2::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 tolibfreenect2::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 functionK2G::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 tolibfreenect2::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 tolibfreenect2::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 tolibfreenect2::CpuPacketPipeline::CpuPacketPipeline()'
pcl.cpp:(.text._ZN3K2GC2E9ProcessorbSs[ZN3K2GC5E9ProcessorbSs]+0x252): undefined reference to libfreenect2::CpuPacketPipeline::CpuPacketPipeline()' pcl.cpp:(.text._ZN3K2GC2E9ProcessorbSs[_ZN3K2GC5E9ProcessorbSs]+0x260): undefined reference tolibfreenect2::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 tolibfreenect2::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

@giacomodabisias
Copy link
Owner

Hi, why did you change names?
what exactly did you do to build the project?

@nomi321
Copy link
Author

nomi321 commented Aug 2, 2016

thanks for your reply. no solid reason. just was making own project so that's y named it .... i simply copied code from test.cpp and created pcl.cpp and copied code from CMakelist.txt. and then build the project first running Cmake .. and then make and then got the error.

I have attached complete folder. I had installed previously libfreenect2 and freenect2 using this
https://github.com/wiedemeyer/libfreenect2
and successsfully ran Protonect

sensor_interface.tar.gz

@giacomodabisias
Copy link
Owner

ok.
First, did you run sudo make install in the libfreenect2 build folder?

Also pelase download my repo and try to build it with no modification first. Just create a build folder, move into it and run cmake .. and then make

@nomi321
Copy link
Author

nomi321 commented Aug 2, 2016

when i run sudo make install in the libfreenect2 build folder i got this output

noaman@Rime:~/libfreenect2/build$ sudo make install
[ 3%] Built target generate_resources_tool
[ 69%] Built target freenect2
[ 90%] Built target freenect2-openni2
[100%] Built target Protonect
Install the project...
-- Install configuration: "RelWithDebInfo"
-- Up-to-date: /home/noaman/freenect2/lib/libfreenect2.so.0.2.0
-- Up-to-date: /home/noaman/freenect2/lib/libfreenect2.so.0.2
-- Up-to-date: /home/noaman/freenect2/lib/libfreenect2.so
-- Installing: /home/noaman/freenect2/include/libfreenect2
-- Up-to-date: /home/noaman/freenect2/include/libfreenect2/frame_listener_impl.h
-- Up-to-date: /home/noaman/freenect2/include/libfreenect2/registration.h
-- Up-to-date: /home/noaman/freenect2/include/libfreenect2/frame_listener.hpp
-- Up-to-date: /home/noaman/freenect2/include/libfreenect2/libfreenect2.hpp
-- Up-to-date: /home/noaman/freenect2/include/libfreenect2/packet_pipeline.h
-- Up-to-date: /home/noaman/freenect2/include/libfreenect2/logger.h
-- Installing: /home/noaman/freenect2/include/libfreenect2
-- Up-to-date: /home/noaman/freenect2/include/libfreenect2/export.h
-- Up-to-date: /home/noaman/freenect2/include/libfreenect2/config.h
-- Up-to-date: /home/noaman/freenect2/lib/cmake/freenect2/freenect2Config.cmake
-- Up-to-date: /home/noaman/freenect2/lib/pkgconfig/freenect2.pc
-- Up-to-date: /home/noaman/freenect2/lib/OpenNI2/Drivers/libfreenect2-openni2.so.0
-- Up-to-date: /home/noaman/freenect2/lib/OpenNI2/Drivers/libfreenect2-openni2.so

@giacomodabisias
Copy link
Owner

ok good, then continue with the next step

@nomi321
Copy link
Author

nomi321 commented Aug 2, 2016

then after downloading your repo without any modification i simply created build folder and ran cmake.. and i got this

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_LIBRARY
linked by target "Kinect2Grabber" in directory /home/noaman/libfreenect2pclgrabber-master
linked by target "MultiKinect2Grabber" in directory /home/noaman/libfreenect2pclgrabber-master

-- Configuring incomplete, errors occurred!

@nomi321
Copy link
Author

nomi321 commented Aug 2, 2016

thanks for your prompt response ...

@nomi321
Copy link
Author

nomi321 commented Aug 2, 2016

why it is not able to find it? Will i have to add something else in CMakelist.txt ?

@giacomodabisias
Copy link
Owner

You did not install the library in the usual paths but in your own specific path so either you install them in /usr/local/ by setting in the libfreenect cmake file the CMAKE_INSTALL_PREFIX to that path or you edit my cmake option to find the library in your path. In both cases you can do that by using ccmake .. in the build folder. This opens a simple gui to set the variables

@nomi321
Copy link
Author

nomi321 commented Aug 2, 2016

ok i added these two lines
set(FREENECT2_INCLUDE_DIRS "/usr/local/include/libfreenect2/include")
set(FREENECT2_LIBRARY "/usr/local/include/libfreenect2")

and copied libfreenect2 under the same path. now it build with the warning. Is it fine ?

WARNING: Target "Kinect2Grabber" requests linking to directory "/usr/local/lib". Targets may link only to libraries. CMake is dropping the item.
WARNING: Target "MultiKinect2Grabber" requests linking to directory "/usr/local/lib". Targets may link only to libraries. CMake is dropping the item.
-- Generating done
-- Build files have been written to: /home/noaman/libfreenect2pclgrabber-master/build

@giacomodabisias
Copy link
Owner

no don't modify the cmake. Just set the options in the cmake as I told you.
Go in the libfrenect2 build folder and execute ccmake .. and set the CMAKE_INSTALL_PREFIX to /usr/local/ and press c and then e and then g to generate the make file. Then execute sudo make install and you will see that you can compile my grabber

@nomi321
Copy link
Author

nomi321 commented Aug 2, 2016

thanks a lot sir. it is working now. sir it is giving value of delta? may i ask what is this ?
it is showing two windows.

  1. 3D Viewer
  2. Color
    Sir how can i use this info using point cloud library to get point cloud or pcd file.

I shall be very thankful for your guidance.
I am using it for object recognition.

@giacomodabisias
Copy link
Owner

If you look at test.cpp you see how it works. Just include the k2g.h and the other includes in your project.

@nomi321
Copy link
Author

nomi321 commented Aug 2, 2016

so it mean i can use the same test.cpp with point cloud library to extract point cloud and perform the required process or there are some other steps involved too. I am searching but finding not a reasonable procedure. Please elaborate if you know as I am totally new with PCL and Kinect2.

Thanks in advance ...

@giacomodabisias
Copy link
Owner

Hi,

as you can see In the while cycle I grab the cloud and the image frames. You can do the same in your code to get the frames and the PCL point cloud. If you don't understand the test.cpp code I suggest first to look a bit more into C++ programming.

The delta is the time passed between grabbing two clouds and serialization is used if you want to store the cloudson disk. If you read the help in the code you will find everything explained.

@nomi321
Copy link
Author

nomi321 commented Aug 3, 2016

ok sir i will check .. thanks a lot for your precious time ... i will disturb you if i have any issue regarding this ... again thanks a lot

@nomi321
Copy link
Author

nomi321 commented Aug 3, 2016

however i m not finding any help in the code however I am trying to get it ....

@nomi321
Copy link
Author

nomi321 commented Aug 3, 2016

one more thing. it keeps continously running. moreover when i press s to save a cloud then nothing happens. how can i save a cloud and in which format ?

@giacomodabisias
Copy link
Owner

When you press s and have compiled my code with the WITH_SERIALIZATION cmake option, the program starts to store in a file in the same folder as the executable a stream of point clouds. This is just a sequence of pcl points with some metadata at the beginning.

The code is made as example to show how to use the grabber; obviously it just runs forever. Just take from the code what you need and write your own program using the extracted data from the grabber

@nomi321
Copy link
Author

nomi321 commented Aug 3, 2016

ok sir how can I increase the size of the window this 3D viewer. I am making my own project now and I will soon share with you my effort.

thanks in advance.

@nomi321
Copy link
Author

nomi321 commented Aug 3, 2016

plus sir I didn't get this point that "cmake option with the WITH_SERIALIZATION" if you can explain I shall be thankful to you

@giacomodabisias
Copy link
Owner

to change the size of the viewer have a look at the pcl doxygen
documentation.
I would suggest also to study cmake since its quite fundamental. Its a
compilation option to enable the part of code which enables serialization

2016-08-03 10:43 GMT+02:00 nomi321 notifications@github.com:

plus sir I didn't get this point that "cmake option with the
WITH_SERIALIZATION" if you can explain I shall be thankful to you


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#18 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AFm4zE6Fpeu4TPZ-2Wkym-9EcrhiiicJks5qcFSXgaJpZM4JaV29
.

Eng G. Dabisias, PhD Student
Percro Lab, (Laboratory of Perceptual Robotics)
Scuola Superiore Sant'Anna
via Luigi Alamanni 13D, San Giuliano Terme 56010 (PI), Italy
mob.: +39 3480839095
skype: giacomo.dabisias2

@nomi321
Copy link
Author

nomi321 commented Aug 5, 2016

sir can u tell me that how can i save multiple clouds using loops on disk ? this question has nothing to do with the subject but I m just requesting for help

@nomi321
Copy link
Author

nomi321 commented Aug 5, 2016

thanx sir i have done it by myself ...

3 similar comments
@nomi321
Copy link
Author

nomi321 commented Aug 5, 2016

thanx sir i have done it by myself ...

@nomi321
Copy link
Author

nomi321 commented Aug 5, 2016

thanx sir i have done it by myself ...

@nomi321
Copy link
Author

nomi321 commented Aug 5, 2016

thanx sir i have done it by myself ...

@nomi321
Copy link
Author

nomi321 commented Aug 10, 2016

Sir I need little help from you please it will hardly take 5 minutes.

in this tutorial
http://pointclouds.org/documentation/tutorials/vfh_recognition.php

there is function named as loadHist

bool
loadHist (const boost::filesystem::path &path, vfh_model &vfh)

here instead of providing the path of vfh header file on disk, I want to provide the vfh descriptor computed in my programme. how can i do this ? Sir I am stucked in this issue since long and finding no solution.

thanks in advance.

@giacomodabisias
Copy link
Owner

Hi,
these are some really basic steps. please have first a deep look over C++ programming.

Anyway I never used it but iask here http://www.pcl-users.org/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants