Classes | Macros | Functions | Variables
tilt.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <math.h>
#include "freenect_internal.h"
Include dependency graph for tilt.c:

Go to the source code of this file.

Classes

struct  fn_alt_motor_command
 
struct  fn_alt_motor_reply
 

Macros

#define GRAVITY   9.80665
 
#define MAX_TILT_ANGLE   31
 
#define MIN_TILT_ANGLE   (-31)
 

Functions

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_statefreenect_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)
 

Variables

static int tag_next_ack = 0
 
static int tag_seq = 0
 

Macro Definition Documentation

#define GRAVITY   9.80665

Definition at line 40 of file tilt.c.

#define MAX_TILT_ANGLE   31

Definition at line 37 of file tilt.c.

#define MIN_TILT_ANGLE   (-31)

Definition at line 38 of file tilt.c.

Function Documentation

FN_INTERNAL int fnusb_set_led_alt ( libusb_device_handle dev,
freenect_context ctx,
freenect_led_options  state 
)

Definition at line 239 of file tilt.c.

void freenect_get_mks_accel ( freenect_raw_tilt_state state,
double *  x,
double *  y,
double *  z 
)

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
stateState to extract accelerometer data from
xStores X-axis accelerometer state
yStores Y-axis accelerometer state
zStores Z-axis accelerometer state

Definition at line 318 of file tilt.c.

double freenect_get_tilt_degs ( freenect_raw_tilt_state state)

Return the tilt state, in degrees with respect to the horizon

Parameters
stateThe tilt state struct from a device
Returns
Current degree of tilt of the device

Definition at line 308 of file tilt.c.

freenect_raw_tilt_state* freenect_get_tilt_state ( freenect_device dev)

Retrieve the tilt state from a device

Parameters
devDevice to retrieve tilt state from
Returns
The tilt state struct of the device

Definition at line 95 of file tilt.c.

freenect_tilt_status_code freenect_get_tilt_status ( freenect_raw_tilt_state state)

Return the movement state of the tilt motor (moving, stopped, etc...)

Parameters
stateRaw 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.

int freenect_set_led ( freenect_device dev,
freenect_led_options  option 
)

Set the state of the LED. Uses blocking control message call to update device.

Parameters
devDevice to set the LED state
optionLED 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.

int freenect_set_led_alt ( freenect_device dev,
freenect_led_options  state 
)

Definition at line 284 of file tilt.c.

int freenect_set_tilt_degs ( freenect_device dev,
double  angle 
)

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
devDevice to set tilt state
angleAngle the device should tilt to
Returns
0 on success, < 0 on error.

Definition at line 216 of file tilt.c.

int freenect_set_tilt_degs_alt ( freenect_device dev,
int  tilt_degrees 
)

Definition at line 187 of file tilt.c.

int freenect_update_tilt_state ( freenect_device dev)

Updates the accelerometer state using a blocking control message call.

Parameters
devDevice 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.

int get_reply ( libusb_device_handle dev,
freenect_context ctx 
)

Definition at line 60 of file tilt.c.

int update_tilt_state_alt ( freenect_device dev)

Definition at line 100 of file tilt.c.

Variable Documentation

int tag_next_ack = 0
static

Definition at line 58 of file tilt.c.

int tag_seq = 0
static

Definition at line 57 of file tilt.c.



libfreenect
Author(s): Hector Martin, Josh Blake, Kyle Machulis, OpenKinect community
autogenerated on Mon Jun 10 2019 13:46:43