AP_Landing: Implement is_on_approach for deepstall

(Fixes a disarm in flight)
This commit is contained in:
Michael du Breuil 2017-11-02 15:11:44 -07:00 committed by Andrew Tridgell
parent 126d5ce5d4
commit 338d745de1
3 changed files with 7 additions and 0 deletions

View File

@ -308,6 +308,7 @@ bool AP_Landing::is_on_approach(void) const
case TYPE_STANDARD_GLIDE_SLOPE:
return type_slope_is_on_approach();
case TYPE_DEEPSTALL:
return deepstall.is_on_approach();
default:
return false;
}

View File

@ -367,6 +367,11 @@ bool AP_Landing_Deepstall::is_flying_forward(void) const
return stage != DEEPSTALL_STAGE_LAND;
}
bool AP_Landing_Deepstall::is_on_approach(void) const
{
return stage == DEEPSTALL_STAGE_LAND;
}
bool AP_Landing_Deepstall::get_target_altitude_location(Location &location)
{
memcpy(&location, &landing_point, sizeof(Location));

View File

@ -102,6 +102,7 @@ private:
int32_t get_target_airspeed_cm(void) const;
bool is_throttle_suppressed(void) const;
bool is_flying_forward(void) const;
bool is_on_approach(void) const;
bool terminate(void);
void log(void) const;