From dac8873d3066b2325d3f180900c47d28d6eac889 Mon Sep 17 00:00:00 2001 From: humanoids <lfreixas@iri.upc.edu> Date: Fri, 26 Aug 2016 11:27:14 +0200 Subject: [PATCH] solved bug in mtn_library --- motion/src/mtn_library.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/motion/src/mtn_library.c b/motion/src/mtn_library.c index b7c143d..d0aa135 100644 --- a/motion/src/mtn_library.c +++ b/motion/src/mtn_library.c @@ -337,9 +337,9 @@ int compass_deviation (int ini, int actual){ //Calculates the difference between int add_angles (int a, int b){ int res = a+b; - if (res < 0 ) res+=360; - else if (res>360){ - res-=360; + if (res < 0 ) res+=3600; + else if (res>3600){ + res-=3600; } return res; -- GitLab