@ -2521,7 +2521,15 @@ bool QuadPlane::verify_vtol_land(void)
@@ -2521,7 +2521,15 @@ bool QuadPlane::verify_vtol_land(void)
plane . auto_state . wp_distance < 2 ) {
poscontrol . state = QPOS_LAND_DESCEND ;
gcs ( ) . send_text ( MAV_SEVERITY_INFO , " Land descend started " ) ;
plane . set_next_WP ( plane . next_WP_loc ) ;
if ( plane . control_mode = = AUTO ) {
// set height to mission height, so we can use the mission
// WP height for triggering land final if no rangefinder
// available
plane . set_next_WP ( plane . mission . get_current_nav_cmd ( ) . content . location ) ;
} else {
plane . set_next_WP ( plane . next_WP_loc ) ;
plane . next_WP_loc . alt = ahrs . get_home ( ) . alt ;
}
}
// at land_final_alt begin final landing
@ -2640,8 +2648,7 @@ int8_t QuadPlane::forward_throttle_pct(void)
@@ -2640,8 +2648,7 @@ int8_t QuadPlane::forward_throttle_pct(void)
int8_t fwd_throttle_min = plane . have_reverse_thrust ( ) ? 0 : plane . aparm . throttle_min ;
vel_forward . integrator = constrain_float ( vel_forward . integrator , fwd_throttle_min , plane . aparm . throttle_max ) ;
if ( in_vtol_auto ( ) & & is_vtol_land ( plane . mission . get_current_nav_cmd ( ) . id ) & &
( poscontrol . state = = QPOS_POSITION1 | | poscontrol . state = = QPOS_POSITION2 ) ) {
if ( in_vtol_land_approach ( ) ) {
// when we are doing horizontal positioning in a VTOL land
// we always allow the fwd motor to run. Otherwise a bad
// lidar could cause the aircraft not to be able to
@ -2933,3 +2940,27 @@ void QuadPlane::update_throttle_thr_mix(void)
@@ -2933,3 +2940,27 @@ void QuadPlane::update_throttle_thr_mix(void)
}
}
}
/*
see if we are in the approach phase of a VTOL landing
*/
bool QuadPlane : : in_vtol_land_approach ( void ) const
{
if ( in_vtol_auto ( ) & & is_vtol_land ( plane . mission . get_current_nav_cmd ( ) . id ) & &
( poscontrol . state = = QPOS_POSITION1 | | poscontrol . state = = QPOS_POSITION2 ) ) {
return true ;
}
return false ;
}
/*
see if we are in the descent phase of a VTOL landing
*/
bool QuadPlane : : in_vtol_land_descent ( void ) const
{
if ( in_vtol_auto ( ) & & is_vtol_land ( plane . mission . get_current_nav_cmd ( ) . id ) & &
( poscontrol . state = = QPOS_LAND_DESCEND | | poscontrol . state = = QPOS_LAND_FINAL ) ) {
return true ;
}
return false ;
}