Skip to content

Commit

Permalink
first commit of the OpenNI2 wrapper by the Palo Alto Group
Browse files Browse the repository at this point in the history
  • Loading branch information
itziklerner committed Sep 8, 2018
1 parent 91d4f43 commit 9fe97ed
Show file tree
Hide file tree
Showing 22 changed files with 4,031 additions and 0 deletions.
85 changes: 85 additions & 0 deletions wrappers/openni2/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
bin/
lib/

ubuntu-xenial/
ubuntu-xenial-hwe/

# CMake
build/

# XCode
.DS_Store
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3
xcuserdata
*.xccheckout
*.moved-aside
DerivedData
*.xcuserstate
librealsense.xc/build

*~
*.a
*.o
*.so
*.pyc
*.class

local_ignore/

#Visual Studio Project
.vs/*

#Clion Project
.idea/*

# QTCreator Project
/.qmake.cache
/.qmake.stash
*.user
*.user.*
*.moc
moc_*.cpp
qrc_*.cpp
ui_*.h
Makefile*
*-build-*
librealsense-log.txt

*.pyproj
*.orig
*.psess
*.vspx
*.vsp
*.bak
*.bin
*.suo
*.tlog
*.obj
*.ilk
*.pdb
*.exp
*.log
*.stamp
*.depend
*.vcxproj
*.exe
*.cache
*.lib
*.filters
*.db
*.opendb
*.rule
*.check_cache
*.dll
*.list
*.json
*.ini
*.cxx

54 changes: 54 additions & 0 deletions wrappers/openni2/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
cmake_minimum_required (VERSION 3.8.0)
project (rs2driver)

# DEPS
set(OPENNI2_DIR "c:/Program Files/OpenNI2" CACHE FILEPATH "OpenNI2 SDK directory")
set(REALSENSE2_DIR "c:/Program Files (x86)/Intel RealSense SDK 2.0" CACHE FILEPATH "RealSense2 SDK directory")

# INCLUDE DIR
include_directories (${OPENNI2_DIR}/Include)
include_directories (${REALSENSE2_DIR}/include)
include_directories (src)

# LINK DIR
if (CMAKE_SIZEOF_VOID_P EQUAL 8)
link_directories (${REALSENSE2_DIR}/lib/x64)
elseif (CMAKE_SIZEOF_VOID_P EQUAL 4)
link_directories (${REALSENSE2_DIR}/lib/x86)
endif ()

# OUTPUT DIR
set (CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/_out)
set (CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/_out)
set (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/_out)

# SOURCE FILES
set (INCLUDE_FILES
src/Rs2Base.h
src/Rs2Stream.h
src/Rs2Device.h
src/Rs2Driver.h
src/Profiler.h
src/Profiler.inl
src/D2S.h
src/S2D.h
)
set (SRC_FILES
src/Rs2Base.cpp
src/Rs2Stream.cpp
src/Rs2StreamProps.cpp
src/Rs2Device.cpp
src/Rs2DeviceProps.cpp
src/Rs2Driver.cpp
)

# FLAGS
if(MSVC)
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4")
set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /Oi /Ot /GL /GF /MD /GS- /Gy /fp:fast /arch:AVX2")
set (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /SUBSYSTEM:WINDOWS")
endif()

# LINK
add_library (rs2driver SHARED ${INCLUDE_FILES} ${SRC_FILES})
target_link_libraries (rs2driver realsense2)
48 changes: 48 additions & 0 deletions wrappers/openni2/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# RealSense2 OpenNI2 driver

![alt text](doc/img/demo.jpg)
_Picture:_ _An_ _example_ _of_ _OpenNI2_ _work_ _with_ _RealSense_

Allows to use RealSense2 hardware with OpenNI2

Current features:
* configure stream modes
* access live data (color/depth/IR)
* record and playback files
* depth to color mapping
* user tracking with NiTE2
* no code changes required

## Getting started

Download [OpenNI2 SDK](https://structure.io/openni)

Download [RealSense2 SDK](https://github.com/IntelRealSense/librealsense/releases)

Run CMake on driver and configure SDK's:
* OPENNI2_DIR
* REALSENSE2_DIR

Generate project files and compile driver

Copy rs2driver.dll and realsense2.dll to OPENNI2_DIR/Samples/Bin/OpenNI2/Drivers/

Launch any OpenNI2 example (SimpleRead SimpleViewer NiViewer) located at OPENNI2_DIR/Samples/Bin/

## Examples

![alt text](doc/img/oni_viewer.jpg)
_Picture:_ _Show_ _hotkeys_

![alt text](doc/img/oni_video_mode.jpg)
_Picture:_ _Configuring_ _streams_

![alt text](doc/img/oni_capture.jpg)
_Picture:_ _Configuring_ _capture_

![alt text](doc/img/oni_user.jpg)
_Picture:_ _An_ _example_ _of_ _NiTE2_ _user_ _tracking_

## License

This project is licensed under the [Apache](https://github.com/IntelRealSense/librealsense/blob/master/LICENSE) License, Version 2.0.
Binary file added wrappers/openni2/doc/img/demo.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added wrappers/openni2/doc/img/oni_capture.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added wrappers/openni2/doc/img/oni_user.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added wrappers/openni2/doc/img/oni_video_mode.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added wrappers/openni2/doc/img/oni_viewer.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 9fe97ed

Please sign in to comment.