36 #if CONFIG_HAL_BOARD == HAL_BOARD_SITL 37 #define ARSPD_DEFAULT_TYPE TYPE_ANALOG 38 #define ARSPD_DEFAULT_PIN 1 40 #define ARSPD_DEFAULT_TYPE TYPE_I2C_MS4525 41 #define ARSPD_DEFAULT_PIN 15 44 #if CONFIG_HAL_BOARD_SUBTYPE == HAL_BOARD_SUBTYPE_LINUX_DISCO 45 #define PSI_RANGE_DEFAULT 0.05 48 #ifndef PSI_RANGE_DEFAULT 49 #define PSI_RANGE_DEFAULT 1.0f 217 #define SCALING_OLD_CALIBRATION 819 // 4095/5 254 gcs().
send_text(MAV_SEVERITY_INFO,
"Airspeed[%u] init failed", i);
267 if (
state[i].hil_set) {
298 if (
state[i].use_zero_offset) {
299 param[i].offset.set(0);
310 gcs().
send_text(MAV_SEVERITY_INFO,
"Airspeed calibration started");
327 gcs().
send_text(MAV_SEVERITY_INFO,
"Airspeed[%u] sensor unhealthy", i);
329 gcs().
send_text(MAV_SEVERITY_INFO,
"Airspeed[%u] sensor calibrated", i);
346 float airspeed_pressure;
355 airspeed_pressure = raw_pressure -
param[i].offset;
377 if (airspeed_pressure < -32) {
void setHIL(float pressure)
void update_calibration(const Vector3f &vground, int16_t max_airspeed_allowed_during_cal)
#define AP_PARAM_FLAG_ENABLE
static int16_t get_output_scaled(SRV_Channel::Aux_servo_function_t function)
static const struct AP_Param::GroupInfo var_info[]
struct AP_Airspeed::airspeed_state::@6 cal
Airspeed_Calibration calibration
#define ARSPD_DEFAULT_PIN
Interface definition for the various Ground Control System.
#define ARSPD_DEFAULT_TYPE
#define AP_GROUPINFO(name, idx, clazz, element, def)
#define PSI_RANGE_DEFAULT
virtual bool get_temperature(float &temperature)=0
void init(float initial_ratio)
static auto MAX(const A &one, const B &two) -> decltype(one > two ? one :two)
#define AP_GROUPINFO_FLAGS(name, idx, clazz, element, def, flags)
bool all_healthy(void) const
void calibrate(bool in_startup)
void send_named_float(const char *name, float value) const
void send_text(MAV_SEVERITY severity, const char *fmt,...)
bool get_temperature(uint8_t i, float &temperature)
struct AP_Airspeed::airspeed_state state[AIRSPEED_MAX_SENSORS]
#define AIRSPEED_MAX_SENSORS
AP_Airspeed_Backend * sensor[AIRSPEED_MAX_SENSORS]
Common definitions and utility routines for the ArduPilot libraries.
float get_airspeed(void) const
static AP_Airspeed * _singleton
float get_pressure(uint8_t i)
virtual bool get_differential_pressure(float &pressure)=0
void panic(const char *errormsg,...) FMT_PRINTF(1
struct AP_Airspeed::@5 param[AIRSPEED_MAX_SENSORS]
static void setup_object_defaults(const void *object_pointer, const struct GroupInfo *group_info)