forked from Team254/FRC-2019-Public
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Subsystem.java
33 lines (24 loc) · 1.29 KB
/
Subsystem.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
package com.team254.frc2019.subsystems;
import com.team254.frc2019.loops.ILooper;
/**
* The Subsystem abstract class, which serves as a basic framework for all robot subsystems. Each subsystem outputs
* commands to SmartDashboard, has a stop routine (for after each match), and a routine to zero all sensors, which helps
* with calibration.
* <p>
* All Subsystems only have one instance (after all, one robot does not have two drivetrains), and functions get the
* instance of the drivetrain and act accordingly. Subsystems are also a state machine with a desired state and actual
* state; the robot code will try to match the two states with actions. Each Subsystem also is responsible for
* instantializing all member components at the start of the match.
*/
public abstract class Subsystem {
public void writeToLog() {}
// Optional design pattern for caching periodic reads to avoid hammering the HAL/CAN.
public void readPeriodicInputs() {}
// Optional design pattern for caching periodic writes to avoid hammering the HAL/CAN.
public void writePeriodicOutputs() {}
public void registerEnabledLoops(ILooper mEnabledLooper) {}
public void zeroSensors() {}
public abstract void stop();
public abstract boolean checkSystem();
public abstract void outputTelemetry();
}