|
|
|
@ -379,7 +379,7 @@ void Plane::set_offset_altitude_location(const Location &loc)
@@ -379,7 +379,7 @@ void Plane::set_offset_altitude_location(const Location &loc)
|
|
|
|
|
} |
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
if (!landing.in_progress) { |
|
|
|
|
if (flight_stage != AP_Vehicle::FixedWing::FLIGHT_LAND) { |
|
|
|
|
// if we are within GLIDE_SLOPE_MIN meters of the target altitude
|
|
|
|
|
// then reset the offset to not use a glide slope. This allows for
|
|
|
|
|
// more accurate flight of missions where the aircraft may lose or
|
|
|
|
@ -470,7 +470,7 @@ float Plane::mission_alt_offset(void)
@@ -470,7 +470,7 @@ float Plane::mission_alt_offset(void)
|
|
|
|
|
{ |
|
|
|
|
float ret = g.alt_offset; |
|
|
|
|
if (control_mode == AUTO && |
|
|
|
|
(landing.in_progress || auto_state.wp_is_land_approach)) { |
|
|
|
|
(flight_stage == AP_Vehicle::FixedWing::FLIGHT_LAND || auto_state.wp_is_land_approach)) { |
|
|
|
|
// when landing after an aborted landing due to too high glide
|
|
|
|
|
// slope we use an offset from the last landing attempt
|
|
|
|
|
ret += landing.alt_offset; |
|
|
|
@ -572,9 +572,7 @@ float Plane::rangefinder_correction(void)
@@ -572,9 +572,7 @@ float Plane::rangefinder_correction(void)
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// for now we only support the rangefinder for landing
|
|
|
|
|
bool using_rangefinder = (g.rangefinder_landing && |
|
|
|
|
control_mode == AUTO &&
|
|
|
|
|
landing.in_progress); |
|
|
|
|
bool using_rangefinder = (g.rangefinder_landing && flight_stage == AP_Vehicle::FixedWing::FLIGHT_LAND); |
|
|
|
|
if (!using_rangefinder) { |
|
|
|
|
return 0; |
|
|
|
|
} |
|
|
|
@ -615,7 +613,7 @@ void Plane::rangefinder_height_update(void)
@@ -615,7 +613,7 @@ void Plane::rangefinder_height_update(void)
|
|
|
|
|
} else { |
|
|
|
|
rangefinder_state.in_range = true; |
|
|
|
|
if (!rangefinder_state.in_use && |
|
|
|
|
(landing.in_progress || |
|
|
|
|
(flight_stage == AP_Vehicle::FixedWing::FLIGHT_LAND || |
|
|
|
|
control_mode == QLAND || |
|
|
|
|
control_mode == QRTL || |
|
|
|
|
(control_mode == AUTO && plane.mission.get_current_nav_cmd().id == MAV_CMD_NAV_VTOL_LAND)) && |
|
|
|
|