blob: a2c7e36fb210321838afb4e317dd1ed50c8b85b2 [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 {
12namespace {
13constexpr double kJoystickLeft = -0.5;
14constexpr double kJoystickRight = 0.5;
15constexpr double kJoystickUp = 0.5;
16constexpr double kJoystickDown = -0.5;
17}
18
19enum class JoystickAngle {
20 kDefault,
21 kUpperRight,
22 kMiddleRight,
23 kLowerRight,
24 kUpperLeft,
25 kMiddleLeft,
26 kLowerLeft
27};
28
29JoystickAngle GetJoystickPosition(const JoystickAxis &x_axis,
30 const JoystickAxis &y_axis, const Data &data);
31JoystickAngle GetJoystickPosition(float x_axis, float y_axis);
32
33} // namespace joysticks
34} // namespace input
35} // namespace y2019
36
37#endif // Y2019_JOYSTICK_ANGLE_H_