MAV'RIC
Public Member Functions
Lsm330dlc Class Reference

Driver for sensor LSM330DLC. More...

#include <lsm330dlc.hpp>

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

List of all members.

Public Member Functions

 Lsm330dlc (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 LSM330DLC.

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


Constructor & Destructor Documentation

Constructor.

Parameters:
i2cReference to I2C device

Member Function Documentation

const std::array< float, 3 > & Lsm330dlc::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 & Lsm330dlc::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 & Lsm330dlc::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 & Lsm330dlc::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 > & Lsm330dlc::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 & Lsm330dlc::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 & Lsm330dlc::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 & Lsm330dlc::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 Lsm330dlc::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

< CTRL_REG_G_1

< CTRL_REG_G_2

< CTRL_REG_G_3

< CTRL_REG_G_4

< CTRL_REG_G_5

< CTRL_REG_A_1

< CTRL_REG_A_2

< CTRL_REG_A_3

< CTRL_REG_A_4

Implements Accelerometer.

Here is the call graph for this function:

Here is the caller graph for this function:

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

Get last update time in microseconds.

Returns:
Update time

Implements Accelerometer.

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

Get sensor temperature.

Returns:
Value

Implements Accelerometer.

bool Lsm330dlc::update_acc ( void  ) [virtual]

Main update function.

Get new data from the sensor

Returns:
true Success
false Failed

Implements Lsm330dlc_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