IMU More...

Files

file  imu.h
 Sensor API for inertial measurement unit (IMU) readings.
 

Data Structures

struct  k_sensor_vector_t
 3D IMU vector More...
 
struct  k_position_vector_t
 Quaternion absolute position vector. More...
 

Functions

KSensorStatus k_initialize_imu_sensor (void)
 Setup the IMU interface and any related sensors. More...
 
KSensorStatus k_get_gyro (k_sensor_vector_t *gyro)
 Reads gyroscope data from the related sensor. More...
 
KSensorStatus k_get_compass (k_sensor_vector_t *mag)
 Reads magnetometer data from the related sensor. More...
 
KSensorStatus k_get_acceleration (k_sensor_vector_t *accel)
 Reads accelerometer data from the related sensor. More...
 
KSensorStatus k_get_absolute_position (k_position_vector_t *pos)
 Computes absolute position in a quaternion vector using sensor fusion. More...
 

Variables

double k_sensor_vector_t::x
 
double k_sensor_vector_t::y
 
double k_sensor_vector_t::z
 
double k_position_vector_t::w
 
double k_position_vector_t::x
 
double k_position_vector_t::y
 
double k_position_vector_t::z
 

Function Documentation

KSensorStatus k_get_absolute_position ( k_position_vector_t pos)

Computes absolute position in a quaternion vector using sensor fusion.

Parameters
pospointer to quaternion position struct
Returns
KSensorStatus, SENSOR_OK on success, SENSOR_NOT_FOUND, SENSOR_READ_ERROR, SENSOR_WRITE_ERROR on error
KSensorStatus k_get_acceleration ( k_sensor_vector_t accel)

Reads accelerometer data from the related sensor.

Parameters
accelpointer to 3D IMU vector struct
Returns
KSensorStatus, SENSOR_OK on success, SENSOR_NOT_FOUND, SENSOR_READ_ERROR, SENSOR_WRITE_ERROR on error
KSensorStatus k_get_compass ( k_sensor_vector_t mag)

Reads magnetometer data from the related sensor.

Parameters
magpointer to 3D IMU vector struct
Returns
KSensorStatus, SENSOR_OK on success, SENSOR_NOT_FOUND, SENSOR_READ_ERROR, SENSOR_WRITE_ERROR on error
KSensorStatus k_get_gyro ( k_sensor_vector_t gyro)

Reads gyroscope data from the related sensor.

Parameters
gyropointer to 3D IMU vector struct
Returns
KSensorStatus, SENSOR_OK on success, SENSOR_NOT_FOUND, SENSOR_READ_ERROR, SENSOR_WRITE_ERROR on error
KSensorStatus k_initialize_imu_sensor ( void  )

Setup the IMU interface and any related sensors.

Returns
KSensorStatus, SENSOR_OK on success, SENSOR_WRITE_ERROR, SENSOR_NOT_FOUND or SENSOR_NOT_CALIBRATED on error

Variable Documentation

double k_position_vector_t::w
double k_sensor_vector_t::x
double k_position_vector_t::x
double k_sensor_vector_t::y
double k_position_vector_t::y
double k_sensor_vector_t::z
double k_position_vector_t::z