Tyler Chatow | d28951f | 2019-02-16 20:12:28 -0800 | [diff] [blame] | 1 | #ifndef Y2019_JOYSTICK_ANGLE_H_ |
| 2 | #define Y2019_JOYSTICK_ANGLE_H_ |
| 3 | |
| 4 | #include "aos/input/driver_station_data.h" |
| 5 | |
| 6 | using ::aos::input::driver_station::JoystickAxis; |
| 7 | using ::aos::input::driver_station::Data; |
| 8 | |
| 9 | namespace y2019 { |
| 10 | namespace input { |
| 11 | namespace joysticks { |
Tyler Chatow | c8012ca | 2019-02-18 22:33:01 -0800 | [diff] [blame] | 12 | bool AngleCloseTo(double angle, double near, double range); |
Tyler Chatow | d28951f | 2019-02-16 20:12:28 -0800 | [diff] [blame] | 13 | |
| 14 | enum class JoystickAngle { |
| 15 | kDefault, |
| 16 | kUpperRight, |
| 17 | kMiddleRight, |
| 18 | kLowerRight, |
| 19 | kUpperLeft, |
| 20 | kMiddleLeft, |
| 21 | kLowerLeft |
| 22 | }; |
| 23 | |
| 24 | JoystickAngle GetJoystickPosition(const JoystickAxis &x_axis, |
| 25 | const JoystickAxis &y_axis, const Data &data); |
| 26 | JoystickAngle GetJoystickPosition(float x_axis, float y_axis); |
| 27 | |
| 28 | } // namespace joysticks |
| 29 | } // namespace input |
| 30 | } // namespace y2019 |
| 31 | |
| 32 | #endif // Y2019_JOYSTICK_ANGLE_H_ |