|
|
|
@ -7,9 +7,7 @@ class ParametersG2;
@@ -7,9 +7,7 @@ class ParametersG2;
|
|
|
|
|
class GCS_Copter; |
|
|
|
|
|
|
|
|
|
class Mode { |
|
|
|
|
|
|
|
|
|
public: |
|
|
|
|
|
|
|
|
|
// Auto Pilot Modes enumeration
|
|
|
|
|
enum class Number : uint8_t { |
|
|
|
|
STABILIZE = 0, // manual airframe angle with manual throttle
|
|
|
|
@ -37,7 +35,6 @@ public:
@@ -37,7 +35,6 @@ public:
|
|
|
|
|
SYSTEMID = 25, // System ID mode produces automated system identification signals in the controllers
|
|
|
|
|
AUTOROTATE = 26, // Autonomous autorotation
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
// constructor
|
|
|
|
|
Mode(void); |
|
|
|
|
|
|
|
|
@ -134,7 +131,9 @@ protected:
@@ -134,7 +131,9 @@ protected:
|
|
|
|
|
RC_Channel *&channel_throttle; |
|
|
|
|
RC_Channel *&channel_yaw; |
|
|
|
|
float &G_Dt; |
|
|
|
|
|
|
|
|
|
int16_t countdown ; |
|
|
|
|
uint32_t last_takeoff_request_time; |
|
|
|
|
bool is_countdown_enable = true; |
|
|
|
|
// note that we support two entirely different automatic takeoffs:
|
|
|
|
|
|
|
|
|
|
// "user-takeoff", which is available in modes such as ALT_HOLD
|
|
|
|
@ -331,7 +330,6 @@ public:
@@ -331,7 +330,6 @@ public:
|
|
|
|
|
|
|
|
|
|
bool init(bool ignore_checks) override; |
|
|
|
|
void run() override; |
|
|
|
|
|
|
|
|
|
bool requires_GPS() const override { return true; } |
|
|
|
|
bool has_manual_throttle() const override { return false; } |
|
|
|
|
bool allows_arming(bool from_gcs) const override { return false; }; |
|
|
|
@ -480,6 +478,7 @@ private:
@@ -480,6 +478,7 @@ private:
|
|
|
|
|
int32_t condition_value; // used in condition commands (eg delay, change alt, etc.)
|
|
|
|
|
uint32_t condition_start; |
|
|
|
|
uint32_t last_time_send_updownload; |
|
|
|
|
|
|
|
|
|
LandStateType land_state = LandStateType_FlyToLocation; // records state of land (flying to location, descending)
|
|
|
|
|
|
|
|
|
|
struct { |
|
|
|
@ -1038,7 +1037,7 @@ protected:
@@ -1038,7 +1037,7 @@ protected:
|
|
|
|
|
void land_run(bool disarm_on_land); |
|
|
|
|
|
|
|
|
|
void set_descent_target_alt(uint32_t alt) { rtl_path.descent_target.alt = alt; } |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private: |
|
|
|
|
|
|
|
|
|
void climb_start(); |
|
|
|
@ -1048,10 +1047,11 @@ private:
@@ -1048,10 +1047,11 @@ private:
|
|
|
|
|
void loiterathome_run(); |
|
|
|
|
void build_path(); |
|
|
|
|
void compute_return_target(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
RTLState _state = RTL_InitialClimb; // records state of rtl (initial climb, returning home, etc)
|
|
|
|
|
bool _state_complete = false; // set to true if the current state is completed
|
|
|
|
|
|
|
|
|
|
uint32_t last_decent_time =0; |
|
|
|
|
struct { |
|
|
|
|
// NEU w/ Z element alt-above-ekf-origin unless use_terrain is true in which case Z element is alt-above-terrain
|
|
|
|
|
Location origin_point; |
|
|
|
|