mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-14 20:23:34 +08:00
simulator: Use baro pressure direct from simulator
This commit is contained in:
committed by
Daniel Agar
parent
5dc23def2a
commit
3e6ba1d541
@@ -245,8 +245,10 @@ void Simulator::update_sensors(mavlink_hil_sensor_t *imu)
|
||||
perf_begin(_perf_mag);
|
||||
|
||||
RawBaroData baro = {};
|
||||
// calculate air pressure from altitude (valid for low altitude)
|
||||
baro.pressure = (PRESS_GROUND - CONSTANTS_ONE_G * DENSITY * imu->pressure_alt) / 100.0f; // convert from Pa to mbar
|
||||
|
||||
// Get air pressure and pressure altitude
|
||||
// valid for troposphere (below 11km AMSL)
|
||||
baro.pressure = imu->abs_pressure;
|
||||
baro.altitude = imu->pressure_alt;
|
||||
baro.temperature = imu->temperature;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user