|
|
@ -46,7 +46,13 @@ class AP_InertialSensor : AP_AccelCal_Client |
|
|
|
friend class AP_InertialSensor_Backend; |
|
|
|
friend class AP_InertialSensor_Backend; |
|
|
|
|
|
|
|
|
|
|
|
public: |
|
|
|
public: |
|
|
|
AP_InertialSensor(); |
|
|
|
static AP_InertialSensor create() { return AP_InertialSensor{}; } |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
constexpr AP_InertialSensor(AP_InertialSensor &&other) = default; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* Do not allow copies */ |
|
|
|
|
|
|
|
AP_InertialSensor(const AP_InertialSensor &other) = delete; |
|
|
|
|
|
|
|
AP_InertialSensor &operator=(const AP_InertialSensor&) = delete; |
|
|
|
|
|
|
|
|
|
|
|
static AP_InertialSensor *get_instance(); |
|
|
|
static AP_InertialSensor *get_instance(); |
|
|
|
|
|
|
|
|
|
|
@ -137,7 +143,7 @@ public: |
|
|
|
// get observed sensor rates, including any internal sampling multiplier
|
|
|
|
// get observed sensor rates, including any internal sampling multiplier
|
|
|
|
uint16_t get_gyro_rate_hz(uint8_t instance) const { return uint16_t(_gyro_raw_sample_rates[instance] * _gyro_over_sampling[instance]); } |
|
|
|
uint16_t get_gyro_rate_hz(uint8_t instance) const { return uint16_t(_gyro_raw_sample_rates[instance] * _gyro_over_sampling[instance]); } |
|
|
|
uint16_t get_accel_rate_hz(uint8_t instance) const { return uint16_t(_accel_raw_sample_rates[instance] * _accel_over_sampling[instance]); } |
|
|
|
uint16_t get_accel_rate_hz(uint8_t instance) const { return uint16_t(_accel_raw_sample_rates[instance] * _accel_over_sampling[instance]); } |
|
|
|
|
|
|
|
|
|
|
|
// get accel offsets in m/s/s
|
|
|
|
// get accel offsets in m/s/s
|
|
|
|
const Vector3f &get_accel_offsets(uint8_t i) const { return _accel_offset[i]; } |
|
|
|
const Vector3f &get_accel_offsets(uint8_t i) const { return _accel_offset[i]; } |
|
|
|
const Vector3f &get_accel_offsets(void) const { return get_accel_offsets(_primary_accel); } |
|
|
|
const Vector3f &get_accel_offsets(void) const { return get_accel_offsets(_primary_accel); } |
|
|
@ -261,8 +267,9 @@ public: |
|
|
|
|
|
|
|
|
|
|
|
// return time in microseconds of last update() call
|
|
|
|
// return time in microseconds of last update() call
|
|
|
|
uint32_t get_last_update_usec(void) const { return _last_update_usec; } |
|
|
|
uint32_t get_last_update_usec(void) const { return _last_update_usec; } |
|
|
|
|
|
|
|
|
|
|
|
private: |
|
|
|
private: |
|
|
|
|
|
|
|
AP_InertialSensor(); |
|
|
|
|
|
|
|
|
|
|
|
// load backend drivers
|
|
|
|
// load backend drivers
|
|
|
|
bool _add_backend(AP_InertialSensor_Backend *backend); |
|
|
|
bool _add_backend(AP_InertialSensor_Backend *backend); |
|
|
|