Skip to content
Snippets Groups Projects
Commit 3e6ba1d5 authored by Paul Riseborough's avatar Paul Riseborough Committed by Daniel Agar
Browse files

simulator: Use baro pressure direct from simulator

parent 5dc23def
No related branches found
No related tags found
No related merge requests found
......@@ -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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment