MAV'RIC
Public Member Functions
Mpu_6050 Class Reference

Driver for sensor MPU_6050 imu. More...

#include <mpu_6050.hpp>

Inheritance diagram for Mpu_6050:
Inheritance graph
[legend]
Collaboration diagram for Mpu_6050:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 Mpu_6050 (I2c &i2c)
 Constructor.
bool init (void)
 Initialise the sensor.
bool update_acc (void)
 Main update function.
bool update_gyr (void)
const float & last_update_us (void) const
 Get last update time in microseconds.
const std::array< float, 3 > & gyro (void) const
 Get X, Y and Z components of angular velocity.
const float & gyro_X (void) const
 Get X component of angular velocity.
const float & gyro_Y (void) const
 Get Y component of angular velocity.
const float & gyro_Z (void) const
 Get Z component of angular velocity.
const std::array< float, 3 > & acc (void) const
 Get X, Y and Z components of acceleration.
const float & acc_X (void) const
 Get X component of acceleration.
const float & acc_Y (void) const
 Get Y component of acceleration.
const float & acc_Z (void) const
 Get Z component of acceleration.
const float & temperature (void) const
 Get sensor temperature.

Detailed Description

Driver for sensor MPU_6050 imu.

This sensor is at the same time a accelerometer and a gyroscope The inherited method Accelerometer::update is implemented as MPU_6050::update_acc The inherited method Gyroscope::update is implemented as MPU_6050::update_gyr


Constructor & Destructor Documentation

Mpu_6050::Mpu_6050 ( I2c i2c)

Constructor.

Parameters:
i2cReference to I2C device

Member Function Documentation

const std::array< float, 3 > & Mpu_6050::acc ( void  ) const [virtual]

Get X, Y and Z components of acceleration.

This is raw data, so X, Y and Z components are biased, not scaled, and given in the sensor frame (not in the UAV frame). Use an Imu object to handle bias removal, scaling and axis rotations

Returns:
Value

Implements Accelerometer.

const float & Mpu_6050::acc_X ( void  ) const [virtual]

Get X component of acceleration.

This is raw data, so X, Y and Z components are biased, not scaled, and given in the sensor frame (not in the UAV frame). Use an Imu object to handle bias removal, scaling and axis rotations

Returns:
Value

Implements Accelerometer.

const float & Mpu_6050::acc_Y ( void  ) const [virtual]

Get Y component of acceleration.

This is raw data, so X, Y and Z components are biased, not scaled, and given in the sensor frame (not in the UAV frame). Use an Imu object to handle bias removal, scaling and axis rotations

Returns:
Value

Implements Accelerometer.

const float & Mpu_6050::acc_Z ( void  ) const [virtual]

Get Z component of acceleration.

This is raw data, so X, Y and Z components are biased, not scaled, and given in the sensor frame (not in the UAV frame). Use an Imu object to handle bias removal, scaling and axis rotations

Returns:
Value

Implements Accelerometer.

const std::array< float, 3 > & Mpu_6050::gyro ( void  ) const [virtual]

Get X, Y and Z components of angular velocity.

This is raw data, so X, Y and Z components are biased, not scaled, and given in the sensor frame (not in the UAV frame). Use an Imu object to handle bias removal, scaling and axis rotations

Returns:
Value

Implements Gyroscope.

const float & Mpu_6050::gyro_X ( void  ) const [virtual]

Get X component of angular velocity.

This is raw data, so X, Y and Z components are biased, not scaled, and given in the sensor frame (not in the UAV frame). Use an Imu object to handle bias removal, scaling and axis rotations

Returns:
Value

Implements Gyroscope.

const float & Mpu_6050::gyro_Y ( void  ) const [virtual]

Get Y component of angular velocity.

This is raw data, so X, Y and Z components are biased, not scaled, and given in the sensor frame (not in the UAV frame). Use an Imu object to handle bias removal, scaling and axis rotations

Returns:
Value

Implements Gyroscope.

const float & Mpu_6050::gyro_Z ( void  ) const [virtual]

Get Z component of angular velocity.

This is raw data, so X, Y and Z components are biased, not scaled, and given in the sensor frame (not in the UAV frame). Use an Imu object to handle bias removal, scaling and axis rotations

Returns:
Value

Implements Gyroscope.

bool Mpu_6050::init ( void  ) [virtual]

Initialise the sensor.

Sends configuration via I2C, the I2C peripheral must be activated before this method is called

Returns:
true Success
false Failed

Implements Accelerometer.

Here is the call graph for this function:

const float & Mpu_6050::last_update_us ( void  ) const [virtual]

Get last update time in microseconds.

Returns:
Update time

Implements Accelerometer.

const float & Mpu_6050::temperature ( void  ) const [virtual]

Get sensor temperature.

Returns:
Value

Implements Accelerometer.

bool Mpu_6050::update_acc ( void  ) [virtual]

Main update function.

Get new data from the sensor

Returns:
true Success
false Failed

Implements Mpu_6050_acc.

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