From 2a8375e82fb81929f55ed10f929ec0313b4448f2 Mon Sep 17 00:00:00 2001 From: robertik10 <58191510+robertik10@users.noreply.github.com> Date: Mon, 15 Jan 2024 14:01:00 +0100 Subject: [PATCH] Update coordinate_transformation.py removed transformation when calculating heading-> Ready for merge --- .../src/coordinate_transformation.py | 21 ++++++++++--------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/code/perception/src/coordinate_transformation.py b/code/perception/src/coordinate_transformation.py index f228dda5..8e817ab2 100755 --- a/code/perception/src/coordinate_transformation.py +++ b/code/perception/src/coordinate_transformation.py @@ -132,16 +132,17 @@ def quat_to_heading(quaternion): raw_heading = theta - # transform raw_heading so that: - # --------------------------------------------------------------- - # | 0 = x-axis | pi/2 = y-axis | pi = -x-axis | -pi/2 = -y-axis | - # --------------------------------------------------------------- - # The above transformation limits the heading to the range of -pi to pi - # It also rotates the heading by 90 degrees so that the heading is in - # the direction of the x-axis which the car starts in (heading = 0) - - # heading is positive in counter clockwise rotations - heading = (raw_heading - (math.pi / 2)) % (2 * math.pi) - math.pi + # # transform raw_heading so that: + # # --------------------------------------------------------------- + # # | 0 = x-axis | pi/2 = y-axis | pi = -x-axis | -pi/2 = -y-axis | + # # --------------------------------------------------------------- + # # The above transformation limits the heading to the range of -pi to pi + # # It also rotates the heading by 90 degrees so that the heading is in + # # the direction of the x-axis which the car starts in (heading = 0) + + # # heading is positive in counter clockwise rotations + # heading = (raw_heading - (math.pi / 2)) % (2 * math.pi) - math.pi + heading = raw_heading return heading