APM:Libraries
|
#include <AP_InertialSensor_Backend.h>
Public Types | |
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 | |
AP_InertialSensor_Backend (AP_InertialSensor &imu) | |
AP_InertialSensor_Backend (const AP_InertialSensor_Backend &that)=delete | |
virtual | ~AP_InertialSensor_Backend (void) |
virtual bool | update ()=0 |
virtual void | accumulate () |
virtual void | start () |
virtual AuxiliaryBus * | get_auxiliary_bus () |
int16_t | get_id () const |
void | notify_fifo_reset (void) |
Protected Member Functions | |
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) |
Protected Attributes | |
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] |
Private Member Functions | |
bool | should_log_imu_raw () const |
void | log_accel_raw (uint8_t instance, const uint64_t sample_us, const Vector3f &accel) |
void | log_gyro_raw (uint8_t instance, const uint64_t sample_us, const Vector3f &gryo) |
Definition at line 41 of file AP_InertialSensor_Backend.h.
Definition at line 91 of file AP_InertialSensor_Backend.h.
AP_InertialSensor_Backend::AP_InertialSensor_Backend | ( | AP_InertialSensor & | imu | ) |
Definition at line 14 of file AP_InertialSensor_Backend.cpp.
|
delete |
|
inlinevirtual |
Definition at line 49 of file AP_InertialSensor_Backend.h.
|
inlineprotected |
Definition at line 218 of file AP_InertialSensor_Backend.h.
Referenced by update_accel().
|
inlineprotected |
Definition at line 180 of file AP_InertialSensor_Backend.h.
Referenced by update_accel().
|
inlineprotected |
Definition at line 221 of file AP_InertialSensor_Backend.h.
Referenced by update_gyro().
|
inlineprotected |
Definition at line 190 of file AP_InertialSensor_Backend.h.
Referenced by update_gyro().
|
protected |
Definition at line 393 of file AP_InertialSensor_Backend.cpp.
Referenced by AP_InertialSensor_LSM9DS1::_poll_data(), AP_InertialSensor_LSM9DS0::_poll_data(), and AP_InertialSensor_Invensense::_read_fifo().
|
protected |
Definition at line 399 of file AP_InertialSensor_Backend.cpp.
Referenced by AP_InertialSensor_LSM9DS0::_poll_data(), and AP_InertialSensor_Invensense::_read_fifo().
|
protected |
Definition at line 276 of file AP_InertialSensor_Backend.cpp.
Referenced by AP_InertialSensor_L3G4200D::_accumulate(), AP_InertialSensor_Invensense::_accumulate(), AP_InertialSensor_Invensense::_accumulate_sensor_rate_sampling(), AP_InertialSensor_PX4::_new_accel_sample(), AP_InertialSensor_LSM9DS0::_read_data_transaction_a(), AP_InertialSensor_LSM9DS1::_read_data_transaction_x(), AP_InertialSensor_BMI160::_read_fifo(), AP_InertialSensor_RST::accel_measure(), and AP_InertialSensor_SITL::generate_accel().
|
protected |
Definition at line 332 of file AP_InertialSensor_Backend.cpp.
Referenced by AP_InertialSensor_Invensense::_accumulate_sensor_rate_sampling().
|
protected |
Definition at line 144 of file AP_InertialSensor_Backend.cpp.
Referenced by AP_InertialSensor_L3G4200D::_accumulate(), AP_InertialSensor_Invensense::_accumulate(), AP_InertialSensor_Invensense::_accumulate_sensor_rate_sampling(), AP_InertialSensor_PX4::_new_gyro_sample(), AP_InertialSensor_LSM9DS1::_read_data_transaction_g(), AP_InertialSensor_LSM9DS0::_read_data_transaction_g(), AP_InertialSensor_BMI160::_read_fifo(), AP_InertialSensor_SITL::generate_gyro(), and AP_InertialSensor_RST::gyro_measure().
|
protected |
Definition at line 341 of file AP_InertialSensor_Backend.cpp.
Referenced by AP_InertialSensor_Invensense::_accumulate_sensor_rate_sampling().
|
protected |
Definition at line 246 of file AP_InertialSensor_Backend.cpp.
Referenced by update_accel().
|
protected |
Definition at line 133 of file AP_InertialSensor_Backend.cpp.
Referenced by update_gyro().
|
protected |
Definition at line 414 of file AP_InertialSensor_Backend.cpp.
Referenced by AP_InertialSensor_PX4::_new_accel_sample(), and AP_InertialSensor_Invensense::update().
|
protected |
Definition at line 87 of file AP_InertialSensor_Backend.cpp.
Referenced by AP_InertialSensor_L3G4200D::_accumulate(), AP_InertialSensor_Invensense::_accumulate(), AP_InertialSensor_Invensense::_accumulate_sensor_rate_sampling(), AP_InertialSensor_PX4::_new_accel_sample(), AP_InertialSensor_LSM9DS0::_read_data_transaction_a(), AP_InertialSensor_LSM9DS1::_read_data_transaction_x(), AP_InertialSensor_BMI160::_read_fifo(), AP_InertialSensor_RST::accel_measure(), and AP_InertialSensor_SITL::generate_accel().
|
protected |
Definition at line 115 of file AP_InertialSensor_Backend.cpp.
Referenced by AP_InertialSensor_L3G4200D::_accumulate(), AP_InertialSensor_Invensense::_accumulate(), AP_InertialSensor_Invensense::_accumulate_sensor_rate_sampling(), AP_InertialSensor_PX4::_new_gyro_sample(), AP_InertialSensor_LSM9DS1::_read_data_transaction_g(), AP_InertialSensor_LSM9DS0::_read_data_transaction_g(), AP_InertialSensor_BMI160::_read_fifo(), AP_InertialSensor_SITL::generate_gyro(), and AP_InertialSensor_RST::gyro_measure().
|
protected |
Definition at line 381 of file AP_InertialSensor_Backend.cpp.
Referenced by AP_InertialSensor_PX4::_new_accel_sample().
|
protected |
Definition at line 374 of file AP_InertialSensor_Backend.cpp.
Referenced by AP_InertialSensor_LSM9DS0::start(), and AP_InertialSensor_LSM9DS1::start().
|
protected |
Definition at line 39 of file AP_InertialSensor_Backend.cpp.
Referenced by AP_InertialSensor_Invensense::_set_filter_register().
|
inlineprotected |
Definition at line 185 of file AP_InertialSensor_Backend.h.
Referenced by AP_InertialSensor_Invensense::start().
|
inlineprotected |
Definition at line 148 of file AP_InertialSensor_Backend.h.
Referenced by AP_InertialSensor_Invensense::_set_filter_register().
|
protected |
Definition at line 387 of file AP_InertialSensor_Backend.cpp.
Referenced by AP_InertialSensor_PX4::_new_gyro_sample().
|
protected |
Definition at line 45 of file AP_InertialSensor_Backend.cpp.
Referenced by AP_InertialSensor_Invensense::_set_filter_register().
|
inlineprotected |
Definition at line 195 of file AP_InertialSensor_Backend.h.
Referenced by AP_InertialSensor_Invensense::start().
|
inlineprotected |
Definition at line 157 of file AP_InertialSensor_Backend.h.
Referenced by AP_InertialSensor_Invensense::_set_filter_register().
|
inlineprotected |
Definition at line 169 of file AP_InertialSensor_Backend.h.
|
inlineprotected |
Definition at line 166 of file AP_InertialSensor_Backend.h.
Referenced by AP_InertialSensor_Invensense::start().
|
protected |
Definition at line 57 of file AP_InertialSensor_Backend.cpp.
Referenced by _notify_new_accel_raw_sample(), and _notify_new_gyro_raw_sample().
|
inlinevirtual |
Reimplemented in AP_InertialSensor_Revo, AP_InertialSensor_Invensense, and AP_InertialSensor_PX4.
Definition at line 61 of file AP_InertialSensor_Backend.h.
Referenced by AP_InertialSensor::wait_for_sample().
|
inlineprotected |
Definition at line 251 of file AP_InertialSensor_Backend.h.
Referenced by AP_InertialSensor_Invensense::_set_filter_register().
|
inlinevirtual |
Reimplemented in AP_InertialSensor_Invensense.
Definition at line 72 of file AP_InertialSensor_Backend.h.
Referenced by AP_InertialSensor::get_auxiliary_bus().
|
inline |
Definition at line 78 of file AP_InertialSensor_Backend.h.
Referenced by AP_InertialSensor::_find_backend().
|
protected |
Definition at line 405 of file AP_InertialSensor_Backend.cpp.
Referenced by AP_InertialSensor_PX4::_queue_depth(), and AP_InertialSensor_Invensense::_set_filter_register().
|
inlineprotected |
Definition at line 246 of file AP_InertialSensor_Backend.h.
Referenced by AP_InertialSensor_Invensense::_accumulate_sensor_rate_sampling().
|
private |
Definition at line 349 of file AP_InertialSensor_Backend.cpp.
Referenced by _notify_new_accel_raw_sample().
|
private |
Definition at line 218 of file AP_InertialSensor_Backend.cpp.
Referenced by _notify_new_gyro_raw_sample().
|
protected |
Definition at line 23 of file AP_InertialSensor_Backend.cpp.
Referenced by AP_InertialSensor_LSM9DS1::_fifo_reset(), and AP_InertialSensor_Invensense::_fifo_reset().
void AP_InertialSensor_Backend::notify_fifo_reset | ( | void | ) |
|
protected |
Definition at line 32 of file AP_InertialSensor_Backend.cpp.
Referenced by AP_InertialSensor_LSM9DS1::_fifo_reset(), and AP_InertialSensor_Invensense::_fifo_reset().
|
inlineprotected |
Definition at line 240 of file AP_InertialSensor_Backend.h.
Referenced by AP_InertialSensor_LSM9DS0::start(), AP_InertialSensor_LSM9DS1::start(), AP_InertialSensor_RST::start(), and AP_InertialSensor_Invensense::start().
|
inlineprotected |
Definition at line 236 of file AP_InertialSensor_Backend.h.
Referenced by AP_InertialSensor_LSM9DS0::start(), AP_InertialSensor_LSM9DS1::start(), AP_InertialSensor_RST::start(), and AP_InertialSensor_Invensense::start().
|
private |
Definition at line 470 of file AP_InertialSensor_Backend.cpp.
Referenced by log_accel_raw(), and log_gyro_raw().
|
inlinevirtual |
Reimplemented in AP_InertialSensor_Revo, AP_InertialSensor_Invensense, AP_InertialSensor_RST, AP_InertialSensor_BMI160, AP_InertialSensor_L3G4200D, AP_InertialSensor_LSM9DS1, and AP_InertialSensor_LSM9DS0.
Definition at line 67 of file AP_InertialSensor_Backend.h.
Referenced by AP_InertialSensor::_start_backends().
|
pure virtual |
Implemented in AP_InertialSensor_Revo, AP_InertialSensor_Invensense, AP_InertialSensor_BMI160, AP_InertialSensor_RST, AP_InertialSensor_L3G4200D, AP_InertialSensor_PX4, AP_InertialSensor_LSM9DS1, AP_InertialSensor_LSM9DS0, AP_InertialSensor_SITL, and AP_InertialSensor_HIL.
Referenced by AP_InertialSensor::update().
|
protected |
Definition at line 450 of file AP_InertialSensor_Backend.cpp.
Referenced by AP_InertialSensor_LSM9DS0::update(), AP_InertialSensor_SITL::update(), AP_InertialSensor_LSM9DS1::update(), AP_InertialSensor_PX4::update(), AP_InertialSensor_L3G4200D::update(), AP_InertialSensor_RST::update(), AP_InertialSensor_BMI160::update(), and AP_InertialSensor_Invensense::update().
|
protected |
Definition at line 427 of file AP_InertialSensor_Backend.cpp.
Referenced by AP_InertialSensor_LSM9DS0::update(), AP_InertialSensor_SITL::update(), AP_InertialSensor_LSM9DS1::update(), AP_InertialSensor_PX4::update(), AP_InertialSensor_L3G4200D::update(), AP_InertialSensor_RST::update(), AP_InertialSensor_BMI160::update(), and AP_InertialSensor_Invensense::update().
|
protected |
Definition at line 215 of file AP_InertialSensor_Backend.h.
Referenced by AP_InertialSensor_Invensense::probe().
|
protected |
Definition at line 111 of file AP_InertialSensor_Backend.h.
Referenced by _inc_accel_error_count(), _inc_gyro_error_count(), AP_InertialSensor_HIL::_init_sensor(), AP_InertialSensor_PX4::_init_sensor(), _notify_new_accel_raw_sample(), _notify_new_accel_sensor_rate_sample(), _notify_new_gyro_raw_sample(), _notify_new_gyro_sensor_rate_sample(), _publish_accel(), _publish_gyro(), _publish_temperature(), _rotate_and_correct_accel(), _rotate_and_correct_gyro(), _set_accel_error_count(), _set_accel_max_abs_offset(), _set_accel_oversampling(), _set_gyro_error_count(), _set_gyro_oversampling(), get_sample_rate_hz(), AP_InertialSensor_SITL::init_sensor(), log_accel_raw(), log_gyro_raw(), notify_accel_fifo_reset(), notify_gyro_fifo_reset(), should_log_imu_raw(), AP_InertialSensor_LSM9DS0::start(), AP_InertialSensor_LSM9DS1::start(), AP_InertialSensor_L3G4200D::start(), AP_InertialSensor_BMI160::start(), AP_InertialSensor_RST::start(), AP_InertialSensor_Invensense::start(), update_accel(), and update_gyro().
|
protected |
Definition at line 233 of file AP_InertialSensor_Backend.h.
Referenced by update_accel().
|
protected |
Definition at line 234 of file AP_InertialSensor_Backend.h.
Referenced by update_gyro().
|
protected |
Definition at line 114 of file AP_InertialSensor_Backend.h.
Referenced by _notify_new_accel_raw_sample(), _notify_new_gyro_raw_sample(), AP_InertialSensor_Backend(), update_accel(), and update_gyro().