mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-03 06:28:27 -04:00
AP_AHRS: stop storing gyro drift rate as variable
This is constant and is just folded into whereever it is used.
This commit is contained in:
parent
a4d98a457b
commit
5b372dae06
@ -54,10 +54,6 @@ public:
|
|||||||
_cos_pitch(1.0f),
|
_cos_pitch(1.0f),
|
||||||
_cos_yaw(1.0f)
|
_cos_yaw(1.0f)
|
||||||
{
|
{
|
||||||
// base the ki values by the sensors maximum drift
|
|
||||||
// rate.
|
|
||||||
_gyro_drift_limit = AP::ins().get_gyro_drift_rate();
|
|
||||||
|
|
||||||
// enable centrifugal correction by default
|
// enable centrifugal correction by default
|
||||||
_flags.correct_centrifugal = true;
|
_flags.correct_centrifugal = true;
|
||||||
|
|
||||||
@ -665,10 +661,6 @@ protected:
|
|||||||
Matrix3f _rotation_autopilot_body_to_vehicle_body;
|
Matrix3f _rotation_autopilot_body_to_vehicle_body;
|
||||||
Matrix3f _rotation_vehicle_body_to_autopilot_body;
|
Matrix3f _rotation_vehicle_body_to_autopilot_body;
|
||||||
|
|
||||||
// the limit of the gyro drift claimed by the sensors, in
|
|
||||||
// radians/s/s
|
|
||||||
float _gyro_drift_limit;
|
|
||||||
|
|
||||||
// accelerometer values in the earth frame in m/s/s
|
// accelerometer values in the earth frame in m/s/s
|
||||||
Vector3f _accel_ef[INS_MAX_INSTANCES];
|
Vector3f _accel_ef[INS_MAX_INSTANCES];
|
||||||
Vector3f _accel_ef_blended;
|
Vector3f _accel_ef_blended;
|
||||||
|
@ -930,7 +930,7 @@ AP_AHRS_DCM::drift_correction(float deltat)
|
|||||||
// reported maximum gyro drift rate. This ensures that
|
// reported maximum gyro drift rate. This ensures that
|
||||||
// short term errors don't cause a buildup of omega_I
|
// short term errors don't cause a buildup of omega_I
|
||||||
// beyond the physical limits of the device
|
// beyond the physical limits of the device
|
||||||
const float change_limit = _gyro_drift_limit * _omega_I_sum_time;
|
const float change_limit = AP::ins().get_gyro_drift_rate() * _omega_I_sum_time;
|
||||||
_omega_I_sum.x = constrain_float(_omega_I_sum.x, -change_limit, change_limit);
|
_omega_I_sum.x = constrain_float(_omega_I_sum.x, -change_limit, change_limit);
|
||||||
_omega_I_sum.y = constrain_float(_omega_I_sum.y, -change_limit, change_limit);
|
_omega_I_sum.y = constrain_float(_omega_I_sum.y, -change_limit, change_limit);
|
||||||
_omega_I_sum.z = constrain_float(_omega_I_sum.z, -change_limit, change_limit);
|
_omega_I_sum.z = constrain_float(_omega_I_sum.z, -change_limit, change_limit);
|
||||||
|
Loading…
Reference in New Issue
Block a user