@ -66,14 +66,18 @@ void ModeRTL::run(bool disarm_on_land)
@@ -66,14 +66,18 @@ void ModeRTL::run(bool disarm_on_land)
}
break ;
case RTL_FinalDescent :
// gcs().send_text(MAV_SEVERITY_INFO,"_updownStatus:%d,_state:%d",_state,_state);
if ( _updownStatus ! = UpDown_ContinueDescent ) {
mavlink_zr_flying_status_t zr_flying_status_t ;
zr_flying_status_t . updown_status = UpDown_ContinueDescent ;
gcs ( ) . update_zr_fly_status ( & zr_flying_status_t ) ;
gcs ( ) . send_text ( MAV_SEVERITY_INFO , " into RTL_FinalDescent " ) ;
set_mode ( Mode : : Number : : BRAKE , ModeReason : : MISSION_END ) ;
if ( copter . updownStatus < UpDown_RequestDescent )
{
copter . updownStatus = UpDown_RequestDescent ;
gcs ( ) . update_zr_fly_status ( copter . updownStatus ) ;
}
if ( copter . updownStatus = = UpDown_ContinueDescent )
{
_state = RTL_Land ;
}
break ;
case RTL_Land :
// do nothing - rtl_land_run will take care of disarming motors
@ -262,8 +266,9 @@ void ModeRTL::loiterathome_run()
@@ -262,8 +266,9 @@ void ModeRTL::loiterathome_run()
// rtl_descent_start - initialise descent to final alt
void ModeRTL : : descent_start ( )
{
copter . updownStatus = UpDown_RTLDescent ;
gcs ( ) . update_zr_fly_status ( copter . updownStatus ) ;
_state = RTL_FinalDescent ;
// _updownStatus = UpDown_RTLDescent;
_state_complete = false ;
// Set wp navigation target to above home
@ -401,7 +406,11 @@ void ModeRTL::land_run(bool disarm_on_land)
@@ -401,7 +406,11 @@ void ModeRTL::land_run(bool disarm_on_land)
motors - > set_desired_spool_state ( AP_Motors : : DesiredSpoolState : : THROTTLE_UNLIMITED ) ;
land_run_horizontal_control ( ) ;
land_run_vertical_control ( ) ;
land_run_vertical_control ( ) ;
if ( AP_HAL : : millis ( ) - last_send_time > = 500 ) {
gcs ( ) . update_zr_fly_status ( copter . updownStatus ) ;
}
}
void ModeRTL : : build_path ( )