Copter: fixed crash on mavlink send before pos_control is allocated

This commit is contained in:
Andrew Tridgell 2019-02-18 10:46:06 +11:00
parent a3e69e715d
commit ef3306d408
1 changed files with 3 additions and 0 deletions

View File

@ -120,6 +120,9 @@ void GCS_MAVLINK_Copter::send_position_target_global_int()
void GCS_MAVLINK_Copter::send_nav_controller_output() const
{
if (!copter.ap.initialised) {
return;
}
const Vector3f &targets = copter.attitude_control->get_att_target_euler_cd();
const Copter::Mode *flightmode = copter.flightmode;
mavlink_msg_nav_controller_output_send(