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