Public Types | Public Member Functions | Public Attributes | Protected Attributes

IMU Class Reference

#include <IMU.h>

Inherited by AP_IMU_Oilpan, and AP_IMU_Shim.

Collaboration diagram for IMU:
Collaboration graph
[legend]

List of all members.

Public Types

enum  Start_style { COLD_START = 0, WARM_START }

Public Member Functions

 IMU ()
 Constructor.
virtual void init (Start_style style)=0
virtual void init_accel (Start_style style)=0
virtual void init_gyro (Start_style style)=0
virtual bool update (void)=0
Vector3f get_gyro (void)
Vector3f get_accel (void)
void load_gyro_eeprom (void)
 XXX backwards compat hack.
void load_accel_eeprom (void)
 XXX backwards compat hack.

Public Attributes

uint8_t adc_constraints

Protected Attributes

Vector3f _accel
 Most recent accelerometer reading obtained by update.
Vector3f _gyro
 Most recent gyro reading obtained by update.

Detailed Description

Definition at line 13 of file IMU.h.


Member Enumeration Documentation

Enumerator:
COLD_START 
WARM_START 

Definition at line 20 of file IMU.h.


Constructor & Destructor Documentation

IMU::IMU (  )  [inline]

Constructor.

Definition at line 18 of file IMU.h.


Member Function Documentation

Vector3f IMU::get_accel ( void   )  [inline]

Fetch the current accelerometer values

Returns:
vector of current accelerations in m/s/s

Definition at line 75 of file IMU.h.

Vector3f IMU::get_gyro ( void   )  [inline]

Fetch the current gyro values

Returns:
vector of rotational rates in radians/sec

Definition at line 69 of file IMU.h.

virtual void IMU::init ( Start_style  style  )  [pure virtual]

Perform startup initialisation.

Called to initialise the state of the IMU.

For COLD_START, implementations using real sensors can assume that the airframe is stationary and nominally oriented.

For WARM_START, no assumptions should be made about the orientation or motion of the airframe. Calibration should be as for the previous COLD_START call.

Parameters:
style The initialisation startup style.

Implemented in AP_IMU_Oilpan, and AP_IMU_Shim.

virtual void IMU::init_accel ( Start_style  style  )  [pure virtual]

Perform startup initialisation for just the accelerometers.

Note:
This should not be called unless init has previously been called, as init may perform other work.
Parameters:
style The initialisation startup style.

Implemented in AP_IMU_Oilpan, and AP_IMU_Shim.

virtual void IMU::init_gyro ( Start_style  style  )  [pure virtual]

Perform cold-start initialisation for just the gyros.

Note:
This should not be called unless init has previously been called, as init may perform other work
Parameters:
style The initialisation startup style.

Implemented in AP_IMU_Oilpan, and AP_IMU_Shim.

void IMU::load_accel_eeprom ( void   )  [inline]

XXX backwards compat hack.

Definition at line 86 of file IMU.h.

void IMU::load_gyro_eeprom ( void   )  [inline]

XXX backwards compat hack.

Definition at line 85 of file IMU.h.

virtual bool IMU::update ( void   )  [pure virtual]

Give the IMU some cycles to perform/fetch an update from its sensors.

Returns:
True if some state was updated.

Implemented in AP_IMU_Oilpan, and AP_IMU_Shim.


Member Data Documentation

Vector3f IMU::_accel [protected]

Most recent accelerometer reading obtained by update.

Definition at line 90 of file IMU.h.

Vector3f IMU::_gyro [protected]

Most recent gyro reading obtained by update.

Definition at line 93 of file IMU.h.

A count of bad sensor readings

Todo:
This should be renamed, as there's no guarantee that sensors are using ADCs, etc.

Definition at line 82 of file IMU.h.


The documentation for this class was generated from the following file: