OpenKinect / libfreenect

Drivers and libraries for the Xbox Kinect device on Windows, Linux, and OS X
http://openkinect.org
3.59k stars 1.15k forks source link

Doubt to build OpenNI2-FreenectDriver and OpenNI-Linux-x86-2.2.0.33 #364

Closed lnegrol closed 10 years ago

lnegrol commented 10 years ago

Hi all, First excuse my English. I hope that we can understand.

I saw a few days ago a new version of libfreenect (libfreenect v0.3.0 Nucleus).

I have installed Ubuntu 12.04.03 LTS (32 bits). I want to install:

When I install libfreenect, follow these steps:

sudo apt-get install git-core cmake freeglut3-dev pkg-config build-essential libxmu-dev libxi-dev libusb-1.0-0-dev
cd libfreenect-master
mkdir build
cd build
cmake .. -DBUILD_OPENNI2_DRIVER=ON
make
sudo make install
sudo ldconfig /usr/local/lib64/

My first question is: Is this correct?

My second question is: /usr/local/lib64/ in 32 bits, this directory does not exist. Should I use that directory?

My third question is: I have seen that there is a folder /home/user/Kinect/libfreenect-master/OpenNI2-FreenectDriver/extern/OpenNI-Linux-x64-2.2.0.33/ Should I make any changes? I remind you that I am using 32 bits

My last question is: In this step, Copy the driver to your OpenNI2 driver repository.

Repository="/example/path/to/Samples/Bin/OpenNI2/Drivers/"
cp -L /home/user/Kinect/libfreenect-master/build/lib/OpenNI2-FreenectDriver/libFreenectDriver.so.0.3.0 ${Repository}

"/example/path/to/Samples/Bin/OpenNI2/Drivers/" not exist

I should copy libFreenectDriver.so.0.3.0 in: /home/user/Kinect/OpenNI-Linux-x86-2.2.0.33/Include/Driver/ /home/user/Kinect/OpenNI-Linux-x86-2.2.0.33/Redist/OpenNI2/Drivers/ /home/user/Kinect/OpenNI-Linux-x86-2.2.0.33/Samples/Bin/OpenNI2/Drivers /home/user/Kinect/OpenNI-Linux-x86-2.2.0.33/Tools/OpenNI2/Drivers/

Thank you very much to all. And excuse me. A greeting.

piedar commented 10 years ago
  1. Your compilation steps are correct.
  2. /usr/local/lib should be a symlink to the correct lib folder, so run sudo ldconfig /usr/local/lib.
  3. Don't worry about the OpenNI-Linux-x64 naming - I have included only the headers, which are not platform-specific.
  4. You must copy libFreenectDriver.so to Redist/OpenNI2/Drivers/ if you wish to package it in your redistributable application. If you wish to simply run the OpenNI2 samples, you must copy it to Samples/Bin/OpenNI2/Drivers. Note that OpenNI2 will only load drivers that end with .so.
lnegrol commented 10 years ago

Hello piedar, you've been very kind. Thank you very much for your help.

I have one question. Does this application (libfreenect v0.3.0 Nucleus) contains OpenNI2?

Excuse me if I have done some stupid question.

Thank you very much. A greeting.

piedar commented 10 years ago

libfreenect contains only the header files from OpenNI2. They are necessary to build OpenNI2-FreenectDriver, which implements driver types defined in those headers. To actually get OpenNI2, you must download it or build from source.

lnegrol commented 10 years ago

Hello piedar. Thank you very much for your answer.

When I run "make":

cd libfreenect
mkdir build
cd build
cmake .. -DBUILD_OPENNI2_DRIVER=ON
make

I get this:

[ 93%] Building CXX object OpenNI2-FreenectDriver/CMakeFiles/FreenectDriver.dir/src/DeviceDriver.cpp.o
In file included from /home/jfra/Kinect/libfreenect-master/OpenNI2-FreenectDriver/src/DepthStream.hpp:9:0,
                 from /home/jfra/Kinect/libfreenect-master/OpenNI2-FreenectDriver/src/DeviceDriver.cpp:21:
/home/jfra/Kinect/libfreenect-master/OpenNI2-FreenectDriver/src/VideoStream.hpp: En la función miembro ‘virtual OniStatus FreenectDriver::VideoStream::getProperty(int, void*, int*)’:
/home/jfra/Kinect/libfreenect-master/OpenNI2-FreenectDriver/src/VideoStream.hpp:111:84: aviso: formato ‘%lu’ espera un argumento de tipo ‘long unsigned int’, pero el argumento 3 es de tipo ‘unsigned int’ [-Wformat]
/home/jfra/Kinect/libfreenect-master/OpenNI2-FreenectDriver/src/VideoStream.hpp:119:85: aviso: formato ‘%lu’ espera un argumento de tipo ‘long unsigned int’, pero el argumento 3 es de tipo ‘unsigned int’ [-Wformat]
/home/jfra/Kinect/libfreenect-master/OpenNI2-FreenectDriver/src/VideoStream.hpp:128:79: aviso: formato ‘%lu’ espera un argumento de tipo ‘long unsigned int’, pero el argumento 3 es de tipo ‘unsigned int’ [-Wformat]
/home/jfra/Kinect/libfreenect-master/OpenNI2-FreenectDriver/src/VideoStream.hpp: En la función miembro ‘virtual OniStatus FreenectDriver::VideoStream::setProperty(int, const void*, int)’:
/home/jfra/Kinect/libfreenect-master/OpenNI2-FreenectDriver/src/VideoStream.hpp:154:82: aviso: formato ‘%lu’ espera un argumento de tipo ‘long unsigned int’, pero el argumento 3 es de tipo ‘unsigned int’ [-Wformat]
/home/jfra/Kinect/libfreenect-master/OpenNI2-FreenectDriver/src/VideoStream.hpp:165:81: aviso: formato ‘%lu’ espera un argumento de tipo ‘long unsigned int’, pero el argumento 3 es de tipo ‘unsigned int’ [-Wformat]
/home/jfra/Kinect/libfreenect-master/OpenNI2-FreenectDriver/src/VideoStream.hpp:175:77: aviso: formato ‘%lu’ espera un argumento de tipo ‘long unsigned int’, pero el argumento 3 es de tipo ‘unsigned int’ [-Wformat]
In file included from /home/jfra/Kinect/libfreenect-master/OpenNI2-FreenectDriver/src/DeviceDriver.cpp:21:0:
/home/jfra/Kinect/libfreenect-master/OpenNI2-FreenectDriver/src/DepthStream.hpp: En la función miembro ‘virtual OniStatus FreenectDriver::DepthStream::getProperty(int, void*, int*)’:
/home/jfra/Kinect/libfreenect-master/OpenNI2-FreenectDriver/src/DepthStream.hpp:92:77: aviso: formato ‘%lu’ espera un argumento de tipo ‘long unsigned int’, pero el argumento 3 es de tipo ‘unsigned int’ [-Wformat]
/home/jfra/Kinect/libfreenect-master/OpenNI2-FreenectDriver/src/DepthStream.hpp:99:77: aviso: formato ‘%lu’ espera un argumento de tipo ‘long unsigned int’, pero el argumento 3 es de tipo ‘unsigned int’ [-Wformat]
/home/jfra/Kinect/libfreenect-master/OpenNI2-FreenectDriver/src/DepthStream.hpp:106:75: aviso: formato ‘%lu’ espera un argumento de tipo ‘long unsigned int’, pero el argumento 3 es de tipo ‘unsigned int’ [-Wformat]
/home/jfra/Kinect/libfreenect-master/OpenNI2-FreenectDriver/src/DepthStream.hpp:124:90: aviso: formato ‘%lu’ espera un argumento de tipo ‘long unsigned int’, pero el argumento 3 es de tipo ‘unsigned int’ [-Wformat]
/home/jfra/Kinect/libfreenect-master/OpenNI2-FreenectDriver/src/DepthStream.hpp:131:90: aviso: formato ‘%lu’ espera un argumento de tipo ‘long unsigned int’, pero el argumento 3 es de tipo ‘unsigned int’ [-Wformat]
/home/jfra/Kinect/libfreenect-master/OpenNI2-FreenectDriver/src/DepthStream.hpp:138:90: aviso: formato ‘%lu’ espera un argumento de tipo ‘long unsigned int’, pero el argumento 3 es de tipo ‘unsigned int’ [-Wformat]
/home/jfra/Kinect/libfreenect-master/OpenNI2-FreenectDriver/src/DepthStream.hpp:145:90: aviso: formato ‘%lu’ espera un argumento de tipo ‘long unsigned int’, pero el argumento 3 es de tipo ‘unsigned int’ [-Wformat]
/home/jfra/Kinect/libfreenect-master/OpenNI2-FreenectDriver/src/DepthStream.hpp:152:90: aviso: formato ‘%lu’ espera un argumento de tipo ‘long unsigned int’, pero el argumento 3 es de tipo ‘unsigned int’ [-Wformat]
/home/jfra/Kinect/libfreenect-master/OpenNI2-FreenectDriver/src/DepthStream.hpp:159:90: aviso: formato ‘%lu’ espera un argumento de tipo ‘long unsigned int’, pero el argumento 3 es de tipo ‘unsigned int’ [-Wformat]
/home/jfra/Kinect/libfreenect-master/OpenNI2-FreenectDriver/src/DepthStream.hpp:166:78: aviso: formato ‘%lu’ espera un argumento de tipo ‘long unsigned int’, pero el argumento 3 es de tipo ‘unsigned int’ [-Wformat]
/home/jfra/Kinect/libfreenect-master/OpenNI2-FreenectDriver/src/DepthStream.hpp:173:78: aviso: formato ‘%lu’ espera un argumento de tipo ‘long unsigned int’, pero el argumento 3 es de tipo ‘unsigned int’ [-Wformat]
In file included from /home/jfra/Kinect/libfreenect-master/OpenNI2-FreenectDriver/src/DeviceDriver.cpp:22:0:
/home/jfra/Kinect/libfreenect-master/OpenNI2-FreenectDriver/src/ColorStream.hpp: En la función miembro ‘virtual OniStatus FreenectDriver::ColorStream::getProperty(int, void*, int*)’:
/home/jfra/Kinect/libfreenect-master/OpenNI2-FreenectDriver/src/ColorStream.hpp:66:77: aviso: formato ‘%lu’ espera un argumento de tipo ‘long unsigned int’, pero el argumento 3 es de tipo ‘unsigned int’ [-Wformat]
/home/jfra/Kinect/libfreenect-master/OpenNI2-FreenectDriver/src/ColorStream.hpp:76:77: aviso: formato ‘%lu’ espera un argumento de tipo ‘long unsigned int’, pero el argumento 3 es de tipo ‘unsigned int’ [-Wformat]
/home/jfra/Kinect/libfreenect-master/OpenNI2-FreenectDriver/src/ColorStream.hpp:88:79: aviso: formato ‘%lu’ espera un argumento de tipo ‘long unsigned int’, pero el argumento 3 es de tipo ‘unsigned int’ [-Wformat]
/home/jfra/Kinect/libfreenect-master/OpenNI2-FreenectDriver/src/ColorStream.hpp:98:79: aviso: formato ‘%lu’ espera un argumento de tipo ‘long unsigned int’, pero el argumento 3 es de tipo ‘unsigned int’ [-Wformat]
/home/jfra/Kinect/libfreenect-master/OpenNI2-FreenectDriver/src/ColorStream.hpp: En la función miembro ‘virtual OniStatus FreenectDriver::ColorStream::setProperty(int, const void*, int)’:
/home/jfra/Kinect/libfreenect-master/OpenNI2-FreenectDriver/src/ColorStream.hpp:119:77: aviso: formato ‘%lu’ espera un argumento de tipo ‘long unsigned int’, pero el argumento 3 es de tipo ‘unsigned int’ [-Wformat]
/home/jfra/Kinect/libfreenect-master/OpenNI2-FreenectDriver/src/ColorStream.hpp:130:77: aviso: formato ‘%lu’ espera un argumento de tipo ‘long unsigned int’, pero el argumento 3 es de tipo ‘unsigned int’ [-Wformat]
/home/jfra/Kinect/libfreenect-master/OpenNI2-FreenectDriver/src/DeviceDriver.cpp: En la función miembro ‘virtual OniStatus FreenectDriver::Device::getProperty(int, void*, int*)’:
/home/jfra/Kinect/libfreenect-master/OpenNI2-FreenectDriver/src/DeviceDriver.cpp:129:96: aviso: formato ‘%lu’ espera un argumento de tipo ‘long unsigned int’, pero el argumento 3 es de tipo ‘unsigned int’ [-Wformat]
/home/jfra/Kinect/libfreenect-master/OpenNI2-FreenectDriver/src/DeviceDriver.cpp: En la función miembro ‘virtual OniStatus FreenectDriver::Device::setProperty(int, const void*, int)’:
/home/jfra/Kinect/libfreenect-master/OpenNI2-FreenectDriver/src/DeviceDriver.cpp:166:94: aviso: formato ‘%lu’ espera un argumento de tipo ‘long unsigned int’, pero el argumento 3 es de tipo ‘unsigned int’ [-Wformat]
En el ámbito global:
cc1plus: aviso: no se reconoce la opción de línea de órdenes "-Wno-gnu-static-float-init" [activado por defecto]
[ 96%] Building CXX object OpenNI2-FreenectDriver/CMakeFiles/FreenectDriver.dir/src/ColorStream.cpp.o
In file included from /home/jfra/Kinect/libfreenect-master/OpenNI2-FreenectDriver/src/ColorStream.hpp:7:0,
                 from /home/jfra/Kinect/libfreenect-master/OpenNI2-FreenectDriver/src/ColorStream.cpp:1:
/home/jfra/Kinect/libfreenect-master/OpenNI2-FreenectDriver/src/VideoStream.hpp: En la función miembro ‘virtual OniStatus FreenectDriver::VideoStream::getProperty(int, void*, int*)’:
/home/jfra/Kinect/libfreenect-master/OpenNI2-FreenectDriver/src/VideoStream.hpp:111:84: aviso: formato ‘%lu’ espera un argumento de tipo ‘long unsigned int’, pero el argumento 3 es de tipo ‘unsigned int’ [-Wformat]
/home/jfra/Kinect/libfreenect-master/OpenNI2-FreenectDriver/src/VideoStream.hpp:119:85: aviso: formato ‘%lu’ espera un argumento de tipo ‘long unsigned int’, pero el argumento 3 es de tipo ‘unsigned int’ [-Wformat]
/home/jfra/Kinect/libfreenect-master/OpenNI2-FreenectDriver/src/VideoStream.hpp:128:79: aviso: formato ‘%lu’ espera un argumento de tipo ‘long unsigned int’, pero el argumento 3 es de tipo ‘unsigned int’ [-Wformat]
/home/jfra/Kinect/libfreenect-master/OpenNI2-FreenectDriver/src/VideoStream.hpp: En la función miembro ‘virtual OniStatus FreenectDriver::VideoStream::setProperty(int, const void*, int)’:
/home/jfra/Kinect/libfreenect-master/OpenNI2-FreenectDriver/src/VideoStream.hpp:154:82: aviso: formato ‘%lu’ espera un argumento de tipo ‘long unsigned int’, pero el argumento 3 es de tipo ‘unsigned int’ [-Wformat]
/home/jfra/Kinect/libfreenect-master/OpenNI2-FreenectDriver/src/VideoStream.hpp:165:81: aviso: formato ‘%lu’ espera un argumento de tipo ‘long unsigned int’, pero el argumento 3 es de tipo ‘unsigned int’ [-Wformat]
/home/jfra/Kinect/libfreenect-master/OpenNI2-FreenectDriver/src/VideoStream.hpp:175:77: aviso: formato ‘%lu’ espera un argumento de tipo ‘long unsigned int’, pero el argumento 3 es de tipo ‘unsigned int’ [-Wformat]
In file included from /home/jfra/Kinect/libfreenect-master/OpenNI2-FreenectDriver/src/ColorStream.cpp:1:0:
/home/jfra/Kinect/libfreenect-master/OpenNI2-FreenectDriver/src/ColorStream.hpp: En la función miembro ‘virtual OniStatus FreenectDriver::ColorStream::getProperty(int, void*, int*)’:
/home/jfra/Kinect/libfreenect-master/OpenNI2-FreenectDriver/src/ColorStream.hpp:66:77: aviso: formato ‘%lu’ espera un argumento de tipo ‘long unsigned int’, pero el argumento 3 es de tipo ‘unsigned int’ [-Wformat]
/home/jfra/Kinect/libfreenect-master/OpenNI2-FreenectDriver/src/ColorStream.hpp:76:77: aviso: formato ‘%lu’ espera un argumento de tipo ‘long unsigned int’, pero el argumento 3 es de tipo ‘unsigned int’ [-Wformat]
/home/jfra/Kinect/libfreenect-master/OpenNI2-FreenectDriver/src/ColorStream.hpp:88:79: aviso: formato ‘%lu’ espera un argumento de tipo ‘long unsigned int’, pero el argumento 3 es de tipo ‘unsigned int’ [-Wformat]
/home/jfra/Kinect/libfreenect-master/OpenNI2-FreenectDriver/src/ColorStream.hpp:98:79: aviso: formato ‘%lu’ espera un argumento de tipo ‘long unsigned int’, pero el argumento 3 es de tipo ‘unsigned int’ [-Wformat]
/home/jfra/Kinect/libfreenect-master/OpenNI2-FreenectDriver/src/ColorStream.hpp: En la función miembro ‘virtual OniStatus FreenectDriver::ColorStream::setProperty(int, const void*, int)’:
/home/jfra/Kinect/libfreenect-master/OpenNI2-FreenectDriver/src/ColorStream.hpp:119:77: aviso: formato ‘%lu’ espera un argumento de tipo ‘long unsigned int’, pero el argumento 3 es de tipo ‘unsigned int’ [-Wformat]
/home/jfra/Kinect/libfreenect-master/OpenNI2-FreenectDriver/src/ColorStream.hpp:130:77: aviso: formato ‘%lu’ espera un argumento de tipo ‘long unsigned int’, pero el argumento 3 es de tipo ‘unsigned int’ [-Wformat]
En el ámbito global:
cc1plus: aviso: no se reconoce la opción de línea de órdenes "-Wno-gnu-static-float-init" [activado por defecto]
[100%] Building CXX object OpenNI2-FreenectDriver/CMakeFiles/FreenectDriver.dir/src/DepthStream.cpp.o
In file included from /home/jfra/Kinect/libfreenect-master/OpenNI2-FreenectDriver/src/DepthStream.hpp:9:0,
                 from /home/jfra/Kinect/libfreenect-master/OpenNI2-FreenectDriver/src/DepthStream.cpp:1:
/home/jfra/Kinect/libfreenect-master/OpenNI2-FreenectDriver/src/VideoStream.hpp: En la función miembro ‘virtual OniStatus FreenectDriver::VideoStream::getProperty(int, void*, int*)’:
/home/jfra/Kinect/libfreenect-master/OpenNI2-FreenectDriver/src/VideoStream.hpp:111:84: aviso: formato ‘%lu’ espera un argumento de tipo ‘long unsigned int’, pero el argumento 3 es de tipo ‘unsigned int’ [-Wformat]
/home/jfra/Kinect/libfreenect-master/OpenNI2-FreenectDriver/src/VideoStream.hpp:119:85: aviso: formato ‘%lu’ espera un argumento de tipo ‘long unsigned int’, pero el argumento 3 es de tipo ‘unsigned int’ [-Wformat]
/home/jfra/Kinect/libfreenect-master/OpenNI2-FreenectDriver/src/VideoStream.hpp:128:79: aviso: formato ‘%lu’ espera un argumento de tipo ‘long unsigned int’, pero el argumento 3 es de tipo ‘unsigned int’ [-Wformat]
/home/jfra/Kinect/libfreenect-master/OpenNI2-FreenectDriver/src/VideoStream.hpp: En la función miembro ‘virtual OniStatus FreenectDriver::VideoStream::setProperty(int, const void*, int)’:
/home/jfra/Kinect/libfreenect-master/OpenNI2-FreenectDriver/src/VideoStream.hpp:154:82: aviso: formato ‘%lu’ espera un argumento de tipo ‘long unsigned int’, pero el argumento 3 es de tipo ‘unsigned int’ [-Wformat]
/home/jfra/Kinect/libfreenect-master/OpenNI2-FreenectDriver/src/VideoStream.hpp:165:81: aviso: formato ‘%lu’ espera un argumento de tipo ‘long unsigned int’, pero el argumento 3 es de tipo ‘unsigned int’ [-Wformat]
/home/jfra/Kinect/libfreenect-master/OpenNI2-FreenectDriver/src/VideoStream.hpp:175:77: aviso: formato ‘%lu’ espera un argumento de tipo ‘long unsigned int’, pero el argumento 3 es de tipo ‘unsigned int’ [-Wformat]
In file included from /home/jfra/Kinect/libfreenect-master/OpenNI2-FreenectDriver/src/DepthStream.cpp:1:0:
/home/jfra/Kinect/libfreenect-master/OpenNI2-FreenectDriver/src/DepthStream.hpp: En la función miembro ‘virtual OniStatus FreenectDriver::DepthStream::getProperty(int, void*, int*)’:
/home/jfra/Kinect/libfreenect-master/OpenNI2-FreenectDriver/src/DepthStream.hpp:92:77: aviso: formato ‘%lu’ espera un argumento de tipo ‘long unsigned int’, pero el argumento 3 es de tipo ‘unsigned int’ [-Wformat]
/home/jfra/Kinect/libfreenect-master/OpenNI2-FreenectDriver/src/DepthStream.hpp:99:77: aviso: formato ‘%lu’ espera un argumento de tipo ‘long unsigned int’, pero el argumento 3 es de tipo ‘unsigned int’ [-Wformat]
/home/jfra/Kinect/libfreenect-master/OpenNI2-FreenectDriver/src/DepthStream.hpp:106:75: aviso: formato ‘%lu’ espera un argumento de tipo ‘long unsigned int’, pero el argumento 3 es de tipo ‘unsigned int’ [-Wformat]
/home/jfra/Kinect/libfreenect-master/OpenNI2-FreenectDriver/src/DepthStream.hpp:124:90: aviso: formato ‘%lu’ espera un argumento de tipo ‘long unsigned int’, pero el argumento 3 es de tipo ‘unsigned int’ [-Wformat]
/home/jfra/Kinect/libfreenect-master/OpenNI2-FreenectDriver/src/DepthStream.hpp:131:90: aviso: formato ‘%lu’ espera un argumento de tipo ‘long unsigned int’, pero el argumento 3 es de tipo ‘unsigned int’ [-Wformat]
/home/jfra/Kinect/libfreenect-master/OpenNI2-FreenectDriver/src/DepthStream.hpp:138:90: aviso: formato ‘%lu’ espera un argumento de tipo ‘long unsigned int’, pero el argumento 3 es de tipo ‘unsigned int’ [-Wformat]
/home/jfra/Kinect/libfreenect-master/OpenNI2-FreenectDriver/src/DepthStream.hpp:145:90: aviso: formato ‘%lu’ espera un argumento de tipo ‘long unsigned int’, pero el argumento 3 es de tipo ‘unsigned int’ [-Wformat]
/home/jfra/Kinect/libfreenect-master/OpenNI2-FreenectDriver/src/DepthStream.hpp:152:90: aviso: formato ‘%lu’ espera un argumento de tipo ‘long unsigned int’, pero el argumento 3 es de tipo ‘unsigned int’ [-Wformat]
/home/jfra/Kinect/libfreenect-master/OpenNI2-FreenectDriver/src/DepthStream.hpp:159:90: aviso: formato ‘%lu’ espera un argumento de tipo ‘long unsigned int’, pero el argumento 3 es de tipo ‘unsigned int’ [-Wformat]
/home/jfra/Kinect/libfreenect-master/OpenNI2-FreenectDriver/src/DepthStream.hpp:166:78: aviso: formato ‘%lu’ espera un argumento de tipo ‘long unsigned int’, pero el argumento 3 es de tipo ‘unsigned int’ [-Wformat]
/home/jfra/Kinect/libfreenect-master/OpenNI2-FreenectDriver/src/DepthStream.hpp:173:78: aviso: formato ‘%lu’ espera un argumento de tipo ‘long unsigned int’, pero el argumento 3 es de tipo ‘unsigned int’ [-Wformat]
En el ámbito global:
cc1plus: aviso: no se reconoce la opción de línea de órdenes "-Wno-gnu-static-float-init" [activado por defecto]
Linking CXX shared library ../lib/OpenNI2-FreenectDriver/libFreenectDriver.so
[100%] Built target FreenectDriver

Is this normal?

Thank you very much. A greeting.

piedar commented 10 years ago

Those warnings indicate that printf format specifiers are wrong. This may be because you have 32 bits and I have 64. The warnings will not cause any problems, but I will see if I can switch to cout to avoid them.

lnegrol commented 10 years ago

Hello piedar. Thank you very much for your answer. I modified all the files in the path /libfreenect-master/OpenNI2-FreenectDriver/src/.

I changed printf to cout. For example:

printf("Unexpected size: %d != %lu\n", *pDataSize, sizeof(OniVideoMode));
std::cout << "Unexpected size: " << *pDataSize << " != " << sizeof(OniVideoMode) << std::endl;

As soon as I get home I try. If you want the modified files, tell me.

On the other hand. And this warning?

En el ámbito global:
cc1plus: aviso: no se reconoce la opción de línea de órdenes "-Wno-gnu-static-float-init" [activado por defecto]

I have seen the file /libfreenect-master/OpenNI2-FreenectDriver/CMakeList.txt

######################################################################################
# OpenNI2-FreenectDriver
######################################################################################

file(GLOB SOURCES src/*.cpp)
add_library(FreenectDriver SHARED ${SOURCES})

set(CMAKE_CXX_FLAGS "-Wno-gnu-static-float-init -Wno-unused-function")

set(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}/lib/OpenNI2-FreenectDriver)
set_target_properties( FreenectDriver PROPERTIES
  VERSION ${PROJECT_VER}
  SOVERSION ${PROJECT_APIVER}
  OUTPUT_NAME FreenectDriver)

include_directories(extern/OpenNI-Linux-x64-2.2.0.33/Include)
include_directories(${PROJECT_SOURCE_DIR}/wrappers/cpp)

target_link_libraries(FreenectDriver freenectstatic ${MATH_LIB})

install (TARGETS FreenectDriver
  DESTINATION "${PROJECT_LIBRARY_INSTALL_DIR}/OpenNI2-FreenectDriver")

Do I have to change something? Do I need to install something?

Thank you very much. A greeting.

lnegrol commented 10 years ago

Hola piedar, I have tested the changes I've made on files. When I run make:

jfra@negro-L755:~/Kinect/libfreenect-master/build$ make
Scanning dependencies of target freenect
[  3%] Building C object src/CMakeFiles/freenect.dir/core.c.o
[  6%] Building C object src/CMakeFiles/freenect.dir/tilt.c.o
/home/jfra/Kinect/libfreenect-master/src/tilt.c:57:12: aviso: se define ‘tag_seq’ pero no se usa [-Wunused-variable]
[ 10%] Building C object src/CMakeFiles/freenect.dir/cameras.c.o
[ 13%] Building C object src/CMakeFiles/freenect.dir/flags.c.o
/home/jfra/Kinect/libfreenect-master/src/flags.c:35:1: aviso: se descarta el atributo ‘visibility’ [-Wattributes]
[ 17%] Building C object src/CMakeFiles/freenect.dir/usb_libusb10.c.o
[ 20%] Building C object src/CMakeFiles/freenect.dir/registration.c.o
[ 24%] Building C object src/CMakeFiles/freenect.dir/keep_alive.c.o
Linking C shared library ../lib/libfreenect.so
[ 24%] Built target freenect
Scanning dependencies of target freenectstatic
[ 27%] Building C object src/CMakeFiles/freenectstatic.dir/core.c.o
[ 31%] Building C object src/CMakeFiles/freenectstatic.dir/tilt.c.o
/home/jfra/Kinect/libfreenect-master/src/tilt.c:57:12: aviso: se define ‘tag_seq’ pero no se usa [-Wunused-variable]
[ 34%] Building C object src/CMakeFiles/freenectstatic.dir/cameras.c.o
[ 37%] Building C object src/CMakeFiles/freenectstatic.dir/flags.c.o
/home/jfra/Kinect/libfreenect-master/src/flags.c:35:1: aviso: se descarta el atributo ‘visibility’ [-Wattributes]
[ 41%] Building C object src/CMakeFiles/freenectstatic.dir/usb_libusb10.c.o
[ 44%] Building C object src/CMakeFiles/freenectstatic.dir/registration.c.o
[ 48%] Building C object src/CMakeFiles/freenectstatic.dir/keep_alive.c.o
Linking C static library ../lib/libfreenect.a
[ 48%] Built target freenectstatic
Scanning dependencies of target chunkview
[ 51%] Building C object examples/CMakeFiles/chunkview.dir/chunkview.c.o
Linking C executable ../bin/chunkview
[ 51%] Built target chunkview
Scanning dependencies of target freenect_sync
[ 55%] Building C object wrappers/c_sync/CMakeFiles/freenect_sync.dir/libfreenect_sync.c.o
Linking C shared library ../../lib/libfreenect_sync.so
[ 55%] Built target freenect_sync
Scanning dependencies of target glpclview
[ 58%] Building C object examples/CMakeFiles/glpclview.dir/glpclview.c.o
Linking C executable ../bin/glpclview
[ 58%] Built target glpclview
Scanning dependencies of target glview
[ 62%] Building C object examples/CMakeFiles/glview.dir/glview.c.o
Linking C executable ../bin/glview
[ 62%] Built target glview
Scanning dependencies of target hiview
[ 65%] Building C object examples/CMakeFiles/hiview.dir/hiview.c.o
Linking C executable ../bin/hiview
[ 65%] Built target hiview
Scanning dependencies of target regtest
[ 68%] Building C object examples/CMakeFiles/regtest.dir/regtest.c.o
Linking C executable ../bin/regtest
[ 68%] Built target regtest
Scanning dependencies of target regview
[ 72%] Building C object examples/CMakeFiles/regview.dir/regview.c.o
Linking C executable ../bin/regview
[ 72%] Built target regview
Scanning dependencies of target tiltdemo
[ 75%] Building C object examples/CMakeFiles/tiltdemo.dir/tiltdemo.c.o
Linking C executable ../bin/tiltdemo
[ 75%] Built target tiltdemo
Scanning dependencies of target fakenect
[ 79%] Building C object fakenect/CMakeFiles/fakenect.dir/fakenect.c.o
Linking C shared library ../lib/fakenect/libfreenect.so
[ 79%] Built target fakenect
Scanning dependencies of target record
[ 82%] Building C object fakenect/CMakeFiles/record.dir/record.c.o
Linking C executable ../bin/record
[ 82%] Built target record
Scanning dependencies of target freenect_sync_static
[ 86%] Building C object wrappers/c_sync/CMakeFiles/freenect_sync_static.dir/libfreenect_sync.c.o
Linking C static library ../../lib/libfreenect_sync.a
[ 86%] Built target freenect_sync_static
Scanning dependencies of target cppview
[ 89%] Building CXX object wrappers/cpp/CMakeFiles/cppview.dir/cppview.cpp.o
Linking CXX executable ../../bin/cppview
[ 89%] Built target cppview
Scanning dependencies of target FreenectDriver
[ 93%] Building CXX object OpenNI2-FreenectDriver/CMakeFiles/FreenectDriver.dir/src/DeviceDriver.cpp.o
[ 96%] Building CXX object OpenNI2-FreenectDriver/CMakeFiles/FreenectDriver.dir/src/ColorStream.cpp.o
[100%] Building CXX object OpenNI2-FreenectDriver/CMakeFiles/FreenectDriver.dir/src/DepthStream.cpp.o
Linking CXX shared library ../lib/OpenNI2-FreenectDriver/libFreenectDriver.so
[100%] Built target FreenectDriver

Are these four warnings are problematic?

/home/jfra/Kinect/libfreenect-master/src/tilt.c:57:12: aviso: se define ‘tag_seq’ pero no se usa [-Wunused-variable]
/home/jfra/Kinect/libfreenect-master/src/flags.c:35:1: aviso: se descarta el atributo ‘visibility’ [-Wattributes]
/home/jfra/Kinect/libfreenect-master/src/tilt.c:57:12: aviso: se define ‘tag_seq’ pero no se usa [-Wunused-variable]
/home/jfra/Kinect/libfreenect-master/src/flags.c:35:1: aviso: se descarta el atributo ‘visibility’ [-Wattributes]

Thank you very much. A greeting.

lnegrol commented 10 years ago

Hello piedar, I am testing the samples of OpenNI-Linux-x86-2.2.0.33 and not run.

For example, the sample ClosestPointViewer show:

Update failed
Update failed
Update failed
...
Update failed

Thank you very much. A greeting.

piedar commented 10 years ago

The four warnings are harmless. Two are due a variable declared outside an #ifdef BUILD_AUDIO block and I think the other two are caused by a function being both static and hidden.

I have no error output for ClosestPointViewer. Does SimpleViewer work?

lnegrol commented 10 years ago

Hello piedar, thank you very much for your answer. The sample SimpleViewer show:

After initialization:

and a black window, and displays nothing.

With the sample ClosestPointViewer and MWClosestPointApp show:

Update failed
Update failed
...
Update failed

and a black windows and display nothing. With the sample EventBasedRead, MultipleStreamRead and SimpleRead show data to the console. For example in SimpleRead show:

[994502409]      691
[996504564]      687
[998506719]      680
[1000508874]      675
[1002511029]      670
[1004513184]      665
[1006515339]      645
[1008517494]      638
[1010519649]      634
[1012521804]      629
...
[1014523959]      625
[1016526114]        0
[1018528269]        0
[1020530424]        0

tiltdemo and glview working properly.

I don't know what happen.

Thank you very much. A greeting.

piedar commented 10 years ago

It could be that ClosestPointViewer is looking for data faster than libfreenect serves it up. I turned on FREENECT_LOG_DEBUG in the latest 8d8558f. Do you see any messages about dropped frames? They look like this:

[Stream 70] Expected max 1748 data bytes, but got 1908. Dropping...
lnegrol commented 10 years ago

Hello piedar, thank you very much for your answer.

I have run the sample ClosestPointViewer with the new changes you've done and the console show:

jfra@negro-L755:~/kinect/OpenNI-Linux-x86-2.2/Samples/Bin$ ./ClosestPointViewer 
write_register: 0x0105 <= 0x00
write_register: 0x0006 <= 0x00
write_register: 0x0012 <= 0x03
write_register: 0x0013 <= 0x01
write_register: 0x0014 <= 0x1e
write_register: 0x0006 <= 0x02
write_register: 0x0017 <= 0x00
write_register: 0x0006 <= 0x00
write_register: 0x0105 <= 0x00
write_register: 0x0006 <= 0x00
write_register: 0x0012 <= 0x03
write_register: 0x0013 <= 0x01
write_register: 0x0014 <= 0x1e
write_register: 0x0006 <= 0x02
write_register: 0x0017 <= 0x00
Update failed
Update failed
Update failed
...
Update failed
Update failed
Update failed

And SimpleViewer show:

jfra@negro-L755:~/kinect/OpenNI-Linux-x86-2.2/Samples/Bin$ ./SimpleViewer 
After initialization:

write_register: 0x0105 <= 0x00
write_register: 0x0006 <= 0x00
write_register: 0x0012 <= 0x03
write_register: 0x0013 <= 0x01
write_register: 0x0014 <= 0x1e
write_register: 0x0006 <= 0x02
write_register: 0x0017 <= 0x00
write_register: 0x0006 <= 0x00
write_register: 0x0105 <= 0x00
write_register: 0x0006 <= 0x00
write_register: 0x0012 <= 0x03
write_register: 0x0013 <= 0x01
write_register: 0x0014 <= 0x1e
write_register: 0x0006 <= 0x02
write_register: 0x0017 <= 0x00
write_register: 0x000c <= 0x00
write_register: 0x000d <= 0x01
write_register: 0x000e <= 0x1e
write_register: 0x0005 <= 0x01
write_register: 0x0047 <= 0x00
jfra@negro-L755:~/kinect/OpenNI-Linux-x86-2.2/Samples/Bin$ 

The window shows nothing. The background is black.

Thank you very much. A greeting.

piedar commented 10 years ago

I don't really know where to go from here. I suppose you could try setting Verbosity=0 in OpenNI.ini.

lnegrol commented 10 years ago

Hello piedar, thank you very much for your answer. I modified the file OpenNi.ini:

[Log]
; 0 - Verbose; 1 - Info; 2 - Warning; 3 - Error. Default - None
Verbosity=0
LogToConsole=0
LogToFile=0

[Device]
;Override=""

[Drivers]
; Location of the drivers specified by a relative path based on OpenNI's shared library or an absolute path.
; Path separator "/" can be used to be portable for any platforms.
; Default - OpenNI2/Drivers
;Repository=OpenNI2/Drivers

and I have run the sample SimpleViewer and the console only shows:

jfra@negro-L755:~/kinect/OpenNI-Linux-x86-2.2/Samples/Bin$ ./SimpleViewer
After initialization:

write_register: 0x0105 <= 0x00
write_register: 0x0006 <= 0x00
write_register: 0x0012 <= 0x03
write_register: 0x0013 <= 0x01
write_register: 0x0014 <= 0x1e
write_register: 0x0006 <= 0x02
write_register: 0x0017 <= 0x00
write_register: 0x0006 <= 0x00
write_register: 0x0105 <= 0x00
write_register: 0x0006 <= 0x00
write_register: 0x0012 <= 0x03
write_register: 0x0013 <= 0x01
write_register: 0x0014 <= 0x1e
write_register: 0x0006 <= 0x02
write_register: 0x0017 <= 0x00
write_register: 0x000c <= 0x00
write_register: 0x000d <= 0x01
write_register: 0x000e <= 0x1e
write_register: 0x0005 <= 0x01
[Stream 70] Invalid magic 8eff
[Stream 70] Invalid magic 8eff
[Stream 70] Invalid magic 8eff
[Stream 70] Invalid magic 90ff
[Stream 70] Invalid magic 8fff
[Stream 70] Invalid magic 91ff
[Stream 70] Lost 9 packets
[Stream 70] Lost too many packets, resyncing...
write_register: 0x0047 <= 0x00

The window shows nothing. The background is black. Thank you very much. A greeting.

piedar commented 10 years ago

Aha! I managed to reproduce this on an x86 netbook with Intel Atom N280. It looks like the CPU can't keep up with the USB transfers coming from the Kinect. glview drops a lot of frames and SimpleViewer freezes up after dropping about 12 frames.

What is your CPU? Can you try on a more powerful machine?

piedar commented 10 years ago

It does not help that FreenectDriver makes a full copy of libfreenect's buffer. This probably cannot be avoided - using the same buffer results in memory corruption when libfreenect and OpenNI2 both try to free it.

lnegrol commented 10 years ago

Hello piedar, thank you very much for your answer. I'm using a Toshiba Satellite L755-1J9 with the following components:

Since I can not work with current versions, I am working with older versions:

and they work correctly.

What do you think?

Thank you very much. A greeting.

piedar commented 10 years ago

Strange that the old version works. I took a diff between them and I don't see anything obvious that would cause this. I will try some more things with my x86 netbook.

lnegrol commented 10 years ago

Hello piedar, thank you very much for your answer.

I am attaching the link that contains the files that I'm working on:

https://www.dropbox.com/sh/rssnm7tbryrjpy8/Mbqd_4s2VY

I also do not understand what may be happening.

Thank you very much. A greeting.

piedar commented 10 years ago

I think I've got it! The C++ wrapper libfreenect.hpp stops and restarts the depth stream when you call setDepthFormat() (whether it was already running or not!). In DeviceDriver.cpp, I start the depth stream then immediately construct a FreenectDriver::DepthStream, which calls setDepthFormat(), stopping and starting depth . Somehow this confuses OpenNI2 and SimpleViewer fails to show depth.

I am still not sure why the old version works for you; it had the same flaw. But depth is now working on my netbook as of 62f0a0d. Please give it a go.

lnegrol commented 10 years ago

Hello piedar, thank you very much for your answer. Congratulations, you have found the problem. All examples work correctly. I can already work with:

Thank you very much. A greeting.