博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
install libfreenect2 on ubuntu 16.04
阅读量:4040 次
发布时间:2019-05-24

本文共 2907 字,大约阅读时间需要 9 分钟。

the install method has been listed in https://github.com/OpenKinect/libfreenect2

 

 

 

After installation, the test project is listed below:

 

CMakeList.txt

 

cmake_minimum_required(VERSION 2.8)project(TestLibfreenect2)add_executable(${PROJECT_NAME} "main.cpp")find_package(freenect2 REQUIRED)target_link_libraries(${PROJECT_NAME} ${freenect2_LIBRARIES})

main.cpp

 

 

 

#include 
//#include
//#include
//#include
//#include
#include
libfreenect2::Freenect2 freenect2;libfreenect2::Freenect2Device *dev = 0;libfreenect2::PacketPipeline *pipeline = 0;int main(){ std::string serial; if(freenect2.enumerateDevices() == 0) { std::cout << "no device connected!" << std::endl; return -1; } if (serial == "") { serial = freenect2.getDefaultDeviceSerialNumber(); std::cout << serial; } return 0;}

 

 

 

 

the output:

 

[Info] [Freenect2Impl] enumerating devices...[Info] [Freenect2Impl] 14 usb devices connected[Info] [Freenect2Impl] found valid Kinect v2 @4:8 with serial 016240151047[Info] [Freenect2Impl] found 1 devices016240151047

 

 

 

 

 

However, I have been troubled by a problem for a long time. When I run /home/seamanj/libfreenect2/build/bin/Protonect, there was no 4 subwindows poping out and showed some errors like:

 

libva info: VA-API version 0.39.4libva info: va_getDriverName() returns -1libva error: va_getDriverName() failed with unknown libva error,driver_name=(null)[Error] [VaapiRgbPacketProcessorImpl] vaInitialize(display, &major_ver, &minor_ver): unknown libva error

 

 

 

 

 

however, when I used vainfo command, the libva worked normally like:

 

libva info: VA-API version 0.39.4libva info: va_getDriverName() returns 0libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/nvidia_drv_video.solibva info: Found init function __vaDriverInit_0_39libva info: va_openDriver() returns 0vainfo: VA-API version: 0.39 (libva 1.7.3)vainfo: Driver version: Splitted-Desktop Systems VDPAU backend for VA-API - 0.7.4vainfo: Supported profile and entrypoints      VAProfileMPEG2Simple            :	VAEntrypointVLD      VAProfileMPEG2Main              :	VAEntrypointVLD      VAProfileMPEG4Simple            :	VAEntrypointVLD      VAProfileMPEG4AdvancedSimple    :	VAEntrypointVLD      VAProfileH264Baseline           :	VAEntrypointVLD      VAProfileH264Main               :	VAEntrypointVLD      VAProfileH264High               :	VAEntrypointVLD      VAProfileVC1Simple              :	VAEntrypointVLD      VAProfileVC1Main                :	VAEntrypointVLD      VAProfileVC1Advanced            :	VAEntrypointVLD

 

 

 

 

 

 Finally, I used cmake-gui and figured out the reason which was lacking of libglfw3.

sudo apt-get install libglfw3 libglfw3-dev

 

When I installed this lib and build again, after I run Protonect the windows came out.

 

update on 1.11.2018

please don't forget to copy

/libfreenect2/platform/linux/udev/90-kinect2.rules

to

 /etc/udev/rules.d

to get permission

你可能感兴趣的文章
Golang 数据可视化利器 go-echarts ,实际使用
查看>>
mysql 跨机器查询,使用dblink
查看>>
mysql5.6.34 升级到mysql5.7.32
查看>>
dba 常用查询
查看>>
Oracle 异机恢复
查看>>
Oracle 12C DG 搭建(RAC-RAC/RAC-单机)
查看>>
Truncate 表之恢复
查看>>
Oracle DG failover 后恢复
查看>>
mysql 主从同步配置
查看>>
为什么很多程序员都选择跳槽?
查看>>
mongdb介绍
查看>>
mongdb安装使用
查看>>
mongdb在java中的应用
查看>>
mongodb与spring集成
查看>>
1060. Are They Equal (25)
查看>>
1020. Tree Traversals (25)
查看>>
1066. Root of AVL Tree (25)
查看>>
1086. Tree Traversals Again (25)
查看>>
1043. Is It a Binary Search Tree (25)
查看>>
大数阶乘!
查看>>