blob: 2dad9682da5e8e6e4c340b5240ee87ed7510881c [file] [log] [blame]
Tyler Chatowd28951f2019-02-16 20:12:28 -08001#ifndef Y2019_JOYSTICK_ANGLE_H_
2#define Y2019_JOYSTICK_ANGLE_H_
3
James Kuszmaul7077d342021-06-09 20:23:58 -07004#include "frc971/input/driver_station_data.h"
Tyler Chatowd28951f2019-02-16 20:12:28 -08005
James Kuszmaul7077d342021-06-09 20:23:58 -07006using ::frc971::input::driver_station::Data;
7using ::frc971::input::driver_station::JoystickAxis;
Tyler Chatowd28951f2019-02-16 20:12:28 -08008
Stephan Pleinesd99b1ee2024-02-02 20:56:44 -08009namespace y2019::input::joysticks {
Tyler Chatowc8012ca2019-02-18 22:33:01 -080010bool AngleCloseTo(double angle, double near, double range);
Tyler Chatowd28951f2019-02-16 20:12:28 -080011
12enum class JoystickAngle {
13 kDefault,
14 kUpperRight,
15 kMiddleRight,
16 kLowerRight,
17 kUpperLeft,
18 kMiddleLeft,
19 kLowerLeft
20};
21
22JoystickAngle GetJoystickPosition(const JoystickAxis &x_axis,
23 const JoystickAxis &y_axis, const Data &data);
24JoystickAngle GetJoystickPosition(float x_axis, float y_axis);
25
Stephan Pleinesd99b1ee2024-02-02 20:56:44 -080026} // namespace y2019::input::joysticks
Tyler Chatowd28951f2019-02-16 20:12:28 -080027
28#endif // Y2019_JOYSTICK_ANGLE_H_