mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-21 16:18:29 -04:00
AP_Arming: use baro singleton
This commit is contained in:
parent
747dbea476
commit
8d8f2208c0
@ -77,10 +77,9 @@ const AP_Param::GroupInfo AP_Arming::var_info[] = {
|
||||
|
||||
//The function point is particularly hacky, hacky, tacky
|
||||
//but I don't want to reimplement messaging to GCS at the moment:
|
||||
AP_Arming::AP_Arming(const AP_AHRS &ahrs_ref, const AP_Baro &baro, Compass &compass,
|
||||
AP_Arming::AP_Arming(const AP_AHRS &ahrs_ref, Compass &compass,
|
||||
const AP_BattMonitor &battery) :
|
||||
ahrs(ahrs_ref),
|
||||
barometer(baro),
|
||||
_compass(compass),
|
||||
_battery(battery),
|
||||
armed(false),
|
||||
@ -116,7 +115,7 @@ bool AP_Arming::barometer_checks(bool report)
|
||||
{
|
||||
if ((checks_to_perform & ARMING_CHECK_ALL) ||
|
||||
(checks_to_perform & ARMING_CHECK_BARO)) {
|
||||
if (!barometer.all_healthy()) {
|
||||
if (!AP::baro().all_healthy()) {
|
||||
if (report) {
|
||||
gcs().send_text(MAV_SEVERITY_CRITICAL, "PreArm: Barometer not healthy");
|
||||
}
|
||||
|
@ -61,7 +61,7 @@ public:
|
||||
static const struct AP_Param::GroupInfo var_info[];
|
||||
|
||||
protected:
|
||||
AP_Arming(const AP_AHRS &ahrs_ref, const AP_Baro &baro, Compass &compass,
|
||||
AP_Arming(const AP_AHRS &ahrs_ref, Compass &compass,
|
||||
const AP_BattMonitor &battery);
|
||||
|
||||
// Parameters
|
||||
@ -72,7 +72,6 @@ protected:
|
||||
|
||||
// references
|
||||
const AP_AHRS &ahrs;
|
||||
const AP_Baro &barometer;
|
||||
Compass &_compass;
|
||||
const AP_BattMonitor &_battery;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user