ubuntu14.04 安装openNI2

来源:互联网 发布:淘宝店铺托管找哪家 编辑:程序博客网 时间:2024/06/10 00:19


1.安装 OpenNI2依赖项

  1. $sudo apt-get install -y g++ python libusb-1.0-0-dev freeglut3-dev doxygen graphviz  
  2. $sudo apt-get install libudev-dev  

2.从github将openni2源码clone下来
  1. $git clone https://github.com/occipital/OpenNI2.git  
  2. $cd OpenNI2  

3.修改两处配置Platform.Arm和CommonCppMakefile,适用于arm设备
  1. $gedit ThirdParty/PSCommon/BuildSystem/Platform.Arm  

Change:

CFLAGS+= -march=armv7-a -mtune=cortex-a9 -mfpu=neon -mfloat-abi=softfp#-mcpu=cortex-a8

to:

CFLAGS+= -march=armv7-a -mtune=cortex-a15 -mfpu=neon-vfpv4 -mfloat-abi=hard


  1. $gedit ThirdParty/PSCommon/BuildSystem/CommonCppMakefile  

---OpenNI2-2.2.0.30/ThirdParty/PSCommon/BuildSystem/CommonCppMakefile.old2014-03-28 19:09:11.572263107 -0700

+++OpenNI2-2.2.0.30/ThirdParty/PSCommon/BuildSystem/CommonCppMakefile 2014-03-2819:09:55.600261937 -0700

@@-95,6 +95,9 @@

OUTPUT_NAME= $(EXE_NAME)

# Wewant the executables to look for the .so's locally first:

LDFLAGS+= -Wl,-rpath ./

+ifneq ("$(OSTYPE)","Darwin")

+LDFLAGS += -lpthread

+endif

OUTPUT_COMMAND= $(CXX) -o $(OUTPUT_FILE) $(OBJ_FILES) $(LDFLAGS)

endif

ifneq "$(SLIB_NAME)" ""



4.修改makefile,增加sample,即在makefile文件末尾添加:

  1. core_samples: $(CORE_SAMPLES)  
  2. tools: $(ALL_TOOLS)  


5.编译

  1. $make  
  2. $make core_samples # this probably isn't necessary, they should already be built  
  3. $GLUT_SUPPORTED=1 make tools#GLUT_SUPPORTED tells the make to compile NiViewer for OpenGL 

0 0