4 #if CONFIG_HAL_BOARD == HAL_BOARD_SITL 18 if (
_sitl !=
nullptr) {
20 #if APM_BUILD_TYPE(APM_BUILD_ArduSub) 35 const float Tzero = 30.0f;
36 T = T1 - (T1 - T0) * expf(-tsec / tconst);
41 p -= powf(
MAX(T - Tzero, 0), baro_factor);
69 uint32_t best_time_delta = 200;
70 uint8_t best_index = 0;
89 uint32_t time_delta = abs(
90 (int32_t)(delayed_time -
_buffer[i].time));
92 if (time_delta < best_time_delta) {
94 best_time_delta = time_delta;
97 if (best_time_delta < 200) {
98 sim_alt =
_buffer[best_index].data;
101 #if !APM_BUILD_TYPE(APM_BUILD_ArduSub) 102 float sigma,
delta, theta;
110 float rho,
delta, theta;
136 #endif // CONFIG_HAL_BOARD
static AP_Param * find_object(const char *name)
static void SimpleAtmosphere(const float alt, float &sigma, float &delta, float &theta)
VectorN< readings_baro, _buffer_length > _buffer
void _copy_to_frontend(uint8_t instance, float pressure, float temperature)
uint8_t register_sensor(void)
bool is_positive(const T fVal1)
uint32_t _last_store_time
static auto MAX(const A &one, const B &two) -> decltype(one > two ? one :two)
#define FUNCTOR_BIND(obj, func, rettype,...)
static void SimpleUnderWaterAtmosphere(float alt, float &rho, float &delta, float &theta)
AP_Float temp_baro_factor
virtual bool take_nonblocking() WARN_IF_UNUSED=0
void set_type(uint8_t instance, baro_type_t type)
void temperature_adjustment(float &p, float &T)
uint32_t _last_sample_time
virtual void register_timer_process(AP_HAL::MemberProc)=0
static const uint8_t _buffer_length
AP_HAL::Scheduler * scheduler