Browse Source

AHRS: fixed build on ARM

master
Andrew Tridgell 12 years ago
parent
commit
3ac3aeb1b1
  1. 3
      libraries/AP_AHRS/AP_AHRS.h
  2. 4
      libraries/AP_AHRS/AP_AHRS_DCM.cpp

3
libraries/AP_AHRS/AP_AHRS.h

@ -198,9 +198,6 @@ protected:
// accelerometer values in the earth frame in m/s/s // accelerometer values in the earth frame in m/s/s
Vector3f _accel_ef; Vector3f _accel_ef;
// acceleration due to gravity in m/s/s
const float _gravity = 9.80665;
}; };
#include <AP_AHRS_DCM.h> #include <AP_AHRS_DCM.h>

4
libraries/AP_AHRS/AP_AHRS_DCM.cpp

@ -485,7 +485,7 @@ AP_AHRS_DCM::drift_correction(float deltat)
// equation 9: get the corrected acceleration vector in earth frame. Units // equation 9: get the corrected acceleration vector in earth frame. Units
// are m/s/s // are m/s/s
Vector3f GA_e; Vector3f GA_e;
float v_scale = gps_gain.get()/(_ra_deltat*_gravity); float v_scale = gps_gain.get()/(_ra_deltat*GRAVITY_MSS);
Vector3f vdelta = (velocity - _last_velocity) * v_scale; Vector3f vdelta = (velocity - _last_velocity) * v_scale;
// limit vertical acceleration correction to 0.5 gravities. The // limit vertical acceleration correction to 0.5 gravities. The
// barometer sometimes gives crazy acceleration changes. // barometer sometimes gives crazy acceleration changes.
@ -498,7 +498,7 @@ AP_AHRS_DCM::drift_correction(float deltat)
} }
// calculate the error term in earth frame. // calculate the error term in earth frame.
Vector3f GA_b = _ra_sum / (_ra_deltat * _gravity); Vector3f GA_b = _ra_sum / (_ra_deltat * GRAVITY_MSS);
float length = GA_b.length(); float length = GA_b.length();
if (length > 1.0) { if (length > 1.0) {
GA_b /= length; GA_b /= length;

Loading…
Cancel
Save