blob: a2c7e36fb210321838afb4e317dd1ed50c8b85b2 [file] [log] [blame]
#ifndef Y2019_JOYSTICK_ANGLE_H_
#define Y2019_JOYSTICK_ANGLE_H_
#include "aos/input/driver_station_data.h"
using ::aos::input::driver_station::JoystickAxis;
using ::aos::input::driver_station::Data;
namespace y2019 {
namespace input {
namespace joysticks {
namespace {
constexpr double kJoystickLeft = -0.5;
constexpr double kJoystickRight = 0.5;
constexpr double kJoystickUp = 0.5;
constexpr double kJoystickDown = -0.5;
}
enum class JoystickAngle {
kDefault,
kUpperRight,
kMiddleRight,
kLowerRight,
kUpperLeft,
kMiddleLeft,
kLowerLeft
};
JoystickAngle GetJoystickPosition(const JoystickAxis &x_axis,
const JoystickAxis &y_axis, const Data &data);
JoystickAngle GetJoystickPosition(float x_axis, float y_axis);
} // namespace joysticks
} // namespace input
} // namespace y2019
#endif // Y2019_JOYSTICK_ANGLE_H_