From 6b6ad6ddf2b34836c356282b8e6e12337a1c94f4 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 17 Apr 2017 12:14:57 +1000 Subject: [PATCH] AP_AHRS: fixed wrap of yaw in AHRS_View --- libraries/AP_AHRS/AP_AHRS_View.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libraries/AP_AHRS/AP_AHRS_View.cpp b/libraries/AP_AHRS/AP_AHRS_View.cpp index 13d328a7cb..7546ccbf4b 100644 --- a/libraries/AP_AHRS/AP_AHRS_View.cpp +++ b/libraries/AP_AHRS/AP_AHRS_View.cpp @@ -62,6 +62,9 @@ void AP_AHRS_View::update(bool skip_ins_update) roll_sensor = degrees(roll) * 100; pitch_sensor = degrees(pitch) * 100; yaw_sensor = degrees(yaw) * 100; + if (yaw_sensor < 0) { + yaw_sensor += 36000; + } ahrs.calc_trig(rot_body_to_ned, trig.cos_roll, trig.cos_pitch, trig.cos_yaw,