From 0f50abb78892dcb1b1f25058dbb69f4dd7c1adb7 Mon Sep 17 00:00:00 2001
From: Sergi Hernandez Juan <shernand@iri.upc.edu>
Date: Wed, 23 Sep 2020 17:17:01 +0200
Subject: [PATCH] Solved a bug in the angle normalization function.

---
 src/g2_spline.cpp | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/src/g2_spline.cpp b/src/g2_spline.cpp
index 90846f3..acb107c 100644
--- a/src/g2_spline.cpp
+++ b/src/g2_spline.cpp
@@ -1,7 +1,6 @@
 #include "g2_spline.h"
 #include <math.h>
 #include <boost/bind.hpp>
-#include <iostream>
 
 CG2Spline::CG2Spline()
 {
@@ -114,9 +113,9 @@ CG2Spline::CG2Spline(TPoint &start,TPoint &end)
 void CG2Spline::normalize_angle(double &angle)
 {
   if(angle>3.14159)
-    angle-=3.14159;
+    angle-=2*3.14159;
   else if(angle<-3.14159)
-    angle+=3.14159;
+    angle+=2*3.14159;
 }
 
 double CG2Spline::find_parameter(double length)
-- 
GitLab