MAV'RIC
Public Member Functions
Imu Class Reference

Inertial measurement unit (IMU) More...

#include <imu.hpp>

List of all members.

Public Member Functions

 Imu (Accelerometer &accelerometer, Gyroscope &gyroscope, Magnetometer &magnetometer, imu_conf_t config=imu_default_config())
 Constructor.
bool update (void)
 Main update.
const float & last_update_us (void) const
 Get last update time in microseconds.
const float & dt_s (void) const
 Get time between two last updates in seconds.
const std::array< float, 3 > & acc (void) const
 Get X, Y and Z components of acceleration in g.
const std::array< float, 3 > & gyro (void) const
 Get X, Y and Z components of angular velocity in rad/s.
const std::array< float, 3 > & mag (void) const
 Get X, Y and Z components of magnetic field (normalized)
const std::array< float, 3 > & magnetic_north (void) const
 Get X, Y and Z components of magnetic north (in NED frame)
bool is_ready (void) const
 Get the readiness of the IMU.
imu_conf_tget_config (void)
 Temporary method to get pointer to configuration.
bool start_accelerometer_bias_calibration (void)
 Start accelerometer bias calibration.
bool start_gyroscope_bias_calibration (void)
 Start gyroscope bias calibration.
bool start_magnetometer_bias_calibration (void)
 Start magnetometer bias calibration.
bool start_magnetic_north_calibration (void)
 Start calibration of magnetic field inclination.
bool stop_accelerometer_bias_calibration (void)
 Stop accelerometer bias calibration.
bool stop_gyroscope_bias_calibration (void)
 Stop gyroscope bias calibration.
bool stop_magnetometer_bias_calibration (void)
 Stop magnetometer bias calibration.
bool stop_magnetic_north_calibration (void)
 Stop calibration of magnetic inclination.

Detailed Description

Inertial measurement unit (IMU)

This module gathers new data from inertial sensors and takes care of rotating, removing bias, and scaling raw sensor values (in this order)

If this module is used, then it is not needed to call each sensor's update function.


Member Function Documentation

const std::array< float, 3 > & Imu::acc ( void  ) const

Get X, Y and Z components of acceleration in g.

Returns:
Value

Here is the caller graph for this function:

const float & Imu::dt_s ( void  ) const

Get time between two last updates in seconds.

Returns:
Value

Temporary method to get pointer to configuration.

Used to add onboard parameters for the biases and scales TODO: make it possible to set/get parameters via methods calls instead of via pointers and remove this method

const std::array< float, 3 > & Imu::gyro ( void  ) const

Get X, Y and Z components of angular velocity in rad/s.

Returns:
Value

Here is the caller graph for this function:

bool Imu::is_ready ( void  ) const

Get the readiness of the IMU.

Returns:
True if the IMU is ready, false otherwise

Here is the caller graph for this function:

const float & Imu::last_update_us ( void  ) const

Get last update time in microseconds.

Returns:
Value
const std::array< float, 3 > & Imu::mag ( void  ) const

Get X, Y and Z components of magnetic field (normalized)

Returns:
Value

Here is the caller graph for this function:

const std::array< float, 3 > & Imu::magnetic_north ( void  ) const

Get X, Y and Z components of magnetic north (in NED frame)

Returns:
Value

Here is the caller graph for this function:

Start accelerometer bias calibration.

Should not be used in flight Keep the platform perfectly level during the calibration phase

WARNING: Compatible with gyroscope bias calibration Incompatible with magnetometer bias calibration

Returns:
Success if not already started and no incompatible calibration ongoing

Start gyroscope bias calibration.

Should not be used in flight Keep the platform perfectly level during the calibration phase

WARNING: Compatible with accelerometer bias calibration Incompatible with magnetometer bias calibration

Returns:
Success if not already started and no incompatible calibration ongoing

Start calibration of magnetic field inclination.

Should not be used in flight Keep the platform perfectly stable during the calibration phase. It does not have to be perfectly leveled, but should not undergo parasitic accelerations.

WARNING: Incompatible with magnetometer bias calibration

Returns:
Success if not already started and no incompatible calibration ongoing

Start magnetometer bias calibration.

Should not be used in flight Rotate the platform in all possible orientation during calibration The goal is to capture the maximum and minimum values for each axis, (ie. have X, Y and Z axis of the UAV). Consecutively, each axis should be perfectly aligned, then perfectly opposed to the magnetic field. Note that the magnetic field is not horizontal !

WARNING: Incompatible with accelerometer and gyroscope bias calibration

Returns:
Success if not already started and no incompatible calibration ongoing

Stop accelerometer bias calibration.

Should not be used in flight

Returns:
Success if not already stopped

Stop gyroscope bias calibration.

Should not be used in flight

Returns:
Success if not already stopped

Stop calibration of magnetic inclination.

Should not be used in flight

Returns:
Success if not already stopped

Stop magnetometer bias calibration.

Should not be used in flight This function updates the magnetometer bias with the

Returns:
Success if not already stopped
bool Imu::update ( void  )

Main update.

Returns:
Success

Here is the call graph for this function:


The documentation for this class was generated from the following files:
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines