新手搭建Jetson TX1 + Kinect2环境(二)

export PATH=/usr/local/cuda-7.0/bin:$PATH
export LD_LIBRARY_PATH=/usr/local/cuda-7.0/lib64:$LD_LIBRARY_PATH
cuda-install-samples-7.0.sh
cd ~/NVIDIA_CUDA-Samples_7.0/0_Simple/vectorAdd
make
./vectorAdd
验证是否安装成功,在终端执行命令:nvcc -V,如果安装成功,则会有相应的版本信息。

(3)安装Qt
sudo apt-get install build-essential qt5-default qtcreator -y
如果有问题,去掉-y,提示y/n时候手动输入y
在qt-creator中配置
Tools->Options->Build & Run->Compilers
选择Add button and select ‘GCC’, in the ‘Compiler path’ text box, place the path to the gcc compiler. On a standard installation the path is :/usr/bin/gcc.
check the ‘Kits’ setting, selecting the Desktop(default) kit, you should see Compiler:GCC, the name GCC should match the Compiler named in the previous tab.
如果你编译某个package时候qt编译不通过,可以尝试再配置一下DigiaQtOpenSource-qtcreator.desktop
在Exec=后面加上bash -i -c
(4)安装opencv
下载界面:(https://developer.nvidia.com/embedded/linux-tegra-r231)
下载Opencv4Tegra for L4T 23.x,上面提到的CUDA7.0下载也是在这个界面,对应的是CUDA 7.0 Toolkit for L4T Rel 23.1
具体安装步骤可见此word文档所在文件夹下的OpenCV4Tegra-2.4.12.3-README.txt文档。网页地址如下:
(5)安装kinect2的驱动libfreenect2
参考网页:
网页里面有详细的安装步骤,修改安装步骤./installlibfreenect2为./installlibfreenect2.sh自己修改大小写。跑示例的时候出现[Debug] [Debug] [RgbPacketStreamParser] skipping rgb packet! 很多人认为这是一个错误,但这不是错误,出现这种情况说明JPEG解码太慢,一些USB数据接收一些被丢弃。 接下来如果要检测CPU,GPU的使用情况,先进入installLibfreenect2文件夹,运行jetson_max_l4t.sh文件,然后进入/home/libfreenect/build/bin文件夹,运行。/Protonect文件,可以看到频率的提高。
有很多地方说jetson板子的问题,一个是USB口,一个是RGB–BGR解码问题,根据教程网页下载的包已经修复了USB口问题,而包里面readme也说了解码问题,但是我的图片本来就没有这个问题阿,不需要进行修复解码问题。
(6)安装kinect2与ROS之间桥梁iai_kinect2
cd ~/catkin_ws/src/
git clone https://github.com/code-iai/iai_kinect2.git
cd iai_kinect2
rosdep install -r –from-paths .
cd ~/catkin_ws
catkin_make -DCMAKE_BUILD_TYPE=”Release”
安装结束,把 kinect for xbox one 连上 usb3.0 测试
roslaunch kinect2_bridge kinect2_bridge.launch
再开一个终端,查看点云或者图像
viewer kinect2_viewer kinect2 sd cloud
rosrun kinect2_viewer kinect2_viewer kinect2 sd image
当然我还尝试过很多别的版本的开源驱动,比如OpenPTrack感觉有点复杂,由于我的ubuntu系统玩的也不熟,遇到错误没法正确理解并及时解决,最后编译不成功就放弃了,但并不否认这些包不能成功。

你可能感兴趣的:(kinect2+tx)