mirror of https://github.com/ArduPilot/ardupilot
AP_Arming: added is_armed_and_safety_off()
This commit is contained in:
parent
49fb4f37c5
commit
bddd716cf9
|
@ -188,11 +188,19 @@ uint16_t AP_Arming::compass_magfield_expected() const
|
|||
return AP_ARMING_COMPASS_MAGFIELD_EXPECTED;
|
||||
}
|
||||
|
||||
bool AP_Arming::is_armed()
|
||||
bool AP_Arming::is_armed() const
|
||||
{
|
||||
return armed || arming_required() == Required::NO;
|
||||
}
|
||||
|
||||
/*
|
||||
true if armed and safety is off
|
||||
*/
|
||||
bool AP_Arming::is_armed_and_safety_off() const
|
||||
{
|
||||
return is_armed() && hal.util->safety_switch_state() != AP_HAL::Util::SAFETY_DISARMED;
|
||||
}
|
||||
|
||||
uint32_t AP_Arming::get_enabled_checks() const
|
||||
{
|
||||
return checks_to_perform;
|
||||
|
@ -1616,7 +1624,7 @@ bool AP_Arming::disarm(const AP_Arming::Method method, bool do_disarm_checks)
|
|||
return true;
|
||||
}
|
||||
|
||||
AP_Arming::Required AP_Arming::arming_required()
|
||||
AP_Arming::Required AP_Arming::arming_required() const
|
||||
{
|
||||
#if AP_OPENDRONEID_ENABLED
|
||||
// cannot be disabled if OpenDroneID is present
|
||||
|
|
|
@ -85,10 +85,11 @@ public:
|
|||
void init(void);
|
||||
|
||||
// these functions should not be used by Copter which holds the armed state in the motors library
|
||||
Required arming_required();
|
||||
Required arming_required() const;
|
||||
virtual bool arm(AP_Arming::Method method, bool do_arming_checks=true);
|
||||
virtual bool disarm(AP_Arming::Method method, bool do_disarm_checks=true);
|
||||
bool is_armed();
|
||||
bool is_armed() const;
|
||||
bool is_armed_and_safety_off() const;
|
||||
|
||||
// get bitmask of enabled checks
|
||||
uint32_t get_enabled_checks() const;
|
||||
|
|
Loading…
Reference in New Issue