4 #define AP_INERTIAL_SENSOR_ACCEL_TOT_MAX_OFFSET_CHANGE 4.0f 5 #define AP_INERTIAL_SENSOR_ACCEL_MAX_OFFSET 250.0f 6 #define AP_INERTIAL_SENSOR_ACCEL_CLIP_THRESH_MSS (15.5f*GRAVITY_MSS) // accelerometer values over 15.5G are recorded as a clipping error 7 #define AP_INERTIAL_SENSOR_ACCEL_VIBE_FLOOR_FILT_HZ 5.0f // accel vibration floor filter hz 8 #define AP_INERTIAL_SENSOR_ACCEL_VIBE_FILT_HZ 2.0f // accel vibration filter hz 9 #define AP_INERTIAL_SENSOR_ACCEL_PEAK_DETECT_TIMEOUT_MS 500 // peak-hold detector timeout 15 #define INS_MAX_INSTANCES 3 16 #define INS_MAX_BACKENDS 6 17 #define INS_VIBRATION_CHECK_INSTANCES 2 19 #define DEFAULT_IMU_LOG_BAT_MASK 0 73 void init(uint16_t sample_rate_hz);
77 uint8_t
register_gyro(uint16_t raw_sample_rate_hz, uint32_t
id);
137 bool use_gyro(uint8_t instance)
const;
bool accel_cal_requires_reboot() const
struct AP_InertialSensor::@119 _hil
uint32_t get_last_update_usec(void) const
void set_delta_velocity(uint8_t instance, float deltavt, const Vector3f &deltav)
float get_accel_peak_hold_neg_x() const
uint32_t _accel_startup_error_count[INS_MAX_INSTANCES]
void set_delta_time(float delta_time)
static const struct AP_Param::GroupInfo var_info[]
uint32_t _next_sample_usec
uint32_t _accel_error_count[INS_MAX_INSTANCES]
static AP_InertialSensor * _s_instance
void _acal_save_calibrations()
const Vector3f & get_accel_scale(void) const
const Vector3f & get_accel(void) const
const Vector3f & get_imu_pos_offset(void) const
Vector3f _accel_filtered[INS_MAX_INSTANCES]
bool _gyro_healthy[INS_MAX_INSTANCES]
bool _new_gyro_data[INS_MAX_INSTANCES]
AP_InertialSensor::IMU_SENSOR_TYPE type
const Vector3f & get_gyro(uint8_t i) const
AP_Float _still_threshold
uint32_t _last_update_usec
void _acal_event_failure()
AP_Int8 _use[INS_MAX_INSTANCES]
uint8_t register_gyro(uint16_t raw_sample_rate_hz, uint32_t id)
uint8_t get_primary_gyro(void) const
float _accel_raw_sample_rates[INS_MAX_INSTANCES]
AP_Int8 _accel_filter_cutoff
void set_delta_angle(uint8_t instance, const Vector3f &deltaa, float deltaat)
uint8_t get_accel_filter_hz(void) const
AP_InertialSensor_Backend * _backends[INS_MAX_BACKENDS]
float get_temperature(uint8_t instance) const
LowPassFilterVector3f _accel_vibe_floor_filter[INS_VIBRATION_CHECK_INSTANCES]
void _save_gyro_calibration()
static const struct AP_Param::GroupInfo var_info[]
bool gyro_calibrated_ok(uint8_t instance) const
bool should_log(uint8_t instance, IMU_SENSOR_TYPE type)
bool _delta_angle_valid[INS_MAX_INSTANCES]
float _delta_velocity_dt[INS_MAX_INSTANCES]
bool get_delta_velocity(uint8_t i, Vector3f &delta_velocity) const
const Vector3f & get_gyro(void) const
float _delta_velocity_acc_dt[INS_MAX_INSTANCES]
bool _add_backend(AP_InertialSensor_Backend *backend)
bool use_accel(uint8_t instance) const
void update_doing_sensor_rate_logging()
uint16_t _sample_accel_count[INS_MAX_INSTANCES]
bool doing_sensor_rate_logging() const
Matrix3f * _custom_rotation
float _temperature[INS_MAX_INSTANCES]
float _accel_max_abs_offsets[INS_MAX_INSTANCES]
AP_Int8 _fast_sampling_mask
bool _doing_sensor_rate_logging
uint64_t _accel_last_sample_us[INS_MAX_INSTANCES]
uint16_t _accel_raw_sampling_multiplier[INS_MAX_INSTANCES]
uint64_t _gyro_last_sample_us[INS_MAX_INSTANCES]
uint32_t _sample_gyro_start_us[INS_MAX_INSTANCES]
Vector3f _delta_angle_acc[INS_MAX_INSTANCES]
void sample(uint8_t instance, IMU_SENSOR_TYPE _type, uint64_t sample_us, const Vector3f &sample)
static AP_InertialSensor ins
uint32_t _sample_accel_start_us[INS_MAX_INSTANCES]
const Vector3f & get_accel(uint8_t i) const
float _gyro_raw_sample_rates[INS_MAX_INSTANCES]
#define INS_VIBRATION_CHECK_INSTANCES
uint16_t data_write_offset
AccelCalibrator * _acal_get_calibrator(uint8_t i)
uint8_t get_primary_accel(void) const
bool get_delta_velocity(Vector3f &delta_velocity) const
bool _accel_id_ok[INS_MAX_INSTANCES]
uint16_t get_gyro_rate_hz(uint8_t instance) const
AP_Vector3f _accel_scale[INS_MAX_INSTANCES]
bool get_delta_angle(uint8_t i, Vector3f &delta_angle) const
Vector3f _delta_angle[INS_MAX_INSTANCES]
AP_InertialSensor_Backend * _find_backend(int16_t backend_id, uint8_t instance)
AP_Int32 _gyro_id[INS_MAX_INSTANCES]
bool _new_accel_data[INS_MAX_INSTANCES]
uint8_t register_accel(uint16_t raw_sample_rate_hz, uint32_t id)
LowPassFilter2pVector3f _gyro_filter[INS_MAX_INSTANCES]
uint8_t _gyro_over_sampling[INS_MAX_INSTANCES]
bool calibrating() const
calibrating - returns true if the gyros or accels are currently being calibrated
bool get_accel_health_all(void) const
bool _calculate_trim(const Vector3f &accel_sample, float &trim_roll, float &trim_pitch)
bool use_gyro(uint8_t instance) const
Vector3f _gyro_filtered[INS_MAX_INSTANCES]
bool _startup_error_counts_set
uint32_t get_accel_error_count(uint8_t i) const
uint32_t _gyro_error_count[INS_MAX_INSTANCES]
const Vector3f & get_gyro_offsets(void) const
uint32_t _sample_period_usec
bool _accel_cal_requires_reboot
uint8_t get_gyro_filter_hz(void) const
void set_accel(uint8_t instance, const Vector3f &accel)
void set_board_orientation(enum Rotation orientation, Matrix3f *custom_rotation=nullptr)
const Vector3f & get_gyro_offsets(uint8_t i) const
AP_Int32 _accel_id[INS_MAX_INSTANCES]
LowPassFilterVector3f _accel_vibe_filter[INS_VIBRATION_CHECK_INSTANCES]
float _delta_angle_acc_dt[INS_MAX_INSTANCES]
Vector3f _last_raw_gyro[INS_MAX_INSTANCES]
bool get_delta_angle(Vector3f &delta_angle) const
bool _gyro_cal_ok[INS_MAX_INSTANCES]
uint32_t get_accel_clip_count(uint8_t instance) const
bool _delta_velocity_valid[INS_MAX_INSTANCES]
const AP_InertialSensor & _imu
const Vector3f & get_imu_pos_offset(uint8_t instance) const
Vector3f _gyro[INS_MAX_INSTANCES]
AP_InertialSensor & operator=(const AP_InertialSensor &)=delete
uint16_t get_sample_rate(void) const
MAV_RESULT simple_accel_cal()
Vector3f _delta_velocity[INS_MAX_INSTANCES]
Gyro_Calibration_Timing gyro_calibration_timing()
void set_accel_peak_hold(uint8_t instance, const Vector3f &accel)
void rotate_to_next_sensor()
uint16_t data_read_offset
bool get_gyro_health(void) const
float get_delta_time() const
bool get_primary_accel_cal_sample_avg(uint8_t sample_num, Vector3f &ret) const
uint16_t _gyro_raw_sampling_multiplier[INS_MAX_INSTANCES]
bool calibrate_trim(float &trim_roll, float &trim_pitch)
bool get_accel_health(void) const
A class to implement a second order low pass filter.
enum Rotation _board_orientation
A class to implement a low pass filter without losing precision even for int types the downside being...
void set_gyro(uint8_t instance, const Vector3f &gyro)
void detect_backends(void)
uint16_t _sample_gyro_count[INS_MAX_INSTANCES]
uint8_t _accel_sensor_rate_sampling_enabled
AP_Int8 _acc_body_aligned
float accel_peak_hold_neg_x
void init(uint16_t sample_rate_hz)
BatchSampler batchsampler
struct AP_InertialSensor::PeakHoldState _peak_hold_state
void wait_for_sample(void)
AuxiliaryBus * get_auxiliary_bus(int16_t backend_id)
AP_AccelCal * get_acal() const
bool gyro_calibrated_ok_all() const
float _delta_angle_dt[INS_MAX_INSTANCES]
AP_Vector3f _gyro_offset[INS_MAX_INSTANCES]
bool get_new_trim(float &trim_roll, float &trim_pitch)
AP_Int8 _gyro_filter_cutoff
AP_Vector3f _accel_pos[INS_MAX_INSTANCES]
const Vector3f & get_accel_offsets(uint8_t i) const
Vector3f _delta_velocity_acc[INS_MAX_INSTANCES]
uint8_t get_gyro_count(void) const
void set_log_raw_bit(uint32_t log_raw_bit)
const Vector3f & get_accel_scale(uint8_t i) const
enum Rotation _accel_orientation[INS_MAX_INSTANCES]
bool get_gyro_health(uint8_t instance) const
const Vector3f & get_accel_offsets(void) const
void calc_vibration_and_clipping(uint8_t instance, const Vector3f &accel, float dt)
uint32_t accel_peak_hold_neg_x_age
uint8_t _accel_over_sampling[INS_MAX_INSTANCES]
uint32_t _accel_clip_count[INS_MAX_INSTANCES]
bool _accel_healthy[INS_MAX_INSTANCES]
uint32_t get_gyro_error_count(uint8_t i) const
float get_delta_velocity_dt() const
uint64_t measurement_started_us
#define INS_MAX_INSTANCES
AP_Vector3f _accel_offset[INS_MAX_INSTANCES]
static AP_InertialSensor * get_instance()
float get_delta_angle_dt() const
bool accel_calibrated_ok_all() const
float get_loop_delta_t(void) const
Vector3f get_vibration_levels() const
Vector3f _accel[INS_MAX_INSTANCES]
AP_Int8 _batch_options_mask
LowPassFilter2pVector3f _accel_filter[INS_MAX_INSTANCES]
NotchFilterVector3fParam _notch_filter
uint32_t _gyro_startup_error_count[INS_MAX_INSTANCES]
AccelCalibrator * _accel_calibrator
bool get_gyro_health_all(void) const
BatchSampler(const AP_InertialSensor &imu)
float get_gyro_drift_rate(void) const
enum Rotation _gyro_orientation[INS_MAX_INSTANCES]
bool get_fixed_mount_accel_cal_sample(uint8_t sample_num, Vector3f &ret) const
uint8_t get_accel_count(void) const
uint32_t _last_sample_usec
bool get_accel_health(uint8_t instance) const
static void setup_object_defaults(const void *object_pointer, const struct GroupInfo *group_info)
uint16_t get_accel_rate_hz(uint8_t instance) const
uint8_t _gyro_sensor_rate_sampling_enabled
Vector3f _last_delta_angle[INS_MAX_INSTANCES]