ardupilot icon indicating copy to clipboard operation
ardupilot copied to clipboard

Maybe slightly better

Open Crashpilot1000 opened this issue 13 years ago • 2 comments

Maybe the calculation in AP_Baro_MS5611::_calculate() (https://github.com/diydrones/ardupilot/blob/master/libraries/AP_Baro/AP_Baro_MS5611.cpp#L406)

" P = (D1*SENS/2097152 - OFF)/32768;"

could be slightly improved with: " P = (D1*(SENS/2097152) - OFF)/32768;"

Crashpilot1000 avatar Sep 22 '13 14:09 Crashpilot1000

Forgot that: OFF = C2 * 65536.0f + (C4 * dT) / 128; SENS = C1 * 32768.0f + (C3 * dT) / 256;

Maybe thats slightly better: OFF = C2 * 65536.0f + (C4 / 128) * dT; SENS = C1 * 32768.0f + (C3 / 256) * dT;

Crashpilot1000 avatar Sep 25 '13 02:09 Crashpilot1000

The math works out to the same thing, and it doesn't seem any easier to read.

squilter avatar Sep 11 '14 21:09 squilter