Austin Schuh | 093535c | 2016-03-05 23:21:00 -0800 | [diff] [blame] | 1 | #ifndef FRC971_CONTROL_LOOPS_GEAR_H_ |
| 2 | #define FRC971_CONTROL_LOOPS_GEAR_H_ |
| 3 | |
Stephan Pleines | f63bde8 | 2024-01-13 15:59:33 -0800 | [diff] [blame] | 4 | namespace frc971::control_loops::drivetrain { |
Austin Schuh | 093535c | 2016-03-05 23:21:00 -0800 | [diff] [blame] | 5 | // The state of the shift. |
| 6 | enum class Gear { HIGH, LOW, SHIFTING_UP, SHIFTING_DOWN }; |
| 7 | |
| 8 | // True if the the robot might or is trying to be in high gear. |
| 9 | inline 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. |
| 14 | inline bool IsInGear(Gear gear) { |
| 15 | return gear == Gear::LOW || gear == Gear::HIGH; |
| 16 | } |
| 17 | |
Stephan Pleines | f63bde8 | 2024-01-13 15:59:33 -0800 | [diff] [blame] | 18 | } // namespace frc971::control_loops::drivetrain |
Austin Schuh | 093535c | 2016-03-05 23:21:00 -0800 | [diff] [blame] | 19 | |
| 20 | #endif // FRC971_CONTROL_LOOPS_GEAR_H_ |