|
|
|
@ -48,18 +48,31 @@ public:
@@ -48,18 +48,31 @@ public:
|
|
|
|
|
TERMINATE_ACTION_LAND = 43 |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
/* Do not allow copies */ |
|
|
|
|
AP_AdvancedFailsafe(const AP_AdvancedFailsafe &other) = delete; |
|
|
|
|
AP_AdvancedFailsafe &operator=(const AP_AdvancedFailsafe&) = delete; |
|
|
|
|
|
|
|
|
|
// Constructor
|
|
|
|
|
AP_AdvancedFailsafe(AP_Mission &_mission) : |
|
|
|
|
mission(_mission) |
|
|
|
|
{ |
|
|
|
|
AP_Param::setup_object_defaults(this, var_info); |
|
|
|
|
if (_singleton != nullptr) { |
|
|
|
|
AP_HAL::panic("AP_Logger must be singleton"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
_singleton = this; |
|
|
|
|
_state = STATE_PREFLIGHT; |
|
|
|
|
_terminate.set(0); |
|
|
|
|
|
|
|
|
|
_saved_wp = 0; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// get singleton instance
|
|
|
|
|
static AP_AdvancedFailsafe *get_singleton(void) { |
|
|
|
|
return _singleton; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
bool enabled() { return _enable; } |
|
|
|
|
|
|
|
|
|
// check that everything is OK
|
|
|
|
@ -147,6 +160,12 @@ protected:
@@ -147,6 +160,12 @@ protected:
|
|
|
|
|
bool check_altlimit(void); |
|
|
|
|
|
|
|
|
|
private: |
|
|
|
|
static AP_AdvancedFailsafe *_singleton; |
|
|
|
|
|
|
|
|
|
// update maximum range check
|
|
|
|
|
void max_range_update(); |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
namespace AP { |
|
|
|
|
AP_AdvancedFailsafe *advancedfailsafe(); |
|
|
|
|
}; |
|
|
|
|