Skip to content

Commit 0598434

Browse files
committed
Update comment
1 parent 092edf9 commit 0598434

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

commands2/button/commandjoystick.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,8 +207,13 @@ def getDirectionRadians(self) -> float:
207207
:returns: The direction of the vector in radians
208208
"""
209209
# https://docs.wpilib.org/en/stable/docs/software/basic-programming/coordinate-system.html#joystick-and-controller-coordinate-system
210-
# +X is right and +Y is back, so 0 radians is right and CW is positive. Rotate by 90 degrees
211-
# CCW to make 0 radians forward and CW positive.
210+
# A positive rotation around the X axis moves the joystick right, and a
211+
# positive rotation around the Y axis moves the joystick backward. When
212+
# treating them as translations, 0 radians is measured from the right
213+
# direction, and angle increases clockwise.
214+
#
215+
# It's rotated 90 degrees CCW (y is negated and the arguments are reversed)
216+
# so that 0 radians is forward.
212217
return self._hid.getDirectionRadians()
213218

214219
def getDirectionDegrees(self) -> float:

0 commit comments

Comments
 (0)