Skip to content

Commit

Permalink
Readme
Browse files Browse the repository at this point in the history
Signed-off-by: Brandyn A. White <bwhite@dappervision.com>
  • Loading branch information
Brandyn A. White authored and qdot committed Nov 27, 2010
1 parent 0fcbe9b commit f88c651
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions fakenect/README
@@ -1,35 +1,37 @@
Fakenect
(c) 2010 Brandyn White <bwhite@dappervision.com>

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-TIMESTAMP-CURRENTIME" where TYPE is either accel, depth, or rgb, 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. For ACCEL, the dump is
raw_x, raw_y, raw_z, mks_x, mks_y, mks_z where the raw's are uint16_t's and mks's are double's.

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_device_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
For now I have a lame build script until we can agree on how to integrate it in main
bash build.sh
This is built with the main cmake script.

This gives you a libfreenect.so (note that it has the same name, but it is not the same) that you dynamically link in instead of libfreenect.so.
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/cython, see the README there
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
Expand Down

0 comments on commit f88c651

Please sign in to comment.