The Fighting Calculators' code for the FRC 2016 game, FIRST Stronghold!
This project is built on FIRST's command-based programming framework, with structural changes to allow for dependency injection and better separation of concerns. For an overview of command-based programming, see FIRST's documentation.
Below is an overview of our different parts and how they all fit together.
The Config
classes in our project contain all robot configuration info. This is any static configuration that we load when the robot starts.
RobotConfig
contains references to all of our individual Config
classes, like JoysticksConfig
and WiringConfig
. Each of these config classes loads values from a .properties
file on the roboRIO and exposes those properties using getter methods.
DriverStation
contains the actual joystick instances. It requires an instance of RobotConfig
to be injected so that it can look up port numbers from JoysticksConfig
and GamepadConfig
.
DriverStation
provides methods that enable Commands to access values from the joysticks. DriverStation
also handles any input signal manipulation, such as deadband control.
Note: Unlike in previous years, DriverStation
will not handle output signal manipulation such as precision or turbo mode. That is the responsibility of the drive command! However, DriverStation
may provide a method such as isPrecisionModeEnabled()
to assist the command.
Also note: Unlike in previous years, DriverStation
will not be mapping commands to joystick buttons! That is the responsibility of JoystickEventMapper
, outlined below.
The RobotSubsystems
class contains references to all of our individual Subsystem
classes. It requires an instance of RobotConfig
to be injected so that each subsystem can look up any values it needs. It also requires an instance of DriverStation
for the purpose of setting up default commands on each subsystem.
RobotSubsystems
conveniently groups our subsystem references together so they can be passed to each of our commands.
The JoystickEventMapper
class maps commands to joystick buttons. This is basically the same behavior as any other year, but this year we are not doing this step from within DriverStation
(formerly OI
).