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 | |
| 4 | namespace frc971 { |
| 5 | namespace control_loops { |
| 6 | namespace drivetrain { |
| 7 | |
| 8 | // The state of the shift. |
| 9 | enum class Gear { HIGH, LOW, SHIFTING_UP, SHIFTING_DOWN }; |
| 10 | |
| 11 | // True if the the robot might or is trying to be in high gear. |
| 12 | inline 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. |
| 17 | inline 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_ |