APM:Libraries
|
#include <AP_InertialSensor_Revo.h>
Public Types | |
enum | Invensense_Type { Invensense_MPU6000 =0, Invensense_MPU6500, Invensense_MPU9250, Invensense_ICM20608, Invensense_ICM20602 } |
![]() | |
enum | DevTypes { DEVTYPE_BMI160 = 0x09, DEVTYPE_L3G4200D = 0x10, DEVTYPE_ACC_LSM303D = 0x11, DEVTYPE_ACC_BMA180 = 0x12, DEVTYPE_ACC_MPU6000 = 0x13, DEVTYPE_ACC_MPU9250 = 0x16, DEVTYPE_ACC_IIS328DQ = 0x17, DEVTYPE_ACC_LSM9DS1 = 0x18, DEVTYPE_GYR_MPU6000 = 0x21, DEVTYPE_GYR_L3GD20 = 0x22, DEVTYPE_GYR_MPU9250 = 0x24, DEVTYPE_GYR_I3G4250D = 0x25, DEVTYPE_GYR_LSM9DS1 = 0x26, DEVTYPE_INS_ICM20789 = 0x27, DEVTYPE_INS_ICM20689 = 0x28 } |
Public Member Functions | |
virtual | ~AP_InertialSensor_Revo () |
bool | update () override |
void | accumulate () override |
void | start () override |
void | _isr () |
void | _ioc () |
![]() | |
AP_InertialSensor_Backend (AP_InertialSensor &imu) | |
AP_InertialSensor_Backend (const AP_InertialSensor_Backend &that)=delete | |
virtual | ~AP_InertialSensor_Backend (void) |
virtual AuxiliaryBus * | get_auxiliary_bus () |
int16_t | get_id () const |
void | notify_fifo_reset (void) |
Static Public Member Functions | |
static AP_InertialSensor_Revo & | from (AP_InertialSensor_Backend &backend) |
static AP_InertialSensor_Backend * | probe (AP_InertialSensor &imu, AP_HAL::OwnPtr< AP_HAL::I2CDevice > dev, enum Rotation rotation=ROTATION_NONE) |
static AP_InertialSensor_Backend * | probe (AP_InertialSensor &imu, AP_HAL::OwnPtr< AP_HAL::SPIDevice > dev, enum Rotation rotation=ROTATION_NONE) |
Private Member Functions | |
AP_InertialSensor_Revo (AP_InertialSensor &imu, AP_HAL::OwnPtr< AP_HAL::Device > dev, enum Rotation rotation) | |
bool | _init () |
bool | _hardware_init () |
bool | _check_whoami () |
void | _start () |
void | _set_filter_register (void) |
void | _read_fifo () |
bool | _data_ready () |
void | _poll_data () |
bool | _block_read (uint8_t reg, uint8_t *buf, uint32_t size) |
uint8_t | _register_read (uint8_t reg) |
void | _register_write (uint8_t reg, uint8_t val, bool checked=false) |
bool | _accumulate (uint8_t *samples, uint8_t n_samples) |
bool | _accumulate_sensor_rate_sampling (uint8_t *samples, uint8_t n_samples) |
bool | _check_raw_temp (int16_t t2) |
Private Attributes | |
friend | AP_Invensense_AuxiliaryBus |
int16_t | _raw_temp |
uint8_t | _gyro_instance |
uint8_t | _accel_instance |
uint16_t | _error_count |
float | temp_sensitivity = 1.0/340 |
float | temp_zero = 36.53 |
float | _temp_filtered |
float | _accel_scale |
LowPassFilter2pFloat | _temp_filter |
enum Rotation | _rotation |
AP_HAL::DigitalSource * | _drdy_pin |
AP_HAL::OwnPtr< AP_HAL::Device > | _dev |
enum Invensense_Type | _mpu_type |
uint8_t | product_id |
bool | _fast_sampling |
uint8_t | _last_stat_user_ctrl |
uint8_t * | _fifo_buffer |
struct { | |
Vector3f accel | |
Vector3f gyro | |
uint8_t count | |
LowPassFilterVector3f accel_filter {4000, 188} | |
LowPassFilterVector3f gyro_filter {8000, 188} | |
} | _accum |
uint16_t | read_ptr |
volatile uint16_t | write_ptr |
uint16_t | nodata_count |
void * | task_handle |
float | accel_len |
uint32_t | last_sample |
Vector3f | gyro_mean |
Additional Inherited Members | |
![]() | |
void | _rotate_and_correct_accel (uint8_t instance, Vector3f &accel) |
void | _rotate_and_correct_gyro (uint8_t instance, Vector3f &gyro) |
void | _publish_gyro (uint8_t instance, const Vector3f &gyro) |
void | _notify_new_gyro_raw_sample (uint8_t instance, const Vector3f &accel, uint64_t sample_us=0) |
void | _publish_accel (uint8_t instance, const Vector3f &accel) |
void | _notify_new_accel_raw_sample (uint8_t instance, const Vector3f &accel, uint64_t sample_us=0, bool fsync_set=false) |
void | _set_accel_oversampling (uint8_t instance, uint8_t n) |
void | _set_gyro_oversampling (uint8_t instance, uint8_t n) |
void | _set_accel_sensor_rate_sampling_enabled (uint8_t instance, bool value) |
void | _set_gyro_sensor_rate_sampling_enabled (uint8_t instance, bool value) |
void | _set_raw_sample_accel_multiplier (uint8_t instance, uint16_t mul) |
void | _set_raw_sampl_gyro_multiplier (uint8_t instance, uint16_t mul) |
void | _update_sensor_rate (uint16_t &count, uint32_t &start_us, float &rate_hz) const |
void | _set_accel_max_abs_offset (uint8_t instance, float offset) |
uint32_t | _accel_raw_sample_rate (uint8_t instance) const |
void | _set_accel_raw_sample_rate (uint8_t instance, uint16_t rate_hz) |
uint32_t | _gyro_raw_sample_rate (uint8_t instance) const |
void | _set_gyro_raw_sample_rate (uint8_t instance, uint16_t rate_hz) |
void | _publish_temperature (uint8_t instance, float temperature) |
void | _set_accel_error_count (uint8_t instance, uint32_t error_count) |
void | _set_gyro_error_count (uint8_t instance, uint32_t error_count) |
void | _inc_accel_error_count (uint8_t instance) |
void | _inc_gyro_error_count (uint8_t instance) |
uint8_t | _accel_filter_cutoff (void) const |
uint8_t | _gyro_filter_cutoff (void) const |
uint16_t | get_sample_rate_hz (void) const |
void | update_gyro (uint8_t instance) |
void | update_accel (uint8_t instance) |
void | set_gyro_orientation (uint8_t instance, enum Rotation rotation) |
void | set_accel_orientation (uint8_t instance, enum Rotation rotation) |
void | increment_clip_count (uint8_t instance) |
bool | enable_fast_sampling (uint8_t instance) |
void | _notify_new_accel_sensor_rate_sample (uint8_t instance, const Vector3f &accel) |
void | _notify_new_gyro_sensor_rate_sample (uint8_t instance, const Vector3f &gyro) |
void | notify_accel_fifo_reset (uint8_t instance) |
void | notify_gyro_fifo_reset (uint8_t instance) |
![]() | |
AP_InertialSensor & | _imu |
AP_HAL::Semaphore * | _sem |
int16_t | _id = -1 |
int8_t | _last_accel_filter_hz [INS_MAX_INSTANCES] |
int8_t | _last_gyro_filter_hz [INS_MAX_INSTANCES] |
Definition at line 47 of file AP_InertialSensor_Revo.h.
Enumerator | |
---|---|
Invensense_MPU6000 | |
Invensense_MPU6500 | |
Invensense_MPU9250 | |
Invensense_ICM20608 | |
Invensense_ICM20602 |
Definition at line 75 of file AP_InertialSensor_Revo.h.
|
virtual |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
void AP_InertialSensor_Revo::_ioc | ( | ) |
void AP_InertialSensor_Revo::_isr | ( | ) |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
overridevirtual |
Reimplemented from AP_InertialSensor_Backend.
|
inlinestatic |
Definition at line 54 of file AP_InertialSensor_Revo.h.
|
static |
|
static |
|
overridevirtual |
Reimplemented from AP_InertialSensor_Backend.
|
overridevirtual |
Implements AP_InertialSensor_Backend.
|
private |
Definition at line 120 of file AP_InertialSensor_Revo.h.
|
private |
Definition at line 128 of file AP_InertialSensor_Revo.h.
struct { ... } AP_InertialSensor_Revo::_accum |
|
private |
Definition at line 134 of file AP_InertialSensor_Revo.h.
|
private |
Definition at line 133 of file AP_InertialSensor_Revo.h.
|
private |
Definition at line 122 of file AP_InertialSensor_Revo.h.
|
private |
Definition at line 141 of file AP_InertialSensor_Revo.h.
|
private |
Definition at line 147 of file AP_InertialSensor_Revo.h.
|
private |
Definition at line 119 of file AP_InertialSensor_Revo.h.
|
private |
Definition at line 144 of file AP_InertialSensor_Revo.h.
|
private |
Definition at line 137 of file AP_InertialSensor_Revo.h.
|
private |
Definition at line 116 of file AP_InertialSensor_Revo.h.
|
private |
Definition at line 131 of file AP_InertialSensor_Revo.h.
|
private |
Definition at line 129 of file AP_InertialSensor_Revo.h.
|
private |
Definition at line 127 of file AP_InertialSensor_Revo.h.
Vector3f AP_InertialSensor_Revo::accel |
Definition at line 155 of file AP_InertialSensor_Revo.h.
LowPassFilterVector3f AP_InertialSensor_Revo::accel_filter {4000, 188} |
Definition at line 158 of file AP_InertialSensor_Revo.h.
|
private |
Definition at line 166 of file AP_InertialSensor_Revo.h.
|
private |
Definition at line 49 of file AP_InertialSensor_Revo.h.
uint8_t AP_InertialSensor_Revo::count |
Definition at line 157 of file AP_InertialSensor_Revo.h.
Vector3f AP_InertialSensor_Revo::gyro |
Definition at line 156 of file AP_InertialSensor_Revo.h.
LowPassFilterVector3f AP_InertialSensor_Revo::gyro_filter {8000, 188} |
Definition at line 159 of file AP_InertialSensor_Revo.h.
|
private |
Definition at line 169 of file AP_InertialSensor_Revo.h.
|
private |
Definition at line 167 of file AP_InertialSensor_Revo.h.
|
private |
Definition at line 164 of file AP_InertialSensor_Revo.h.
|
private |
Definition at line 138 of file AP_InertialSensor_Revo.h.
|
private |
Definition at line 162 of file AP_InertialSensor_Revo.h.
|
private |
Definition at line 165 of file AP_InertialSensor_Revo.h.
|
private |
Definition at line 124 of file AP_InertialSensor_Revo.h.
|
private |
Definition at line 125 of file AP_InertialSensor_Revo.h.
|
private |
Definition at line 163 of file AP_InertialSensor_Revo.h.