There are two main classes of controllers used to drive robots in FRC:
Game controllers are the vast majority of the controllers used by FRC teams. Typical Game Controllers include:
The predominant Joystick in use is:
XBOX - team 5911 - Hafsa
Logitech - team 1310 - Cole
Playstation - team 1310 - Tomasz
X3DPro Joystick - 5596 Khalil
Turning Algorithm
team 1310 - Cole
team 5596 - Khalil
The typical Game Controller has the following features:
From Wikipedia (XBox 360 controller):
One unfortunate property of Game Controllers is that the DriverStation maps each of the game controller types from the various manufacturers differently. The buttons, sticks, and triggers may differ between controllers, and can even differ based on mode within a controller (the F310 has X mode and D mode).
This means that if you switch controller types, or even switch a setting on a controller, the code may not work properly.
In order to separate the button numbers from the buttons, we implemented a GameController class:
The Toronto Framework code allows the coder to easily program for the correct game controller stick and axis without needing to know the axis number or button numbers from the SmartDashboard. To change the controller to a PlayStation controller, a GameController_PlayStation class needs to be instantiated instead of a Logitech game controller, and all of the code remains the same. The buttons A,B,X,Y would be mapped by position to the Square, Circle, Cross, Triangle buttons on Playstation controller. This is much easier than using the WPILib code where each instance of getRawAxis, or getRawButton would need to be updated for the new game controller type.