libyggdrasil  v1.0.0
bsp::ygg::prph::SixAxisSensor Class Reference

6 axis sensor driver ICM-42605 More...

#include <six_axis_sensor.hpp>

Classes

struct  Coordinate
 Coordinates. More...
 
struct  Orientation
 Absolute board orientation. More...
 

Public Types

enum  AccelFullScaleRange : u8 { AccelFullScaleRange::_2G = 0x03, AccelFullScaleRange::_4G = 0x02, AccelFullScaleRange::_8G = 0x01, AccelFullScaleRange::_16G = 0x00 }
 Accelerometer range. More...
 
enum  GyroFullScaleRange : u8 {
  GyroFullScaleRange::_2000DPS = 0x00, GyroFullScaleRange::_1000DPS = 0x01, GyroFullScaleRange::_500DPS = 0x02, GyroFullScaleRange::_250DPS = 0x03,
  GyroFullScaleRange::_125DPS = 0x04, GyroFullScaleRange::_62_5DPS = 0x05, GyroFullScaleRange::_31_25DPS = 0x06, GyroFullScaleRange::_15_125DPS = 0x07
}
 Gyroscope range. More...
 
enum  AccelOutputDataRange : u8 {
  AccelOutputDataRange::_8000Hz = 0x03, AccelOutputDataRange::_4000Hz = 0x04, AccelOutputDataRange::_2000Hz = 0x05, AccelOutputDataRange::_1000Hz = 0x06,
  AccelOutputDataRange::_500Hz = 0x0F, AccelOutputDataRange::_200Hz = 0x07, AccelOutputDataRange::_100Hz = 0x08, AccelOutputDataRange::_50Hz = 0x09,
  AccelOutputDataRange::_25Hz = 0x0A, AccelOutputDataRange::_12_5Hz = 0x0B, AccelOutputDataRange::_6_25Hz = 0x0C, AccelOutputDataRange::_3_125Hz = 0x0D,
  AccelOutputDataRange::_1_5625Hz = 0x0E
}
 Accelerometer data rate. More...
 
enum  GyroOutputDataRange : u8 {
  GyroOutputDataRange::_8000Hz = 0x03, GyroOutputDataRange::_4000Hz = 0x04, GyroOutputDataRange::_2000Hz = 0x05, GyroOutputDataRange::_1000Hz = 0x06,
  GyroOutputDataRange::_500Hz = 0x0F, GyroOutputDataRange::_200Hz = 0x07, GyroOutputDataRange::_100Hz = 0x08, GyroOutputDataRange::_50Hz = 0x09,
  GyroOutputDataRange::_25Hz = 0x0A, GyroOutputDataRange::_12_5Hz = 0x0B
}
 Gyroscope data rate. More...
 

Public Member Functions

 SixAxisSensor ()=delete
 

Static Public Member Functions

static bool init (AccelFullScaleRange accelScale=AccelFullScaleRange::_2G, GyroFullScaleRange gyroScale=GyroFullScaleRange::_250DPS, AccelOutputDataRange accelOdr=AccelOutputDataRange::_1000Hz, GyroOutputDataRange gyroOdr=GyroOutputDataRange::_1000Hz)
 Initializes the ICM-42605 Six Axis Sensor. More...
 
static Coordinate getRotation ()
 Get yggdrasil's current orientation from the gyroscope. More...
 
static Coordinate getAcceleration ()
 Get yggdrasil's current acceleration from the accelerometer. More...
 
static float getTemperature ()
 Get the internal temperature of the ICM-42605 sensor. More...
 
static Orientation getBoardOrientation ()
 Get yggdrasil's current orientation. More...
 

Detailed Description

6 axis sensor driver ICM-42605

Member Enumeration Documentation

◆ AccelFullScaleRange

Accelerometer range.

Enumerator
_2G 

Range from -2G to 2G with highest precision.

_4G 

Range from -4G to 4G.

_8G 

Range from -8G to 8G.

_16G 

Range from -16G to 16G with lowest precision.

◆ AccelOutputDataRange

Accelerometer data rate.

Enumerator
_8000Hz 

8000 measurements per second

_4000Hz 

4000 measurements per second

_2000Hz 

2000 measurements per second

_1000Hz 

1000 measurements per second

_500Hz 

500 measurements per second

_200Hz 

200 measurements per second

_100Hz 

100 measurements per second

_50Hz 

50 measurements per second

_25Hz 

25 measurements per second

_12_5Hz 

12.5 measurements per second

_6_25Hz 

6.25 measurements per second

_3_125Hz 

3.125 measurements per second

_1_5625Hz 

1.5625 measurements per second

◆ GyroFullScaleRange

Gyroscope range.

Note
DPS = degree per second
Enumerator
_2000DPS 

Range from -2000DPS to 2000DPS with lowest precision.

_1000DPS 

Range from -1000DPS to 1000DPS.

_500DPS 

Range from -500DPS to 500DPS.

_250DPS 

Range from -250DPS to 250DPS.

_125DPS 

Range from -125DPS to 125DPS.

_62_5DPS 

Range from -62.5DPS to 65.5DPS.

_31_25DPS 

Range from -31.25DPS to 31.25DPS.

_15_125DPS 

Range from -15.125DPS to 15.125DPS with highest precision.

◆ GyroOutputDataRange

Gyroscope data rate.

Enumerator
_8000Hz 

8000 measurements per second

_4000Hz 

4000 measurements per second

_2000Hz 

2000 measurements per second

_1000Hz 

1000 measurements per second

_500Hz 

500 measurements per second

_200Hz 

200 measurements per second

_100Hz 

100 measurements per second

_50Hz 

50 measurements per second

_25Hz 

25 measurements per second

_12_5Hz 

12.5 measurements per second

Constructor & Destructor Documentation

◆ SixAxisSensor()

bsp::ygg::prph::SixAxisSensor::SixAxisSensor ( )
delete

Member Function Documentation

◆ getAcceleration()

static Coordinate bsp::ygg::prph::SixAxisSensor::getAcceleration ( )
inlinestatic

Get yggdrasil's current acceleration from the accelerometer.

Returns
X, Y and Z acceleration axis values

◆ getBoardOrientation()

static Orientation bsp::ygg::prph::SixAxisSensor::getBoardOrientation ( )
inlinestatic

Get yggdrasil's current orientation.

Note
When the board is flat on a plain surface this function returns approximately 0 0
Returns
orientation (roll and pitch) in the range from -180 to 180

◆ getRotation()

static Coordinate bsp::ygg::prph::SixAxisSensor::getRotation ( )
inlinestatic

Get yggdrasil's current orientation from the gyroscope.

Returns
X, Y and Z rotation axis values

◆ getTemperature()

static float bsp::ygg::prph::SixAxisSensor::getTemperature ( )
inlinestatic

Get the internal temperature of the ICM-42605 sensor.

Returns
Temperature value

◆ init()

static bool bsp::ygg::prph::SixAxisSensor::init ( AccelFullScaleRange  accelScale = AccelFullScaleRange::_2G,
GyroFullScaleRange  gyroScale = GyroFullScaleRange::_250DPS,
AccelOutputDataRange  accelOdr = AccelOutputDataRange::_1000Hz,
GyroOutputDataRange  gyroOdr = GyroOutputDataRange::_1000Hz 
)
inlinestatic

Initializes the ICM-42605 Six Axis Sensor.

Parameters
accelScaleScaling factor of the Accelerometer
gyroScaleScaling factor of the Gyroscope
accelOdrOutput data rate of the Accelerometer
gyroOdrOutput data rate of the Gyroscope
Returns
Success

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