blob: ec8b52a34de164d89a934b3c18791c6e7e98e35e [file] [log] [blame]
Brian Silvermanc2065732015-11-28 22:55:30 +00001#ifndef AOS_INPUT_JOYSTICK_INPUT_H_
2#define AOS_INPUT_JOYSTICK_INPUT_H_
Brian Silvermanba3de7e2013-05-08 16:18:15 -07003
4#include "aos/common/input/driver_station_data.h"
5
6namespace aos {
7namespace input {
8
Brian Silvermanc25bc892013-05-09 19:09:34 -07009// A class for handling joystick packet values.
10// It will call RunIteration each time a new packet is received.
11//
Brian Silverman699f0cb2015-02-05 19:45:01 -050012// This class automatically handles updating ::aos::joystick_state and logging
13// (at INFO) button edges.
Brian Silvermanba3de7e2013-05-08 16:18:15 -070014class JoystickInput {
15 public:
16 void Run();
17
18 private:
Brian Silvermanc25bc892013-05-09 19:09:34 -070019 // Subclasses should do whatever they want with data here.
Brian Silvermanba3de7e2013-05-08 16:18:15 -070020 virtual void RunIteration(const driver_station::Data &data) = 0;
21};
22
Austin Schuh374fd172014-10-25 17:57:54 -070023// Class which will proxy joystick information from UDP packets to the queues.
24class JoystickProxy {
25 public:
26 void Run();
27};
28
Brian Silvermanba3de7e2013-05-08 16:18:15 -070029} // namespace input
30} // namespace aos
31
Brian Silvermanc2065732015-11-28 22:55:30 +000032#endif // AOS_INPUT_JOYSTICK_INPUT_H_