libfreenect2 is used on Jetsons to talk to MS Kinect camera. It also interacts heavily with CUDA on jetsons, which makes building difficult for other devices.
Hence, there are some hoops to go through, to make any project interacting with libfreenect2 buildable on local computer, such that it also will compile and work when built on the Jetson...
Install libfreenect2 on your device, in /opt directory. (Yes, really. Sorry. That's where Jetsons expect it to be).
- cd /opt
- sudo git clone https://github.com/OpenKinect/libfreenect2.git
- follow further instructions in the linux section of install guide at https://github.com/OpenKinect/libfreenect2/blob/master/README.md#linux
On Netbeans project, make sure the following are true:
- c++ 11, ofc.
- C++ Compiler, include directories '/opt/freenect2/include;/opt/freenect2/lib;/opt/freenect2;/usr/local/cuda-6.5/include;/usr/local/cuda-6.5/lib;/usr/local/cuda-6.5;/usr/lib/arm-linux-gnueabihf/tegra'
C++ Linker, runtime search directories '/opt/freenect2/lib'
- WHEN BUILDING LOCALLY (not on jetson): Additional Options: '-L/usr/local/cuda-6.5/lib -L/opt/freenect2/lib -lfreenect2 -pthread'
- WHEN BUILDING ON JETSON: Additional Options: '-L/usr/local/cuda-6.5/lib -L/opt/freenect2/lib -lcudart -lfreenect2 -pthread' (note the lack of -lcudart!!)
Whenever building locally, remove the -lcudart option; add it back before any commit to the svn, to make sure that the jetson build scripts work.
- When SSH-calling an applet, GLFW may error out and prevent functionality, if you just call the executable as-is. You may need to preface every call with 'DISPLAY=:0'. E.g. ubuntu@tegra-ubuntu12:~...$: DISPLAY=:0 ./pingcam-kinect