本文共 1580 字,大约阅读时间需要 5 分钟。
1.
git clone https://github.com/occipital/OpenNI2.git
2.
make -j${nproc}
注意这步可以省掉
3.
go to ./Packaging
ReleaseVersion.py x64
4. go to ./Final
extract OpenNI-Linux-x64-2.2.tar.bz2 then go into it
or go to /home/seamanj/Software/OpenNI2/Packaging/OpenNI-Linux-x64-2.2 directly.
sudo ./install.sh
5.
cat OpenNIDevEnvironment >> ~/.bashrcsource ~/.bashrc
cmake是从~/.bashrc读取环境, 而cmake-gui是从~/.profile里面读取()
所以同样也写到~/.profile里面去
cat OpenNIDevEnvironment >> ~/.profile
source命令对.profile文件不起作用, 得log out才行.
(
After changing the .profile
file, you have to logout from your account and login, then it will be sourced once automatically.
Also make sure these file does not exist in your home directory:
~/.bash_profile~/.bash_login
If you've got these files, the .profile
will be ignored.
)
updated on 22/Oct/2017
If you want to run /home/seamanj/OpenNI2/Bin/x64-Release/NiViewer, you need build freelibnect2 first, and then copy all the generated libs into /home/seamanj/OpenNI2/Bin/x64-Release/OpenNI2/Drivers
As to how to build libfreenect2 on ubuntu, please see :http://blog.csdn.net/seamanj/article/details/78314798
updated on 1.11.2018
don't forget to copy libfreenect2's drivers to
/home/seamanj/Software/OpenNI2/Packaging/Final/OpenNI-Linux-x64-2.2/Redist/OpenNI2/Drivers
Updated on 2.5.2019
s_XN_OK_result’ defined but not used [-Werror=unused-variable]
/home/seamanj/Software/OpenNI2/ThirdParty/PSCommon/BuildSystem/CommonCppMakefile
第76行
CFLAGS += -Werror -Wno-unused-variable -Wno-error=unused-local-typedefs
undefined reference to symbol 'pthread_mutexattr_settype@@GLIBC_2.2.5'