blob: ff43e20f237aa830ad69e8f7d938fc87c1a66d6b [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
Stephan Pleinesf63bde82024-01-13 15:59:33 -08004namespace frc971::control_loops::drivetrain {
Austin Schuh093535c2016-03-05 23:21:00 -08005// The state of the shift.
6enum class Gear { HIGH, LOW, SHIFTING_UP, SHIFTING_DOWN };
7
8// True if the the robot might or is trying to be in high gear.
9inline bool MaybeHigh(Gear g) {
10 return g == Gear::HIGH || g == Gear::SHIFTING_UP;
11}
12
13// True if the shifter is engaged and ready for action.
14inline bool IsInGear(Gear gear) {
15 return gear == Gear::LOW || gear == Gear::HIGH;
16}
17
Stephan Pleinesf63bde82024-01-13 15:59:33 -080018} // namespace frc971::control_loops::drivetrain
Austin Schuh093535c2016-03-05 23:21:00 -080019
20#endif // FRC971_CONTROL_LOOPS_GEAR_H_