From c6b6320b43ea7bcb56205e9bcca294676dc92a87 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 15 Feb 2012 08:46:21 +1100 Subject: [PATCH] APM: report the nav_bearing as hold_course when enabled this gives a more accurate view of the navigation code, as when hold_course is not -1 it overrides nav_bearing --- ArduPlane/GCS_Mavlink.pde | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ArduPlane/GCS_Mavlink.pde b/ArduPlane/GCS_Mavlink.pde index c596cf66af..ed7b0167d1 100644 --- a/ArduPlane/GCS_Mavlink.pde +++ b/ArduPlane/GCS_Mavlink.pde @@ -322,12 +322,13 @@ static void NOINLINE send_location(mavlink_channel_t chan) static void NOINLINE send_nav_controller_output(mavlink_channel_t chan) { + int16_t bearing = (hold_course==-1?nav_bearing:hold_course) / 100; mavlink_msg_nav_controller_output_send( chan, nav_roll / 1.0e2, nav_pitch / 1.0e2, - nav_bearing / 1.0e2, - target_bearing / 1.0e2, + bearing, + target_bearing / 100, wp_distance, altitude_error / 1.0e2, airspeed_error,