victorprad / InfiniTAM

A Framework for the Volumetric Integration of Depth Images
http://www.infinitam.org
Other
930 stars 351 forks source link

InfiniTAM not building #26

Closed hs2873 closed 7 years ago

hs2873 commented 8 years ago

Hi,

Case 1:

I am trying to use the Intel real sense camera to run this project. I installed the libuvc library for that. When I run make on the project it gives me an error in LibUVCEngine.cpp shown below:

InfiniTAM/InfiniTAM/Engine/LibUVCEngine.cpp: In function ‘void callback_depth(uvc_framet, void_)’: InfiniTAM/InfiniTAM/Engine/LibUVCEngine.cpp:59:42: error: ‘UVC_FRAME_FORMAT_GRAY16’ was not declared in this scope data->framebuffer_depth->frame_format = UVC_FRAME_FORMATGRAY16; ^ InfiniTAM/InfiniTAM/Engine/LibUVCEngine.cpp: In constructor ‘InfiniTAM::Engine::LibUVCEngine::LibUVCEngine(const char, Vector2i, Vector2i)’: InfiniTAM/InfiniTAM/Engine/LibUVCEngine.cpp:151:50: error: ‘uvc_open2’ was not declared in this scope res = uvc_open2(data->dev, &(data->devhrgb), 0); //Try to open camera 0 (RGB) ^ make[2]: ** [Engine/CMakeFiles/Engine.dir/LibUVCEngine.cpp.o] Error 1 make[1]: * [Engine/CMakeFiles/Engine.dir/all] Error 2 make: * [all] Error 2

Can you please help me resolve this error? I faced the same issue both on OSX and Ubuntu.

Case 2:

I also tried to use the Kinect for running this project. But when I run cmake the flag openni_found is false even though I have installed OpenNI (https://github.com/OpenNI/OpenNI) . I have also installed the libfreenect driver (http://openkinect.org/wiki/Getting_Started) required for OSX and Ubuntu.

In both the cases I am reaching to a dead end. I have installed all the libraries required to compile this project . I would really appreciate any suggestions!!!

olafkaehler commented 8 years ago

For libuvc, make sure you get the branch from Steve McGuire at https://github.com/mcguire-steve/libuvc.git (as mentioned in README). The changes to talk to the RealSense have not been merged into the main branch yet.

For OpenNI, specify OPEN_NI_ROOT when running cmake. I guess we should fix our FindOpenNI2.cmake to look in some default locations (/usr or /usr/local ?) which it apparently does not do at the moment...

hs2873 commented 8 years ago

Hi,

Thanks for the input. I was able to resolve the error for OpenNI by making changes to the FindOpenNI.cmake file. However, I tried to use the libuvc provided by Steve: https://github.com/mcguire-steve/libuvc . I am still getting error when I run make. The error is as follows.

  use of undeclared identifier 'UVC_FRAME_FORMAT_GRAY16'; did you mean
  'UVC_FRAME_FORMAT_GRAY8'?
    data->framebuffer_depth->frame_format = UVC_FRAME_FORMAT_GRAY16;
                                            ^~~~~~~~~~~~~~~~~~~~~~~
                                            UVC_FRAME_FORMAT_GRAY8

/usr/local/include/libuvc/libuvc.h:71:3: note: 'UVC_FRAME_FORMAT_GRAY8' declared here UVC_FRAME_FORMAT_GRAY8, ^ InfiniTAM-master/InfiniTAM/Engine/LibUVCEngine.cpp:151:9: error: use of undeclared identifier 'uvc_open2' res = uvc_open2(data->dev, &(data->devh_rgb), 0); //Try to ... ^ InfiniTAM-master/InfiniTAM/Engine/LibUVCEngine.cpp:161:9: error: use of undeclared identifier 'uvc_open2' res = uvc_open2(data->dev, &(data->devh_d), 1); //Try to op... ^ In file included from InfiniTAM-master/InfiniTAM/Engine/LibUVCEngine.cpp:3: InfiniTAM-master/InfiniTAM/Engine/LibUVCEngine.h:22:9: warning: private field 'colorAvailable' is not used [-Wunused-private-field] bool colorAvailable, depthAvailable; ^ InfiniTAM-master/InfiniTAM/Engine/LibUVCEngine.h:22:25: warning: private field 'depthAvailable' is not used [-Wunused-private-field] bool colorAvailable, depthAvailable; ^ Thanks!!!

olafkaehler commented 8 years ago

I fear that something in your installation of libuvc appears to be broken. The version in the master branch of https://github.com/mcguire-steve/libuvc.git does provide the missing definitions (check the libuvc.h included there). For some reason, your globally installed version of libuvc (/usr/local/include/libuvc/libuvc.h) does not have these extras, and your InfiniTAM is configured to use that version.

Try any combination of the following:

ml-rodriguez commented 8 years ago

Hello, I am also trying to use the Intel real sense camera to run this project and I have had the same problem. I have already tried the above solutions. However, I am still getting error when I run make. The error is as follows:

-- CUDA found: TRUE -- OpenNI found: TRUE -- libuvc found: TRUE -- libpng found: TRUE -- Configuring done -- Generating done -- Build files have been written to: /home/maria/InfiniTAM/build [ 2%] Built target Utils [ 75%] Built target ITMLib [ 77%] Building CXX object Engine/CMakeFiles/Engine.dir/LibUVCEngine.cpp.o /home/maria/InfiniTAM/Engine/LibUVCEngine.cpp: In function ‘void callback_depth(uvc_framet, void_)’: /home/maria/InfiniTAM/Engine/LibUVCEngine.cpp:57:42: error: ‘UVC_FRAME_FORMAT_GRAY16’ was not declared in this scope data->framebuffer_depth->frame_format = UVC_FRAME_FORMATGRAY16; ^ /home/maria/InfiniTAM/Engine/LibUVCEngine.cpp: In constructor ‘InfiniTAM::Engine::LibUVCEngine::LibUVCEngine(const char, Vector2i, Vector2i)’: /home/maria/InfiniTAM/Engine/LibUVCEngine.cpp:225:50: error: ‘uvc_open2’ was not declared in this scope res = uvc_open2(data->dev, &devh_tmp, cameraID); ^ /home/maria/InfiniTAM/Engine/LibUVCEngine.cpp:251:51: error: ‘uvc_open2’ was not declared in this scope res = uvc_open2(data->dev, &(data->devh_rgb), 0); ^ /home/maria/InfiniTAM/Engine/LibUVCEngine.cpp:286:24: error: ‘uvc_get_stream_ctrl_frame_desc’ was not declared in this scope format_rgb.interval); ^ /home/maria/InfiniTAM/Engine/LibUVCEngine.cpp:298:21: error: ‘uvc_get_stream_ctrl_frame_desc’ was not declared in this scope formatd.interval); ^ make[2]: ** [Engine/CMakeFiles/Engine.dir/LibUVCEngine.cpp.o] Error 1 make[1]: * [Engine/CMakeFiles/Engine.dir/all] Error 2 make: * [all] Error 2

I would really appreciate any suggestions. Thanks in advance

olafkaehler commented 8 years ago

As I said earlier, for Intel Realsense support you need at least the libuvc branch of Steve McGuire or, in the very latest version to support both the R200 and F200 cameras, you need the version of libuvc from here: https://github.com/olafkaehler/libuvc

If your distribution installed some other version of libuvc, make sure the correct one is being used when building InfiniTAM

ml-rodriguez commented 8 years ago

I removed globally installed libuvc from /usr/local. After, I have installed (in /usr/local) the version of libuvc from here: https://github.com/olafkaehler/libuvc

I have checked that this last version is being used when building InfiniTAM (libuvc_DIR /usr/local/lib/cmake/libuvc) but I am get the same error

olafkaehler commented 8 years ago

If you look deep inside your build directory into the file Engine/CMakeFiles/Engine.dir/depend.make there should be a line identifying the "libuvc.h" that "LibUVCEngine.cpp" depends on. Can you check, whether this is the file you expect it to be and can you check whether that libuvc.h provides a definition of e.g. the function uvc_open2()?

ml-rodriguez commented 8 years ago

Into the file Engine/CMakeFiles/Engine.dir/depend.make I have found the line: Engine/CMakeFiles/Engine.dir/LibUVCEngine.cpp.o: /usr/local/include/libuvc/libuvc.h

I have compared libuvc.h downloaded with libuvc.h into repository and they are not same. My libuvc.h downloaded provides

uvc_error_t uvc_open( uvc_device_t _dev, uvc_device_handle_t *_devh);

but not uvc_open2(). Can be this the problem?

olafkaehler commented 8 years ago

Yes this is a problem...

Personally, I'd NOT install anything I compile myself into a directory that I myself can not write to without root access. Generally, don't do anything as root. Install libraries in a /home/.../3rdparty/ directory and make sure the things that depend on them (like InfiniTAM) take the right version when they need it. Try to get rid of the libuvc installed in /usr/local, both the libuvc.h and any libuvc.so and libuvc.a files... and maybe the .cmake files as well... unfortunately there is not usually a clean uninstall if you ever do anything as root and bypass the package management system... that's precisely why you shouldn't ever do anything as root, an application of the rule "if you can't undo it, don't do it or live with the consequences"!

(At least that's the way I like to manage dependencies. I keep preaching it to everyone having such problems as described, and I'm always shocked how many people happily just do whatever they want as root and are surprised by the consequences.)

ml-rodriguez commented 8 years ago

Thank you for the advice. I will try to solve this problem and not do anything as root