mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-02-25 01:03:59 -04:00
AP_Baro: Change from division to multiplication
This commit is contained in:
parent
12957c835a
commit
aabbda3978
@ -162,7 +162,7 @@ void AP_Baro_BMP280::_update_temperature(int32_t temp_raw)
|
|||||||
_t_fine = var1 + var2;
|
_t_fine = var1 + var2;
|
||||||
t = (_t_fine * 5 + 128) >> 8;
|
t = (_t_fine * 5 + 128) >> 8;
|
||||||
|
|
||||||
const float temp = ((float)t) / 100.0f;
|
const float temp = ((float)t) * 0.01f;
|
||||||
|
|
||||||
WITH_SEMAPHORE(_sem);
|
WITH_SEMAPHORE(_sem);
|
||||||
|
|
||||||
|
@ -66,7 +66,7 @@ void AP_Baro_SITL::_timer()
|
|||||||
return;
|
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();
|
sim_alt += _sitl->baro[_instance].noise * rand_float();
|
||||||
|
|
||||||
// add baro glitch
|
// add baro glitch
|
||||||
|
Loading…
Reference in New Issue
Block a user