#include "SIM_MS5525.h" #include using namespace SITL; void MS5525::convert_forward(int32_t D1, int32_t D2, float &P_Pa, float &Temp_C) { const uint8_t Q1 = Qx_coeff[0]; const uint8_t Q2 = Qx_coeff[1]; const uint8_t Q3 = Qx_coeff[2]; const uint8_t Q4 = Qx_coeff[3]; const uint8_t Q5 = Qx_coeff[4]; const uint8_t Q6 = Qx_coeff[5]; // this is the forward conversion copied from the driver: int64_t dT = D2 - int64_t(prom[5]) * (1UL< 1) { AP_HAL::panic("Invalid conversion"); } if (fabs(f_Temp_C - Temp_C) > 0.1) { AP_HAL::panic("Invalid conversion"); } } void MS5525::get_pressure_temperature_readings(float &P_Pa, float &Temp_C) { Temp_C = 25.0f; P_Pa = AP::sitl()->state.airspeed_raw_pressure[0]; }