A subsystem on a robot is a distinct part of the robot that performs a certain function. Within the command based robot framework, subsystems are encapsulated (represented) by classes.
Subsystems can contain the following attributes:
Note: Simple subsystems may be missing one or more of these attributes.
Default commands are commands that run on a subsystem when no other command is running that requires the subsystem. They are the default behavior for the subsystem. This is often as simple as a do nothing command so that when a command driving the robot stops, the drive train of the robot stops as opposed to continuing the last motion it was given. It’s also possible to have more complicated default commands such as a turret that continuously tracks a target when not doing anything else.
Default commands are created just like any other command. The only minor difference when creating default commands is that you should generally have the isFinished() method return false so that the command is running continuously as opposed to stopping and restarting continuously when no other command is running.
Subsystem are primarily used as an organizational concept. In object oriented programming, they also are a very good basis for dividing up your robot into seperate classes that encapsulate the relevant behaviour.
UNFINISHED