Browse Source

AHRS: removed constrain() defines

mission-4.1.18
Andrew Tridgell 12 years ago
parent
commit
5840ded767
  1. 1
      libraries/AP_AHRS/AP_AHRS.cpp
  2. 2
      libraries/AP_AHRS/AP_AHRS_DCM.cpp
  3. 1
      libraries/AP_AHRS/AP_AHRS_MPU6000.cpp

1
libraries/AP_AHRS/AP_AHRS.cpp

@ -87,7 +87,6 @@ bool AP_AHRS::airspeed_estimate(float *airspeed_ret) @@ -87,7 +87,6 @@ bool AP_AHRS::airspeed_estimate(float *airspeed_ret)
if (_wind_max > 0 && _gps && _gps->status() == GPS::GPS_OK) {
// constrain the airspeed by the ground speed
// and AHRS_WIND_MAX
#define constrain(amt,low,high) ((amt)<(low)?(low):((amt)>(high)?(high):(amt)))
*airspeed_ret = constrain(*airspeed_ret,
_gps->ground_speed*0.01 - _wind_max,
_gps->ground_speed*0.01 + _wind_max);

2
libraries/AP_AHRS/AP_AHRS_DCM.cpp

@ -18,8 +18,6 @@ @@ -18,8 +18,6 @@
extern const AP_HAL::HAL& hal;
#define constrain(amt,low,high) ((amt)<(low)?(low):((amt)>(high)?(high):(amt)))
// this is the speed in cm/s above which we first get a yaw lock with
// the GPS
#define GPS_SPEED_MIN 300

1
libraries/AP_AHRS/AP_AHRS_MPU6000.cpp

@ -122,7 +122,6 @@ void AP_AHRS_MPU6000::drift_correction( float deltat ) @@ -122,7 +122,6 @@ void AP_AHRS_MPU6000::drift_correction( float deltat )
// 0.65*0.04 / 0.005 = 5.2
float drift_limit = _mpu6000->get_gyro_drift_rate() * deltat
/ _gyro_bias_from_gravity_gain;
#define constrain(amt,low,high) ((amt)<(low)?(low):((amt)>(high)?(high):(amt)))
errorRollPitch[0] = constrain(errorRollPitch[0],
-drift_limit, drift_limit);
errorRollPitch[1] = constrain(errorRollPitch[1],

Loading…
Cancel
Save