Functions | |
| def | _load_numpy |
| def | _populate_namespace |
| def | _setup_shared_library |
| def | _try_load |
| def | _try_load_np |
| def | depth_cb_decorator |
| def | depth_cb_np |
| def | mks_accel |
| def | raw_accel |
| def | rgb_cb_decorator |
| def | rgb_cb_np |
| def | runloop |
Variables | |
| int | FORMAT_10_BIT = 1 |
| int | FORMAT_11_BIT = 0 |
| int | FORMAT_BAYER = 1 |
| int | FORMAT_RGB = 0 |
| int | LED_BLINK_GREEN = 5 |
| int | LED_BLINK_RED_YELLOW = 6 |
| int | LED_BLINK_YELLOW = 4 |
| int | LED_GREEN = 1 |
| int | LED_OFF = 0 |
| int | LED_RED = 2 |
| int | LED_YELLOW = 3 |
| def freenect::_load_numpy | ( | ) | [private] |
Definition at line 206 of file freenect.py.
| def freenect::_populate_namespace | ( | ) | [private] |
Definition at line 136 of file freenect.py.
| def freenect::_setup_shared_library | ( | ) | [private] |
Types all of the shared library functions
These headers are copied directly from libfreenect.h in order to simplify
updating
Returns:
(fn, freenect_depth_cb, freenect_rgb_cb) where
fn: freenect dynamic library updated with type info
freenect_depth_cb: ctypes callback wrapper for depth
freenect_rgb_cb: ctypes callback wrapper for rgb
Definition at line 65 of file freenect.py.
| def freenect::_try_load | ( | paths, | ||
| names, | ||||
| extensions | ||||
| ) | [private] |
Definition at line 40 of file freenect.py.
| def freenect::_try_load_np | ( | paths, | ||
| names, | ||||
| extensions | ||||
| ) | [private] |
Definition at line 57 of file freenect.py.
| def freenect::depth_cb_decorator | ( | func | ) |
Converts the raw depth data into a python string
Args:
func: A function that takes (dev, data, timestamp), corresponding to C function
except that data is a python string corresponding to the data.
Returns:
Function that takes (dev, depth, timestamp) that returns output of func
Definition at line 215 of file freenect.py.
| def freenect::depth_cb_np | ( | dev, | ||
| string, | ||||
| timestamp | ||||
| ) |
Converts the raw depth data into a numpy array for your function
Args:
dev: DevPtr object
string: A python string with the depth data
timestamp: An int representing the time
Returns:
(dev, data, timestamp) where data is a 2D numpy array
Definition at line 250 of file freenect.py.
| def freenect::mks_accel | ( | dev | ) |
Convenience wrapper for mks accelerometers
Args:
dev: ctypes dev pointer
Returns:
Tuple of (x, y, z) as ctype.c_double values
Definition at line 160 of file freenect.py.
| def freenect::raw_accel | ( | dev | ) |
Convenience wrapper for raw accelerometers
Args:
dev: ctypes dev pointer
Returns:
Tuple of (x, y, z) as ctype.c_int16 values
Definition at line 145 of file freenect.py.
| def freenect::rgb_cb_decorator | ( | func | ) |
Converts the raw RGB data into a python string
Args:
func: A function that takes (dev, data, timestamp), corresponding to C function
except that data is a python string corresponding to the data.
Returns:
Function that takes (dev, rgb, timestamp) that returns output of func
Definition at line 232 of file freenect.py.
| def freenect::rgb_cb_np | ( | dev, | ||
| string, | ||||
| timestamp | ||||
| ) |
Converts the raw depth data into a numpy array for your function
Args:
dev: DevPtr object
string: A python string with the RGB data
timestamp: An int representing the time
Returns:
(dev, data, timestamp) where data is a 2D numpy array
Definition at line 268 of file freenect.py.
| def freenect::runloop | ( | depth = None, |
||
rgb = None | ||||
| ) |
Sets up the kinect and maintains a runloop
This is where most of the action happens. You can get the dev pointer from the callback
and let this function do all of the setup for you. You may want to use threads to perform
computation externally as the callbacks should really just be used for copying data.
Args:
depth: A function that takes (dev, depth, timestamp), corresponding to C function.
If None (default), then you won't get a callback for depth.
rgb: A function that takes (dev, rgb, timestamp), corresponding to C function.
If None (default), then you won't get a callback for rgb.
Definition at line 175 of file freenect.py.
| int freenect::FORMAT_10_BIT = 1 |
Definition at line 30 of file freenect.py.
| int freenect::FORMAT_11_BIT = 0 |
Definition at line 29 of file freenect.py.
| int freenect::FORMAT_BAYER = 1 |
Definition at line 28 of file freenect.py.
| int freenect::FORMAT_RGB = 0 |
Definition at line 27 of file freenect.py.
| int freenect::LED_BLINK_GREEN = 5 |
Definition at line 36 of file freenect.py.
| int freenect::LED_BLINK_RED_YELLOW = 6 |
Definition at line 37 of file freenect.py.
| int freenect::LED_BLINK_YELLOW = 4 |
Definition at line 35 of file freenect.py.
| int freenect::LED_GREEN = 1 |
Definition at line 32 of file freenect.py.
| int freenect::LED_OFF = 0 |
Definition at line 31 of file freenect.py.
| int freenect::LED_RED = 2 |
Definition at line 33 of file freenect.py.
| int freenect::LED_YELLOW = 3 |
Definition at line 34 of file freenect.py.