18 #define ACCEL_CAL_MAX_NUM_PARAMS 9 19 #define ACCEL_CAL_TOLERANCE 0.1 20 #define MAX_ITERATIONS 50 102 static_assert(
sizeof(*
this) ==
sizeof(
struct param_t),
103 "Invalid union members: sizes do not match");
143 void run_fit(uint8_t max_iterations,
float& fitness);
bool get_sample_corrected(uint8_t i, Vector3f &s) const
struct AccelSample * _sample_buffer
float calc_residual(const Vector3f &sample, const struct param_t ¶ms) const
void set_tolerance(float tolerance)
uint8_t get_num_params() const
uint32_t _last_samp_frag_collected_ms
void start(enum accel_cal_fit_type_t fit_type=ACCEL_CAL_AXIS_ALIGNED_ELLIPSOID, uint8_t num_samples=6, float sample_time=0.5f)
void calc_jacob(const Vector3f &sample, const struct param_t ¶ms, VectorP &ret) const
uint8_t _conf_num_samples
float get_fitness() const
void get_calibration(Vector3f &offset) const
uint8_t get_num_samples_collected() const
void set_status(enum accel_cal_status_t)
accel_cal_status_t _status
bool accept_sample(const Vector3f &sample)
bool accept_result() const
uint8_t _samples_collected
bool get_sample(uint8_t i, Vector3f &s) const
enum accel_cal_fit_type_t _conf_fit_type
VectorN< float, ACCEL_CAL_MAX_NUM_PARAMS > a
float calc_mean_squared_residuals() const
void new_sample(const Vector3f &delta_velocity, float dt)
enum accel_cal_status_t get_status() const
VectorN< float, ACCEL_CAL_MAX_NUM_PARAMS > VectorP
void run_fit(uint8_t max_iterations, float &fitness)