mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-03-12 01:23:56 -03:00
SITL: airspeed DLVR add atmosphere temperature model
This commit is contained in:
parent
c454cea401
commit
2a2399c8f1
@ -61,5 +61,13 @@ void SITL::Airspeed_DLVR::update(const class Aircraft &aircraft)
|
||||
last_update_ms = now_ms;
|
||||
|
||||
pressure = AP::sitl()->state.airspeed_raw_pressure[0];
|
||||
temperature = 25.0f;
|
||||
|
||||
float sim_alt = AP::sitl()->state.altitude;
|
||||
sim_alt += 2 * rand_float();
|
||||
|
||||
float sigma, delta, theta;
|
||||
AP_Baro::SimpleAtmosphere(sim_alt * 0.001f, sigma, delta, theta);
|
||||
|
||||
// To Do: Add a sensor board temperature offset parameter
|
||||
temperature = (SSL_AIR_TEMPERATURE * theta - C_TO_KELVIN) + 25.0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user