blob: 8fabb69501fd0157d03c7d192c45d824a84a4d4c [file] [log] [blame]
Austin Schuh093535c2016-03-05 23:21:00 -08001#ifndef FRC971_CONTROL_LOOPS_GEAR_H_
2#define FRC971_CONTROL_LOOPS_GEAR_H_
3
4namespace frc971 {
5namespace control_loops {
6namespace drivetrain {
7
8// The state of the shift.
9enum class Gear { HIGH, LOW, SHIFTING_UP, SHIFTING_DOWN };
10
11// True if the the robot might or is trying to be in high gear.
12inline bool MaybeHigh(Gear g) {
13 return g == Gear::HIGH || g == Gear::SHIFTING_UP;
14}
15
16// True if the shifter is engaged and ready for action.
17inline bool IsInGear(Gear gear) {
18 return gear == Gear::LOW || gear == Gear::HIGH;
19}
20
21} // namespace drivetrain
22} // namespace control_loops
23} // namespace frc971
24
25#endif // FRC971_CONTROL_LOOPS_GEAR_H_