@ -166,7 +166,7 @@ void Plane::calc_airspeed_errors()
@@ -166,7 +166,7 @@ void Plane::calc_airspeed_errors()
get_throttle_input ( ) ) + ( ( int32_t ) aparm . airspeed_min * 100 ) ;
}
# if OFFBOARD_GUIDED == ENABLED
} else if ( control_mode = = & mode_guided & & ! is_zero ( guided_state . target_airspeed_cm ) ) {
} else if ( control_mode = = & mode_guided & & guided_state . target_airspeed_cm > 0.0 ) { // if offbd guided speed change cmd not set, then this section is skipped
// offboard airspeed demanded
uint32_t now = AP_HAL : : millis ( ) ;
float delta = 1e-3 f * ( now - guided_state . target_airspeed_time_ms ) ;
@ -182,11 +182,14 @@ void Plane::calc_airspeed_errors()
@@ -182,11 +182,14 @@ void Plane::calc_airspeed_errors()
}
# endif // OFFBOARD_GUIDED == ENABLED
} else if ( flight_stage = = AP_Vehicle : : FixedWing : : FLIGHT_LAND ) {
// Landing airspeed target
target_airspeed_cm = landing . get_target_airspeed_cm ( ) ;
} else if ( ( control_mode = = & mode_auto ) & &
( quadplane . options & QuadPlane : : OPTION_MISSION_LAND_FW_APPROACH ) & &
} else if ( control_mode = = & mode_guided & & new_airspeed_cm > 0 ) { //DO_CHANGE_SPEED overrides onboard guided speed commands, user would have re-enter guided mode to revert
target_airspeed_cm = new_airspeed_cm ;
} else if ( control_mode = = & mode_auto ) {
if ( ( quadplane . options & QuadPlane : : OPTION_MISSION_LAND_FW_APPROACH ) & &
( ( vtol_approach_s . approach_stage = = Landing_ApproachStage : : APPROACH_LINE ) | |
( vtol_approach_s . approach_stage = = Landing_ApproachStage : : VTOL_LANDING ) ) ) {
const float land_airspeed = SpdHgt_Controller - > get_land_airspeed ( ) ;
@ -197,7 +200,13 @@ void Plane::calc_airspeed_errors()
@@ -197,7 +200,13 @@ void Plane::calc_airspeed_errors()
target_airspeed_cm = aparm . airspeed_cruise_cm ;
}
} else {
// Normal airspeed target
// normal AUTO mode and new_airspeed variable was set by DO_CHANGE_SPEED command while in AUTO mode
if ( new_airspeed_cm > 0 ) {
target_airspeed_cm = new_airspeed_cm ;
}
}
} else {
// Normal airspeed target for all other cases
target_airspeed_cm = aparm . airspeed_cruise_cm ;
}
@ -390,4 +399,3 @@ bool Plane::reached_loiter_target(void)
@@ -390,4 +399,3 @@ bool Plane::reached_loiter_target(void)
}
return nav_controller - > reached_loiter_target ( ) ;
}