From 072c210749d5aafba435ef4bd4e3cce6a4f1c5d7 Mon Sep 17 00:00:00 2001 From: Benn Snyder Date: Tue, 13 Jun 2017 19:47:58 -0400 Subject: [PATCH] fakenect: Update documentation Signed-off-by: Benn Snyder --- CMakeLists.txt | 2 +- README.md | 13 +++++++++---- fakenect/CMakeLists.txt | 2 +- fakenect/README | 39 --------------------------------------- 4 files changed, 11 insertions(+), 45 deletions(-) delete mode 100644 fakenect/README diff --git a/CMakeLists.txt b/CMakeLists.txt index 479961a8..a7092ba4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -30,7 +30,7 @@ # CMake directives ###################################################################################### -cmake_minimum_required(VERSION 2.6) +cmake_minimum_required(VERSION 2.8.12) ###################################################################################### # Project declaration and options diff --git a/README.md b/README.md index 3ad9d4b1..fda66c23 100644 --- a/README.md +++ b/README.md @@ -147,17 +147,22 @@ Wrappers are not guaranteed to be API stable or up to date. - actionscript - Java (JNA) -# Using Fakenect +# Fakenect -To use a fakenect recorded stream, just provide the fakenect lib as a pre loaded library with `LD_PRELOAD` and indicates the recorded files directory with `FAKENECT_PATH` +Using fakenect, you can record a session to a directory and play it back later. + + mkdir session + fakenect-record ./session + +To use a fakenect recorded stream, just provide the fakenect lib as a pre loaded library with `LD_PRELOAD` and indicates the recorded files directory with `FAKENECT_PATH`. - Sample with python wrappers : ```shell - LD_PRELOAD="/usr/local/lib/fakenect/libfreenect_faked.so" FAKENECT_PATH="./sample/hand1" python ./wrappers/python/demo_cv_sync.py + LD_PRELOAD="/usr/local/lib/fakenect/libfakenect.so" FAKENECT_PATH="./session" python ./wrappers/python/demo_cv_sync.py ``` - Sample with C bin : ```shell - LD_PRELOAD="/usr/local/lib/fakenect/libfreenect_faked.so" FAKENECT_PATH="./sample/hand1" freenect-glview + LD_PRELOAD="/usr/local/lib/fakenect/libfakenect.so" FAKENECT_PATH="./session" freenect-glview ``` # Code Contributions diff --git a/fakenect/CMakeLists.txt b/fakenect/CMakeLists.txt index 40b67b4c..ea54ce8b 100644 --- a/fakenect/CMakeLists.txt +++ b/fakenect/CMakeLists.txt @@ -7,7 +7,7 @@ add_library (fakenect SHARED fakenect.c) set_target_properties ( fakenect PROPERTIES VERSION ${PROJECT_VER} SOVERSION ${PROJECT_APIVER} - OUTPUT_NAME freenect_faked) + OUTPUT_NAME fakenect) target_link_libraries(fakenect ${MATH_LIB}) install (TARGETS fakenect diff --git a/fakenect/README b/fakenect/README deleted file mode 100644 index 0bc83228..00000000 --- a/fakenect/README +++ /dev/null @@ -1,39 +0,0 @@ -Fakenect -(c) 2010 Brandyn White - -See this blog post for more info -http://brandynwhite.com/fakenect-openkinect-driver-simulator-experime - -Description -This consists of a "record" program to save dumps from the kinect sensor and a library that can be linked to, providing an interface compatible with freenect. This allows you to save data and repeat for experiments, debug problems, share datasets, and experiment with the kinect without having one. - -Record -./record my_output // NOTE: output directory is created for you - -The program takes one argument (the output directory) and saves the acceleration, depth, and rgb data as individual files with names in the form "TYPE-CURRENTIME-TIMESTAMP" where TYPE is either (a)ccel, (d)epth, or (r)gb, TIMESTAMP corresponds to the timestamp associated with the observation (or in the case of accel, the last timestamp seen), and CURRENTTIME corresponds to a floating point version of the time in seconds. The purpose of storing the current time is so that delays can be recreated exactly as they occurred. For RGB and DEPTH the dump is just the entirety of the data provided in PPM and PGM formats respectively (just a 1 line header above the raw dump). For ACCEL, the dump is the 'freenect_raw_tilt_state'. Only the front part of the file name is used, with the rest left undefined (extension, extra info, etc). - -A file called INDEX.txt is also output with all of the filenames local to that directory to simplify the format (e.g., no need to read the directory structure). - -Here is an example of using the program -mkdir out -sudo ./record out - -And it will keep running, when you want to stop it, hit Ctrl-C and the signal will be caught, runloop stopped, and everything will be stored cleanly. - -Library -Use the resulting fakenect .so dynamically instead of libfreenect. - -We read 1 update from the index per call, so this needs to be called in a loop like usual. If the index line is a Depth/RGB image the provided callback is called. If the index line is accelerometer data, then it is used to update our internal state. If you query for the accelerometer data you get the last sensor reading that we have. The time delays are compensated as best as we can to match those from the original data and current run conditions (e.g., if it takes longer to run this code then we wait less). - -Build -This is built with the main cmake script. - -This gives you a build/lib/fakenect/libfreenect.so (note that it has the same name, but it is not the same) that you dynamically link in instead of libfreenect.so. - -Evaluation -There is a demo in wrappers/python, see the README there - -Here is an example of calling the cython demo -sudo LD_LIBRARY_PATH="../../../fakenect/" FAKENECT_PATH="thanksgiving0" python demo_cv_depth_show.py - -Note the FAKENECT_PATH, you pass in the path to a directory made with "record" \ No newline at end of file