|
|
|
@ -291,6 +291,13 @@ public:
@@ -291,6 +291,13 @@ public:
|
|
|
|
|
_prev_nav_cmd_wp_index(AP_MISSION_CMD_INDEX_NONE), |
|
|
|
|
_last_change_time_ms(0) |
|
|
|
|
{ |
|
|
|
|
#if CONFIG_HAL_BOARD == HAL_BOARD_SITL |
|
|
|
|
if (_singleton != nullptr) { |
|
|
|
|
AP_HAL::panic("Mission must be singleton"); |
|
|
|
|
} |
|
|
|
|
#endif |
|
|
|
|
_singleton = this; |
|
|
|
|
|
|
|
|
|
// load parameter defaults
|
|
|
|
|
AP_Param::setup_object_defaults(this, var_info); |
|
|
|
|
|
|
|
|
@ -304,6 +311,11 @@ public:
@@ -304,6 +311,11 @@ public:
|
|
|
|
|
_flags.do_cmd_loaded = false; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// get singleton instance
|
|
|
|
|
static AP_Mission *get_singleton() { |
|
|
|
|
return _singleton; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/* Do not allow copies */ |
|
|
|
|
AP_Mission(const AP_Mission &other) = delete; |
|
|
|
|
AP_Mission &operator=(const AP_Mission&) = delete;
|
|
|
|
@ -470,6 +482,8 @@ public:
@@ -470,6 +482,8 @@ public:
|
|
|
|
|
static const struct AP_Param::GroupInfo var_info[]; |
|
|
|
|
|
|
|
|
|
private: |
|
|
|
|
static AP_Mission *_singleton; |
|
|
|
|
|
|
|
|
|
static StorageAccess _storage; |
|
|
|
|
|
|
|
|
|
struct Mission_Flags { |
|
|
|
@ -563,3 +577,7 @@ private:
@@ -563,3 +577,7 @@ private:
|
|
|
|
|
// const functions
|
|
|
|
|
static HAL_Semaphore_Recursive _rsem; |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
namespace AP { |
|
|
|
|
AP_Mission *mission(); |
|
|
|
|
}; |
|
|
|
|