code-iai / iai_kinect2

Tools for using the Kinect One (Kinect v2) in ROS
Apache License 2.0
879 stars 519 forks source link

Can't compile Kinect2_Bridge #386

Closed JoshuaSiy closed 7 years ago

JoshuaSiy commented 7 years ago

Hello I can't compile using catkin_make , using "catkin_make -DCMAKE_BUILD_TYPE="Release -Dfreenect2_DIR=path_to_freenect2/lib/cmake/freenect2".

New to ROS, linux and posting issues at github. I hope i don't make any disturbances or making wrong formats.

Things i did: installed rtabmap and rtabmap_ros,

Details that might be helpful: standalone rtabmap works using libfreenect2 driver. Freenect2's ./Protonect cl gl cpu and cuda works I modified cmakelists.txt in rtabmap,rtabmapros, kinect2_bridge, kinect2_calibration, kinect2_viewer, kinect2_registration and cvsba around find_package (OPENCV REQUIRED) to find_package (OPENCV 2.4.11 REQUIRED) libfreenect2 cmake used [ cmake .. -Dfreenect2_DIR=$HOME/freenect2/lib/cmake/freenect2 -DENABLE_CXX11=ON ]

Hardware: Intel i7 Nvidia GeForce 1050 Installed: Cuda , Beignet 1.3.0, Ubuntu 16.04, ros kinetic, nvidia375

Error Produced: (catkin_make at 100% but fails ) /home/nerga/catkin_ws/src/iai_kinect2/kinect2_bridge/src/kinect2_bridge.cpp: In member function ‘bool Kinect2Bridge::initPipeline(const string&, int32_t)’: /home/nerga/catkin_ws/src/iai_kinect2/kinect2_bridge/src/kinect2_bridge.cpp:427:28: error: expected type-specifier packetPipeline = new libfreenect2::OpenCLKdePacketPipeline(device); ^ /home/nerga/catkin_ws/src/iai_kinect2/kinect2_bridge/src/kinect2_bridge.cpp:436:28: error: expected type-specifier packetPipeline = new libfreenect2::CudaKdePacketPipeline(device); ^ /home/nerga/catkin_ws/src/iai_kinect2/kinect2_bridge/src/kinect2_bridge.cpp: In member function ‘bool Kinect2Bridge::initPipeline(const string&, int32_t)’: /home/nerga/catkin_ws/src/iai_kinect2/kinect2_bridge/src/kinect2_bridge.cpp:427:28: error: expected type-specifier packetPipeline = new libfreenect2::OpenCLKdePacketPipeline(device); ^ /home/nerga/catkin_ws/src/iai_kinect2/kinect2_bridge/src/kinect2_bridge.cpp:436:28: error: expected type-specifier packetPipeline = new libfreenect2::CudaKdePacketPipeline(device); ^ iai_kinect2/kinect2_bridge/CMakeFiles/kinect2_bridge_nodelet.dir/build.make:62: recipe for target 'iai_kinect2/kinect2_bridge/CMakeFiles/kinect2_bridge_nodelet.dir/src/kinect2_bridge.cpp.o' failed make[2]: [iai_kinect2/kinect2_bridge/CMakeFiles/kinect2_bridge_nodelet.dir/src/kinect2_bridge.cpp.o] Error 1 CMakeFiles/Makefile2:2296: recipe for target 'iai_kinect2/kinect2_bridge/CMakeFiles/kinect2_bridge_nodelet.dir/all' failed make[1]: [iai_kinect2/kinect2_bridge/CMakeFiles/kinect2_bridge_nodelet.dir/all] Error 2 make[1]: *** Waiting for unfinished jobs....

JoshuaSiy commented 7 years ago

Okay i just reintalled ubuntu again and performed trials with replicated errors it seems like my freenect2 library can't be detected. Tentatively, seems like the only difference this time i i used catkin_make -Dfreenect2_DIR=path_to_freenect2/lib/cmake/freenect2 instead of catkin_make -DCMAKE_BUILD_TYPE="Release" -Dfreenect2_DIR=path_to_freenect2/lib/cmake/freenect2. I'm sorry if i failed to understand the problem or managed to give any proper solutions. iai_kinect2 now managed to compile completely on my side. Just new problems with rtabmap_ros.

aaramirezd commented 7 years ago

@JoshuaSiy I have the same error, but I can't do ubuntu reinstallation, you have any other idea for fix this? I did ROS upgrade and kinect2_bridge didn't work more.