Brian Silverman | 14fd0fb | 2014-01-14 21:42:01 -0800 | [diff] [blame] | 1 | #ifndef AOS_LINUX_CODE_INPUT_JOYSTICKS_INPUT_H_ |
| 2 | #define AOS_LINUX_CODE_INPUT_JOYSTICKS_INPUT_H_ |
Brian Silverman | ba3de7e | 2013-05-08 16:18:15 -0700 | [diff] [blame] | 3 | |
| 4 | #include "aos/common/input/driver_station_data.h" |
| 5 | |
| 6 | namespace aos { |
| 7 | namespace input { |
| 8 | |
Brian Silverman | c25bc89 | 2013-05-09 19:09:34 -0700 | [diff] [blame] | 9 | // A class for handling joystick packet values. |
| 10 | // It will call RunIteration each time a new packet is received. |
| 11 | // |
| 12 | // This class automatically handles updating ::aos::robot_state and logging (at |
| 13 | // INFO) button edges. |
Brian Silverman | ba3de7e | 2013-05-08 16:18:15 -0700 | [diff] [blame] | 14 | class JoystickInput { |
| 15 | public: |
| 16 | void Run(); |
| 17 | |
| 18 | private: |
Brian Silverman | c25bc89 | 2013-05-09 19:09:34 -0700 | [diff] [blame] | 19 | // Subclasses should do whatever they want with data here. |
Brian Silverman | ba3de7e | 2013-05-08 16:18:15 -0700 | [diff] [blame] | 20 | virtual void RunIteration(const driver_station::Data &data) = 0; |
| 21 | }; |
| 22 | |
Austin Schuh | 374fd17 | 2014-10-25 17:57:54 -0700 | [diff] [blame] | 23 | // Class which will proxy joystick information from UDP packets to the queues. |
| 24 | class JoystickProxy { |
| 25 | public: |
| 26 | void Run(); |
| 27 | }; |
| 28 | |
Brian Silverman | ba3de7e | 2013-05-08 16:18:15 -0700 | [diff] [blame] | 29 | } // namespace input |
| 30 | } // namespace aos |
| 31 | |
Brian Silverman | 14fd0fb | 2014-01-14 21:42:01 -0800 | [diff] [blame] | 32 | #endif // AOS_LINUX_CODE_INPUT_JOYSTICKS_INPUT_H_ |