Skip to content

Commit

Permalink
Update coordinate_transformation.py
Browse files Browse the repository at this point in the history
removed transformation when calculating heading-> Ready for merge
  • Loading branch information
robertik10 authored Jan 15, 2024
1 parent c7f33c6 commit 2a8375e
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions code/perception/src/coordinate_transformation.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 2a8375e

Please sign in to comment.