Browse Source

AP_Landing: Implement is_on_approach for deepstall

(Fixes a disarm in flight)
master
Michael du Breuil 7 years ago committed by Andrew Tridgell
parent
commit
338d745de1
  1. 1
      libraries/AP_Landing/AP_Landing.cpp
  2. 5
      libraries/AP_Landing/AP_Landing_Deepstall.cpp
  3. 1
      libraries/AP_Landing/AP_Landing_Deepstall.h

1
libraries/AP_Landing/AP_Landing.cpp

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

5
libraries/AP_Landing/AP_Landing_Deepstall.cpp

@ -367,6 +367,11 @@ bool AP_Landing_Deepstall::is_flying_forward(void) const
return stage != DEEPSTALL_STAGE_LAND; 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) bool AP_Landing_Deepstall::get_target_altitude_location(Location &location)
{ {
memcpy(&location, &landing_point, sizeof(Location)); memcpy(&location, &landing_point, sizeof(Location));

1
libraries/AP_Landing/AP_Landing_Deepstall.h

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

Loading…
Cancel
Save