You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With the gamepads we have, putting the joystick at 45 degrees, does not output a (1, 1) position, the easiest way to get around this is take the position on the unit circle we get from controller.leftX and controller.leftY, and convert it to polar coordinates, giving us an angle and a magnitude.
CommandXboxPolarController class, that wraps CommandXboxController to add the functionality of a controller.leftAngle and controller.rightAngle that returns a rotation2d storing the direction the joystick is facing, as well as a controller.leftMagnitude and controller.rightMagnitude that return the polar length, on [0, 1], no negative numbers. This class should be placed in src/java/lib/controllers
The text was updated successfully, but these errors were encountered:
With the gamepads we have, putting the joystick at 45 degrees, does not output a (1, 1) position, the easiest way to get around this is take the position on the unit circle we get from
controller.leftX
andcontroller.leftY
, and convert it to polar coordinates, giving us an angle and a magnitude.Resources:
Completion Criteria
CommandXboxPolarController
class, that wrapsCommandXboxController
to add the functionality of acontroller.leftAngle
andcontroller.rightAngle
that returns a rotation2d storing the direction the joystick is facing, as well as acontroller.leftMagnitude
andcontroller.rightMagnitude
that return the polar length, on [0, 1], no negative numbers. This class should be placed insrc/java/lib/controllers
The text was updated successfully, but these errors were encountered: