|
|
|
@ -89,6 +89,44 @@ void GCS_MAVLINK_Tracker::send_nav_controller_output() const
@@ -89,6 +89,44 @@ void GCS_MAVLINK_Tracker::send_nav_controller_output() const
|
|
|
|
|
0); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
send PID tuning message |
|
|
|
|
*/ |
|
|
|
|
void Tracker::send_pid_tuning(mavlink_channel_t chan) |
|
|
|
|
{ |
|
|
|
|
|
|
|
|
|
// Pitch PID
|
|
|
|
|
if (g.gcs_pid_mask & 1) { |
|
|
|
|
const AP_Logger::PID_Info *pid_info; |
|
|
|
|
pid_info = &g.pidPitch2Srv.get_pid_info(); |
|
|
|
|
mavlink_msg_pid_tuning_send(chan, PID_TUNING_PITCH, |
|
|
|
|
pid_info->desired, |
|
|
|
|
pid_info->actual, |
|
|
|
|
pid_info->FF, |
|
|
|
|
pid_info->P, |
|
|
|
|
pid_info->I, |
|
|
|
|
pid_info->D); |
|
|
|
|
if (!HAVE_PAYLOAD_SPACE(chan, PID_TUNING)) { |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// Yaw PID
|
|
|
|
|
if (g.gcs_pid_mask & 2) { |
|
|
|
|
const AP_Logger::PID_Info *pid_info; |
|
|
|
|
pid_info = &g.pidYaw2Srv.get_pid_info(); |
|
|
|
|
mavlink_msg_pid_tuning_send(chan, PID_TUNING_YAW, |
|
|
|
|
pid_info->desired, |
|
|
|
|
pid_info->actual, |
|
|
|
|
pid_info->FF, |
|
|
|
|
pid_info->P, |
|
|
|
|
pid_info->I, |
|
|
|
|
pid_info->D); |
|
|
|
|
if (!HAVE_PAYLOAD_SPACE(chan, PID_TUNING)) { |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
bool GCS_MAVLINK_Tracker::handle_guided_request(AP_Mission::Mission_Command&) |
|
|
|
|
{ |
|
|
|
@ -101,6 +139,23 @@ void GCS_MAVLINK_Tracker::handle_change_alt_request(AP_Mission::Mission_Command&
@@ -101,6 +139,23 @@ void GCS_MAVLINK_Tracker::handle_change_alt_request(AP_Mission::Mission_Command&
|
|
|
|
|
// do nothing
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// try to send a message, return false if it won't fit in the serial tx buffer
|
|
|
|
|
bool GCS_MAVLINK_Tracker::try_send_message(enum ap_message id) |
|
|
|
|
{ |
|
|
|
|
switch (id) { |
|
|
|
|
|
|
|
|
|
case MSG_PID_TUNING: |
|
|
|
|
CHECK_PAYLOAD_SIZE(PID_TUNING); |
|
|
|
|
tracker.send_pid_tuning(chan); |
|
|
|
|
break; |
|
|
|
|
|
|
|
|
|
default: |
|
|
|
|
return GCS_MAVLINK::try_send_message(id); |
|
|
|
|
} |
|
|
|
|
return true; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
default stream rates to 1Hz |
|
|
|
|
*/ |
|
|
|
@ -219,6 +274,7 @@ static const ap_message STREAM_RC_CHANNELS_msgs[] = {
@@ -219,6 +274,7 @@ static const ap_message STREAM_RC_CHANNELS_msgs[] = {
|
|
|
|
|
}; |
|
|
|
|
static const ap_message STREAM_EXTRA1_msgs[] = { |
|
|
|
|
MSG_ATTITUDE, |
|
|
|
|
MSG_PID_TUNING, |
|
|
|
|
}; |
|
|
|
|
static const ap_message STREAM_EXTRA3_msgs[] = { |
|
|
|
|
MSG_AHRS, |
|
|
|
|