meas_airspeed: don't take the aboslute value

This commit is contained in:
Julian Oes 2014-08-23 18:03:01 +02:00
parent edffb2eede
commit 40fe9ab969
1 changed files with 7 additions and 11 deletions

View File

@ -228,7 +228,9 @@ MEASAirspeed::collect()
// the raw value still should be compensated for the known offset
diff_press_pa_raw -= _diff_pres_offset;
float diff_press_pa = fabsf(diff_press_pa_raw);
/* don't take the absolute value because the calibration takes this into account and warns the user if the
* tubes are connected backwards */
float diff_press_pa = diff_press_pa_raw;
/*
note that we return both the absolute value with offset
@ -241,12 +243,6 @@ MEASAirspeed::collect()
With the above calculation the MS4525 sensor will produce a
positive number when the top port is used as a dynamic port
and bottom port is used as the static port
Also note that the _diff_pres_offset is applied before the
fabsf() not afterwards. It needs to be done this way to
prevent a bias at low speeds, but this also means that when
setting a offset you must set it based on the raw value, not
the offset value
*/
struct differential_pressure_s report;