#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <math.h>
#include "freenect_internal.h"
Go to the source code of this file.
|
FN_INTERNAL int | fnusb_set_led_alt (libusb_device_handle *dev, freenect_context *ctx, freenect_led_options state) |
|
void | freenect_get_mks_accel (freenect_raw_tilt_state *state, double *x, double *y, double *z) |
|
double | freenect_get_tilt_degs (freenect_raw_tilt_state *state) |
|
freenect_raw_tilt_state * | freenect_get_tilt_state (freenect_device *dev) |
|
freenect_tilt_status_code | freenect_get_tilt_status (freenect_raw_tilt_state *state) |
|
int | freenect_set_led (freenect_device *dev, freenect_led_options option) |
|
int | freenect_set_led_alt (freenect_device *dev, freenect_led_options state) |
|
int | freenect_set_tilt_degs (freenect_device *dev, double angle) |
|
int | freenect_set_tilt_degs_alt (freenect_device *dev, int tilt_degrees) |
|
int | freenect_update_tilt_state (freenect_device *dev) |
|
int | get_reply (libusb_device_handle *dev, freenect_context *ctx) |
|
int | update_tilt_state_alt (freenect_device *dev) |
|
#define MAX_TILT_ANGLE 31 |
#define MIN_TILT_ANGLE (-31) |
Get the axis-based gravity adjusted accelerometer state, as laid out via the accelerometer data sheet, which is available at
http://www.kionix.com/Product%20Sheets/KXSD9%20Product%20Brief.pdf
- Parameters
-
state | State to extract accelerometer data from |
x | Stores X-axis accelerometer state |
y | Stores Y-axis accelerometer state |
z | Stores Z-axis accelerometer state |
Definition at line 318 of file tilt.c.
Return the tilt state, in degrees with respect to the horizon
- Parameters
-
state | The tilt state struct from a device |
- Returns
- Current degree of tilt of the device
Definition at line 308 of file tilt.c.
Retrieve the tilt state from a device
- Parameters
-
dev | Device to retrieve tilt state from |
- Returns
- The tilt state struct of the device
Definition at line 95 of file tilt.c.
Return the movement state of the tilt motor (moving, stopped, etc...)
- Parameters
-
state | Raw state struct to get the tilt status code from |
- Returns
- Status code of the tilt device. See freenect_tilt_status_code enum for more info.
Definition at line 313 of file tilt.c.
Set the state of the LED. Uses blocking control message call to update device.
- Parameters
-
dev | Device to set the LED state |
option | LED state to set on device. See freenect_led_options enum. |
- Returns
- 0 on success, < 0 on error
Definition at line 290 of file tilt.c.
Set the tilt state of the device, in degrees with respect to the horizon. Uses blocking control message call to update device. Function return does not reflect state of device, device may still be moving to new position after the function returns. Use freenect_get_tilt_status() to find current movement state.
- Parameters
-
dev | Device to set tilt state |
angle | Angle the device should tilt to |
- Returns
- 0 on success, < 0 on error.
Definition at line 216 of file tilt.c.
Updates the accelerometer state using a blocking control message call.
- Parameters
-
dev | Device to get accelerometer data from |
- Returns
- 0 on success, < 0 on error. Accelerometer data stored to device struct.
Definition at line 153 of file tilt.c.