Browse Source

AP_Baro: Change from division to multiplication

apm_2208
murata 3 years ago committed by Andrew Tridgell
parent
commit
aabbda3978
  1. 2
      libraries/AP_Baro/AP_Baro_BMP280.cpp
  2. 2
      libraries/AP_Baro/AP_Baro_SITL.cpp

2
libraries/AP_Baro/AP_Baro_BMP280.cpp

@ -162,7 +162,7 @@ void AP_Baro_BMP280::_update_temperature(int32_t temp_raw) @@ -162,7 +162,7 @@ void AP_Baro_BMP280::_update_temperature(int32_t temp_raw)
_t_fine = var1 + var2;
t = (_t_fine * 5 + 128) >> 8;
const float temp = ((float)t) / 100.0f;
const float temp = ((float)t) * 0.01f;
WITH_SEMAPHORE(_sem);

2
libraries/AP_Baro/AP_Baro_SITL.cpp

@ -66,7 +66,7 @@ void AP_Baro_SITL::_timer() @@ -66,7 +66,7 @@ void AP_Baro_SITL::_timer()
return;
}
sim_alt += _sitl->baro[_instance].drift * now / 1000.0f;
sim_alt += _sitl->baro[_instance].drift * now * 0.001f;
sim_alt += _sitl->baro[_instance].noise * rand_float();
// add baro glitch

Loading…
Cancel
Save