simulator: Use baro pressure direct from simulator

This commit is contained in:
Paul Riseborough
2018-04-11 23:26:58 -04:00
committed by Daniel Agar
parent 5dc23def2a
commit 3e6ba1d541
+4 -2
View File
@@ -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;