forked from OpenKinect/libfreenect
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* dfsg: (84 commits) Fix stupid comparison mistake in audio serial fallback Update CMakeList.txt and ebuild for v0.5.0 c_sync: Collapse unused functions Configure audio support at runtime - fixes OpenKinect#372 Use audio serial as a fallback for K4W and 1473 models that do not provide a useful camera serial (thanks @olzhas). Fixes OpenKinect#360 and resolves OpenKinect#393. Remove legacy keep_alive.c; now require libusb >= 1.0.18 c_sync: Add freenect_sync_camera_to_world() (thanks @martyvona) - fixes OpenKinect#294 Fix a crash-on-exit in the OpenNI2 driver caused by using a deleted iterator. Cleanup imports in examples; also fixes a micview compile error on OS X. Allow freenect_set_tilt_degs to take a negative angle Update CMakeLists.txt for v0.4.3 win32: Fix command in examples/CMakeLists.txt ebuild: Improve python dependency - fixes OpenKinect#391 Standardize indentation in fnusb_open_subdevices Use non-infinite timeouts for bulk tilt / led commands Reset the audio device before using it to ensure the commands can be sent correctly Fixes OpenKinect#390 Update README.md and CMakeLists.txt for v0.4.2 Fix fakenect not handling freenect_process_events_timeout FN_DEBUG: print read_register and read_cmos_register replies Fix cmake module include order Fix cpack user option on linux Separate cpack options for different generators and add tgz generator Add cmake config file Fixes OpenKinect#355 wrappers/python: update freenect.c - fixes OpenKinect#326 ...
- Loading branch information
Showing
78 changed files
with
15,187 additions
and
4,037 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
###################################################################################### | ||
# OpenNI2-FreenectDriver | ||
###################################################################################### | ||
|
||
file(GLOB HEADERS src/*.hpp src/*.h) | ||
file(GLOB SOURCES src/*.cpp) | ||
add_library(FreenectDriver SHARED ${HEADERS} ${SOURCES}) | ||
|
||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-function") | ||
|
||
set(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}/lib/OpenNI2-FreenectDriver) | ||
set_target_properties(FreenectDriver PROPERTIES | ||
VERSION ${PROJECT_VER} | ||
SOVERSION ${PROJECT_APIVER} | ||
OUTPUT_NAME FreenectDriver) | ||
|
||
add_definitions(-DPROJECT_VER="${PROJECT_VER}") | ||
|
||
include_directories(extern/OpenNI-Linux-x64-2.2.0.33/Include) | ||
include_directories(${PROJECT_SOURCE_DIR}/wrappers/cpp) | ||
|
||
target_link_libraries(FreenectDriver freenectstatic ${MATH_LIB}) | ||
|
||
install (TARGETS FreenectDriver | ||
DESTINATION "${PROJECT_LIBRARY_INSTALL_DIR}/OpenNI2-FreenectDriver") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
OpenNI2-FreenectDriver | ||
====================== | ||
|
||
OpenNI2-FreenectDriver is a bridge to libfreenect implemented as an OpenNI2 driver. | ||
It allows OpenNI2 to use Kinect hardware on Linux and OSX. | ||
It was originally a [separate project](https://github.com/piedar/OpenNI2-FreenectDriver) but is now distributed with libfreenect. | ||
OpenNI2-FreenectDriver is distributed under the [Apache 2](https://github.com/OpenKinect/libfreenect/blob/master/APACHE20) license. | ||
|
||
Install | ||
------- | ||
1. Download and unpack [OpenNI](http://www.openni.org/openni-sdk/) 2.2.0.33 or higher. | ||
2. Go to the top libfreenect directory and build it with the OpenNI2 driver. | ||
|
||
mkdir build | ||
cd build | ||
cmake .. -DBUILD_OPENNI2_DRIVER=ON | ||
make | ||
|
||
3. Copy the driver to your OpenNI2 driver repository. You must first change `Repository` to match your project layout. | ||
|
||
Repository="/example/path/to/Samples/Bin/OpenNI2/Drivers/" | ||
cp -L lib/OpenNI2-FreenectDriver/libFreenectDriver.{so,dylib} ${Repository} | ||
# you could instead make a symlink to avoid copying after every build | ||
# ln -s lib/OpenNI2-FreenectDriver/libFreenectDriver.{so,dylib} ${Repository} | ||
|
||
OpenNI2-FreenectDriver is built with a static libfreenect, so you do not need to include libfreenect when deploying. | ||
However, you will need to make sure target systems have libusb and all other dependencies listed in `ldd libFreenectDriver.so`. | ||
|
||
__________________________________________________ | ||
|
||
Structure | ||
--------- | ||
This driver is modeled on TestDevice.cpp and Drivers/Kinect/. | ||
In the FreenectDriver namespace, it ties together the C++ interfaces of OpenNI2 and libfreenect using multiple inheritance. | ||
|
||
Driver inherits publically from oni::driver::DriverBase and privately from Freenect::Freenect. | ||
libfreenect.hpp allows protected access to the Freenect context, so that FreenectDriver can call the Freenect's C API. | ||
As a DriverBase, FreenectDriver manages devices and sets up device state callbacks. | ||
|
||
Device inherits publically from oni::driver::DeviceBase and Freenect::FreenectDevice. | ||
Because of this, it can be built by Freenect::Freenect::createDevice() and it can define Device's depth and video callbacks. | ||
Those callbacks trigger acquireFrame() in FreenectStream. | ||
|
||
VideoStream is a virtual base class inheriting from oni::driver::StreamBase. | ||
It does generic frame setup in buildFrame() and then calls pure virtual populateFrame() to let derived classes finish the frame. | ||
It also provides the base skeleton for setting and getting properties, which cascades down the inheritance tree. | ||
|
||
DepthStream and ColorStream are nearly identical in definition and implementation, both inheriting from VideoStream. | ||
They differ mostly in the formats they use to process data and the video modes they support. | ||
These two classes offer a system to store and report supported video modes. | ||
To implement a new mode, simply add it to getSupportedVideoModes() and modify populateFrame() as necessary. | ||
|
||
__________________________________________________ | ||
|
||
Todo | ||
---- | ||
* support more FREENECT_RESOLUTION_\*, FREENECT_VIDEO_\*, and FREENECT_DEPTH_\* | ||
* provide more OniVideoMode and OniStreamProperty | ||
* implement remaining derived functions |
Oops, something went wrong.