From b82098ca44bcfe18b92a38d3baec9dfbf2eb5281 Mon Sep 17 00:00:00 2001 From: Randy Mackay Date: Mon, 13 Mar 2017 11:21:47 +0900 Subject: [PATCH] AP_GPS: fix blended ground course Thanks to jyl58 for finding this --- libraries/AP_GPS/AP_GPS.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/AP_GPS/AP_GPS.cpp b/libraries/AP_GPS/AP_GPS.cpp index ca1ab2a3b9f..2223766edb3 100644 --- a/libraries/AP_GPS/AP_GPS.cpp +++ b/libraries/AP_GPS/AP_GPS.cpp @@ -1383,7 +1383,7 @@ void AP_GPS::calc_blended_state(void) // Calculate ground speed and course from blended velocity vector state[GPS_BLENDED_INSTANCE].ground_speed = norm(state[GPS_BLENDED_INSTANCE].velocity.x, state[GPS_BLENDED_INSTANCE].velocity.y); - state[GPS_BLENDED_INSTANCE].ground_course = wrap_360(degrees(atan2f(state[GPS_BLENDED_INSTANCE].velocity.x, state[GPS_BLENDED_INSTANCE].velocity.x))); + state[GPS_BLENDED_INSTANCE].ground_course = wrap_360(degrees(atan2f(state[GPS_BLENDED_INSTANCE].velocity.y, state[GPS_BLENDED_INSTANCE].velocity.x))); /* * The blended location in _output_state.location is not stable enough to be used by the autopilot