APM:Libraries
|
#include <AP_Baro.h>
Classes | |
struct | sensor |
Public Types | |
enum | baro_type_t { BARO_TYPE_AIR, BARO_TYPE_WATER } |
Public Member Functions | |
AP_Baro () | |
AP_Baro (const AP_Baro &other)=delete | |
AP_Baro & | operator= (const AP_Baro &)=delete |
void | init (void) |
void | update (void) |
bool | healthy (void) const |
bool | healthy (uint8_t instance) const |
bool | all_healthy (void) const |
float | get_pressure (void) const |
float | get_pressure (uint8_t instance) const |
float | get_temperature (void) const |
float | get_temperature (uint8_t instance) const |
float | get_pressure_correction (void) const |
float | get_pressure_correction (uint8_t instance) const |
void | accumulate (void) |
void | calibrate (bool save=true) |
void | update_calibration (void) |
float | get_altitude (void) const |
float | get_altitude (uint8_t instance) const |
float | get_altitude_difference (float base_pressure, float pressure) const |
float | get_EAS2TAS (void) |
float | get_air_density_ratio (void) |
float | get_climb_rate (void) |
float | get_ground_temperature (void) const |
float | get_ground_pressure (void) const |
float | get_ground_pressure (uint8_t i) const |
void | set_external_temperature (float temperature) |
uint32_t | get_last_update (void) const |
uint32_t | get_last_update (uint8_t instance) const |
float | get_external_temperature (void) const |
float | get_external_temperature (const uint8_t instance) const |
void | setHIL (float altitude_msl) |
void | setHIL (uint8_t instance, float pressure, float temperature, float altitude, float climb_rate, uint32_t last_update_ms) |
void | set_primary_baro (uint8_t primary) |
void | set_type (uint8_t instance, baro_type_t type) |
baro_type_t | get_type (uint8_t instance) |
uint8_t | register_sensor (void) |
uint8_t | num_instances (void) const |
void | set_hil_mode (void) |
void | set_baro_drift_altitude (float alt) |
float | get_baro_drift_offset (void) |
void | set_pressure_correction (uint8_t instance, float p_correction) |
uint8_t | get_filter_range () const |
void | set_log_baro_bit (uint32_t bit) |
bool | should_df_log () const |
Static Public Member Functions | |
static AP_Baro * | get_instance (void) |
static void | SimpleAtmosphere (const float alt, float &sigma, float &delta, float &theta) |
static void | SimpleUnderWaterAtmosphere (float alt, float &rho, float &delta, float &theta) |
Public Attributes | |
struct { | |
float pressure | |
float temperature | |
float altitude | |
float climb_rate | |
uint32_t last_update_ms | |
bool updated:1 | |
bool have_alt:1 | |
bool have_last_update:1 | |
} | _hil |
Static Public Attributes | |
static const struct AP_Param::GroupInfo | var_info [] |
Private Member Functions | |
bool | _add_backend (AP_Baro_Backend *backend) |
Private Attributes | |
uint8_t | _num_drivers |
AP_Baro_Backend * | drivers [BARO_MAX_DRIVERS] |
uint8_t | _num_sensors |
uint8_t | _primary |
uint32_t | _log_baro_bit = -1 |
struct AP_Baro::sensor | sensors [BARO_MAX_INSTANCES] |
AP_Float | _alt_offset |
float | _alt_offset_active |
AP_Int8 | _primary_baro |
AP_Int8 | _ext_bus |
float | _last_altitude_EAS2TAS |
float | _EAS2TAS |
float | _external_temperature |
uint32_t | _last_external_temperature_ms |
DerivativeFilterFloat_Size7 | _climb_rate_filter |
AP_Float | _specific_gravity |
AP_Float | _user_ground_temperature |
bool | _hil_mode:1 |
float | _guessed_ground_temperature |
uint32_t | _last_notify_ms |
AP_Int8 | _filter_range |
Static Private Attributes | |
static AP_Baro * | _instance |
Friends | |
class | AP_Baro_Backend |
class | AP_Baro_SITL |
enum AP_Baro::baro_type_t |
AP_Baro::AP_Baro | ( | ) |
|
delete |
|
private |
Definition at line 371 of file AP_Baro.cpp.
Referenced by init().
void AP_Baro::accumulate | ( | void | ) |
Definition at line 694 of file AP_Baro.cpp.
Referenced by get_pressure_correction(), and loop().
bool AP_Baro::all_healthy | ( | void | ) | const |
Definition at line 717 of file AP_Baro.cpp.
Referenced by healthy().
void AP_Baro::calibrate | ( | bool | save = true | ) |
Definition at line 164 of file AP_Baro.cpp.
Referenced by get_pressure_correction(), and setup().
float AP_Baro::get_air_density_ratio | ( | void | ) |
Definition at line 306 of file AP_Baro.cpp.
Referenced by get_altitude().
|
inline |
Definition at line 84 of file AP_Baro.h.
Referenced by HALSITL::SITL_State::_simulator_servos(), get_altitude(), get_EAS2TAS(), AP_AHRS_DCM::get_position(), AP_AHRS_DCM::get_relative_position_D_home(), AP_AHRS_NavEKF::get_relative_position_D_home(), DataFlash_Class::Log_Write_Baro_instance(), loop(), NavEKF2_core::readBaroData(), NavEKF3_core::readBaroData(), update(), and AP_TECS::update_50hz().
|
inline |
float AP_Baro::get_altitude_difference | ( | float | base_pressure, |
float | pressure | ||
) | const |
Definition at line 271 of file AP_Baro.cpp.
Referenced by AP_AdvancedFailsafe::check_altlimit(), get_altitude(), AP_ADSB::send_dynamic_out(), and update().
|
inline |
Definition at line 167 of file AP_Baro.h.
Referenced by DataFlash_Class::Log_Write_Baro_instance().
float AP_Baro::get_climb_rate | ( | void | ) |
Definition at line 319 of file AP_Baro.cpp.
Referenced by get_altitude(), DataFlash_Class::Log_Write_Baro_instance(), and loop().
float AP_Baro::get_EAS2TAS | ( | void | ) |
Definition at line 288 of file AP_Baro.cpp.
Referenced by get_air_density_ratio(), and get_altitude().
|
inline |
Definition at line 122 of file AP_Baro.h.
Referenced by calibrate(), get_external_temperature(), and update_calibration().
float AP_Baro::get_external_temperature | ( | const uint8_t | instance | ) | const |
|
inline |
Definition at line 178 of file AP_Baro.h.
Referenced by AP_Baro_Backend::pressure_ok().
|
inline |
Definition at line 107 of file AP_Baro.h.
Referenced by get_ground_pressure(), GCS_MAVLINK::send_scaled_pressure(), and GCS_MAVLINK::send_scaled_pressure3().
|
inline |
float AP_Baro::get_ground_temperature | ( | void | ) | const |
Definition at line 331 of file AP_Baro.cpp.
Referenced by get_altitude(), get_altitude_difference(), get_EAS2TAS(), and DataFlash_Class::Log_Write_Baro_instance().
|
inlinestatic |
Definition at line 34 of file AP_Baro.h.
Referenced by AP_Airspeed_SDP3X::_correct_pressure(), and AP::baro().
|
inline |
Definition at line 116 of file AP_Baro.h.
Referenced by AP_AdvancedFailsafe::check_altlimit(), get_last_update(), DataFlash_Class::Log_Write_Baro_instance(), NavEKF2_core::readBaroData(), NavEKF3_core::readBaroData(), and update().
|
inline |
|
inline |
Definition at line 59 of file AP_Baro.h.
Referenced by AP_Airspeed_SDP3X::_correct_pressure(), HALSITL::SITL_State::_update_airspeed(), AP_AdvancedFailsafe::check_altlimit(), get_EAS2TAS(), get_pressure(), AP_TempCalibration::learn_calibration(), DataFlash_Class::Log_Write_Baro_instance(), loop(), AP_ADSB::send_dynamic_out(), GCS_MAVLINK::send_scaled_pressure(), GCS_MAVLINK::send_scaled_pressure3(), GCS_MAVLINK::send_sensor_offsets(), and update_calibration().
|
inline |
|
inline |
Definition at line 67 of file AP_Baro.h.
Referenced by get_pressure_correction().
|
inline |
|
inline |
Definition at line 63 of file AP_Baro.h.
Referenced by AP_TempCalibration::apply_calibration(), get_external_temperature(), get_temperature(), AP_TempCalibration::learn_calibration(), DataFlash_Class::Log_Write_Baro_instance(), loop(), GCS_MAVLINK::send_scaled_pressure(), GCS_MAVLINK::send_scaled_pressure3(), GCS_MAVLINK::send_sensor_offsets(), and AP_TempCalibration::setup_learning().
|
inline |
|
inline |
|
inline |
Definition at line 52 of file AP_Baro.h.
Referenced by all_healthy(), AP_TempCalibration::apply_calibration(), calibrate(), healthy(), AP_TempCalibration::learn_calibration(), DataFlash_Class::Log_Write_Baro(), loop(), AP_ADSB::send_dynamic_out(), update(), and update_calibration().
|
inline |
void AP_Baro::init | ( | void | ) |
Definition at line 398 of file AP_Baro.cpp.
Referenced by setup().
|
inline |
Definition at line 158 of file AP_Baro.h.
Referenced by DataFlash_Class::Log_Write_Baro(), GCS_MAVLINK::send_scaled_pressure(), and GCS_MAVLINK::send_scaled_pressure3().
uint8_t AP_Baro::register_sensor | ( | void | ) |
Definition at line 705 of file AP_Baro.cpp.
Referenced by AP_Baro_BMP085::_init(), AP_Baro_BMP280::_init(), AP_Baro_LPS2XH::_init(), AP_Baro_MS56XX::_init(), AP_Baro_KellerLD::_init(), AP_Baro_HIL::AP_Baro_HIL(), AP_Baro_SITL::AP_Baro_SITL(), AP_Baro_FBM320::init(), AP_Baro_DPS280::init(), and AP_Baro_ICM20789::init().
void AP_Baro::set_external_temperature | ( | float | temperature | ) |
Definition at line 344 of file AP_Baro.cpp.
Referenced by get_ground_pressure().
|
inline |
void AP_Baro::set_pressure_correction | ( | uint8_t | instance, |
float | p_correction | ||
) |
Definition at line 728 of file AP_Baro.cpp.
Referenced by AP_TempCalibration::apply_calibration(), and get_baro_drift_offset().
|
inline |
Definition at line 136 of file AP_Baro.h.
Referenced by AP_Baro_MS56XX::_init(), AP_Baro_KellerLD::_init(), and AP_Baro_SITL::AP_Baro_SITL().
void AP_Baro::setHIL | ( | float | altitude_msl | ) |
Definition at line 83 of file AP_Baro_HIL.cpp.
Referenced by get_external_temperature().
void AP_Baro::setHIL | ( | uint8_t | instance, |
float | pressure, | ||
float | temperature, | ||
float | altitude, | ||
float | climb_rate, | ||
uint32_t | last_update_ms | ||
) |
Definition at line 99 of file AP_Baro_HIL.cpp.
bool AP_Baro::should_df_log | ( | ) | const |
Definition at line 603 of file AP_Baro.cpp.
Referenced by set_log_baro_bit(), and update().
|
static |
Definition at line 20 of file AP_Baro_HIL.cpp.
Referenced by AP_Baro_SITL::_timer(), and get_baro_drift_offset().
|
static |
Definition at line 43 of file AP_Baro_HIL.cpp.
Referenced by AP_Baro_SITL::_timer(), and get_baro_drift_offset().
void AP_Baro::update | ( | void | ) |
Definition at line 621 of file AP_Baro.cpp.
Referenced by calibrate(), and loop().
void AP_Baro::update_calibration | ( | void | ) |
Definition at line 246 of file AP_Baro.cpp.
Referenced by GCS_MAVLINK::_handle_command_preflight_calibration_baro(), get_pressure_correction(), NavEKF2_core::resetHeightDatum(), and NavEKF3_core::resetHeightDatum().
|
friend |
|
friend |
|
private |
Definition at line 214 of file AP_Baro.h.
Referenced by calibrate(), set_baro_drift_altitude(), and update().
|
private |
Definition at line 215 of file AP_Baro.h.
Referenced by get_baro_drift_offset(), and update().
|
private |
Definition at line 222 of file AP_Baro.h.
Referenced by get_climb_rate(), and update().
|
private |
Definition at line 219 of file AP_Baro.h.
Referenced by get_EAS2TAS(), and update_calibration().
|
private |
Definition at line 220 of file AP_Baro.h.
Referenced by get_external_temperature(), and set_external_temperature().
|
private |
Definition at line 232 of file AP_Baro.h.
Referenced by get_filter_range().
|
private |
Definition at line 226 of file AP_Baro.h.
Referenced by calibrate(), get_ground_temperature(), and update_calibration().
struct { ... } AP_Baro::_hil |
Referenced by get_climb_rate(), AP_Baro_HIL::update(), and update().
|
private |
Definition at line 225 of file AP_Baro.h.
Referenced by init(), set_hil_mode(), and update().
|
staticprivate |
Definition at line 186 of file AP_Baro.h.
Referenced by AP_Baro(), and get_instance().
|
private |
Definition at line 218 of file AP_Baro.h.
Referenced by get_EAS2TAS().
|
private |
Definition at line 221 of file AP_Baro.h.
Referenced by get_external_temperature(), and set_external_temperature().
|
private |
Definition at line 229 of file AP_Baro.h.
Referenced by update_calibration().
|
private |
Definition at line 198 of file AP_Baro.h.
Referenced by set_log_baro_bit(), and should_df_log().
|
private |
Definition at line 189 of file AP_Baro.h.
Referenced by _add_backend(), accumulate(), init(), and update().
|
private |
Definition at line 193 of file AP_Baro.h.
Referenced by AP_Baro_Backend::_copy_to_frontend(), all_healthy(), calibrate(), init(), num_instances(), register_sensor(), set_pressure_correction(), update(), update_calibration(), and AP_Baro_Backend::update_healthy_flag().
|
private |
Definition at line 196 of file AP_Baro.h.
Referenced by get_altitude(), get_external_temperature(), get_ground_pressure(), get_last_update(), get_pressure(), get_pressure_correction(), get_temperature(), healthy(), and update().
|
private |
Definition at line 216 of file AP_Baro.h.
Referenced by set_primary_baro(), and update().
|
private |
|
private |
Definition at line 224 of file AP_Baro.h.
Referenced by get_ground_temperature(), and init().
float AP_Baro::altitude |
Definition at line 145 of file AP_Baro.h.
Referenced by get_EAS2TAS(), get_external_temperature(), and update().
float AP_Baro::climb_rate |
Definition at line 146 of file AP_Baro.h.
Referenced by get_external_temperature().
|
private |
Definition at line 190 of file AP_Baro.h.
Referenced by _add_backend(), accumulate(), init(), and update().
uint32_t AP_Baro::last_update_ms |
Definition at line 147 of file AP_Baro.h.
Referenced by get_external_temperature().
float AP_Baro::pressure |
Definition at line 143 of file AP_Baro.h.
Referenced by get_altitude(), and AP_Baro_HIL::update().
|
private |
Referenced by AP_Baro_Backend::_copy_to_frontend(), calibrate(), get_altitude(), get_ground_pressure(), get_last_update(), get_pressure(), get_pressure_correction(), get_temperature(), get_type(), healthy(), set_pressure_correction(), set_type(), update(), update_calibration(), AP_Baro_SITL::update_healthy_flag(), and AP_Baro_Backend::update_healthy_flag().
float AP_Baro::temperature |
Definition at line 144 of file AP_Baro.h.
Referenced by get_ground_pressure(), set_external_temperature(), and AP_Baro_HIL::update().
bool AP_Baro::updated |
Definition at line 148 of file AP_Baro.h.
Referenced by AP_Baro_HIL::update().
|
static |