ardupilot
ardupilot copied to clipboard
Maybe slightly better
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;"
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;
The math works out to the same thing, and it doesn't seem any easier to read.