|
|
|
@ -150,23 +150,66 @@ bool AP_Landing::verify_land(const AP_Vehicle::FixedWing::FlightStage flight_sta
@@ -150,23 +150,66 @@ bool AP_Landing::verify_land(const AP_Vehicle::FixedWing::FlightStage flight_sta
|
|
|
|
|
const int32_t auto_state_takeoff_altitude_rel_cm, const float height, const float sink_rate, const float wp_proportion, const uint32_t last_flying_ms, const bool is_armed, const bool is_flying, const bool rangefinder_state_in_range, bool &throttle_suppressed) |
|
|
|
|
{ |
|
|
|
|
switch (type) { |
|
|
|
|
default: |
|
|
|
|
case TYPE_STANDARD_GLIDE_SLOPE: |
|
|
|
|
return type_slope_verify_land(flight_stage,prev_WP_loc, next_WP_loc, current_loc, |
|
|
|
|
auto_state_takeoff_altitude_rel_cm, height,sink_rate, wp_proportion, last_flying_ms, is_armed, is_flying, rangefinder_state_in_range, throttle_suppressed); |
|
|
|
|
default: |
|
|
|
|
// returning TRUE while executing verify_land() will increment the
|
|
|
|
|
// mission index which in many cases will trigger an RTL for end-of-mission
|
|
|
|
|
GCS_MAVLINK::send_statustext_all(MAV_SEVERITY_CRITICAL, "Landing configuration error, invalid LAND_TYPE"); |
|
|
|
|
return true; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void AP_Landing::adjust_landing_slope_for_rangefinder_bump(AP_Vehicle::FixedWing::Rangefinder_State &rangefinder_state, Location &prev_WP_loc, Location &next_WP_loc, const Location ¤t_loc, const float wp_distance, int32_t &target_altitude_offset_cm) |
|
|
|
|
{ |
|
|
|
|
switch (type) { |
|
|
|
|
default: |
|
|
|
|
case TYPE_STANDARD_GLIDE_SLOPE: |
|
|
|
|
type_slope_adjust_landing_slope_for_rangefinder_bump(rangefinder_state, prev_WP_loc, next_WP_loc, current_loc, wp_distance, target_altitude_offset_cm); |
|
|
|
|
break; |
|
|
|
|
|
|
|
|
|
default: |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// return true while the aircraft should be in a flaring state
|
|
|
|
|
bool AP_Landing::is_flaring(void) const |
|
|
|
|
{ |
|
|
|
|
switch (type) { |
|
|
|
|
case TYPE_STANDARD_GLIDE_SLOPE: |
|
|
|
|
return type_slope_is_flaring(); |
|
|
|
|
|
|
|
|
|
default: |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// return true while the aircraft is performing a landing approach
|
|
|
|
|
bool AP_Landing::is_on_approach(void) const |
|
|
|
|
{ |
|
|
|
|
switch (type) { |
|
|
|
|
case TYPE_STANDARD_GLIDE_SLOPE: |
|
|
|
|
return type_slope_is_on_approach(); |
|
|
|
|
|
|
|
|
|
default: |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// return true when at the last stages of a land when an impact with the ground is expected soon
|
|
|
|
|
bool AP_Landing::is_expecting_impact(void) const |
|
|
|
|
{ |
|
|
|
|
switch (type) { |
|
|
|
|
case TYPE_STANDARD_GLIDE_SLOPE: |
|
|
|
|
return type_slope_is_expecting_impact(); |
|
|
|
|
|
|
|
|
|
default: |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
a special glide slope calculation for the landing approach |
|
|
|
|
|
|
|
|
@ -179,10 +222,12 @@ void AP_Landing::adjust_landing_slope_for_rangefinder_bump(AP_Vehicle::FixedWing
@@ -179,10 +222,12 @@ void AP_Landing::adjust_landing_slope_for_rangefinder_bump(AP_Vehicle::FixedWing
|
|
|
|
|
void AP_Landing::setup_landing_glide_slope(const Location &prev_WP_loc, const Location &next_WP_loc, const Location ¤t_loc, int32_t &target_altitude_offset_cm) |
|
|
|
|
{ |
|
|
|
|
switch (type) { |
|
|
|
|
default: |
|
|
|
|
case TYPE_STANDARD_GLIDE_SLOPE: |
|
|
|
|
type_slope_setup_landing_glide_slope(prev_WP_loc, next_WP_loc, current_loc, target_altitude_offset_cm); |
|
|
|
|
break; |
|
|
|
|
|
|
|
|
|
default: |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -332,9 +377,11 @@ int32_t AP_Landing::get_target_airspeed_cm(const AP_Vehicle::FixedWing::FlightSt
@@ -332,9 +377,11 @@ int32_t AP_Landing::get_target_airspeed_cm(const AP_Vehicle::FixedWing::FlightSt
|
|
|
|
|
bool AP_Landing::request_go_around(void) |
|
|
|
|
{ |
|
|
|
|
switch (type) { |
|
|
|
|
default: |
|
|
|
|
case TYPE_STANDARD_GLIDE_SLOPE: |
|
|
|
|
return type_slope_request_go_around(); |
|
|
|
|
|
|
|
|
|
default: |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|