brians | 343bc11 | 2013-02-10 01:53:46 +0000 | [diff] [blame] | 1 | #include "WPILib/DriverStation.h" |
| 2 | #include "WPILib/RobotBase.h" |
| 3 | |
| 4 | namespace aos { |
| 5 | namespace crio { |
| 6 | |
Brian Silverman | 3204dd8 | 2013-03-12 18:42:01 -0700 | [diff] [blame] | 7 | // Designed for a subclass (that implements all of the pure virtual methods...) |
| 8 | // to be passed to START_ROBOT_CLASS (a WPILib macro) to start all of the code. |
brians | 343bc11 | 2013-02-10 01:53:46 +0000 | [diff] [blame] | 9 | class ControlsManager : public RobotBase { |
| 10 | public: |
Brian Silverman | ffe3d71 | 2013-03-15 21:35:59 -0700 | [diff] [blame^] | 11 | ControlsManager(); |
| 12 | |
brians | 343bc11 | 2013-02-10 01:53:46 +0000 | [diff] [blame] | 13 | virtual void StartCompetition(); |
Brian Silverman | 3204dd8 | 2013-03-12 18:42:01 -0700 | [diff] [blame] | 14 | |
| 15 | static ControlsManager &GetInstance() { |
brians | 343bc11 | 2013-02-10 01:53:46 +0000 | [diff] [blame] | 16 | return *static_cast<ControlsManager *>(&RobotBase::getInstance()); |
| 17 | } |
Brian Silverman | 3204dd8 | 2013-03-12 18:42:01 -0700 | [diff] [blame] | 18 | DriverStation *GetDS() { |
brians | 343bc11 | 2013-02-10 01:53:46 +0000 | [diff] [blame] | 19 | return m_ds; |
| 20 | } |
Brian Silverman | 3204dd8 | 2013-03-12 18:42:01 -0700 | [diff] [blame] | 21 | |
| 22 | private: |
| 23 | // Hooks that subclasses have to implement to do the correct things at the |
| 24 | // correct times. |
Brian Silverman | ffe3d71 | 2013-03-15 21:35:59 -0700 | [diff] [blame^] | 25 | virtual void CreateObjects() = 0; |
Brian Silverman | 3204dd8 | 2013-03-12 18:42:01 -0700 | [diff] [blame] | 26 | virtual void RegisterControlLoops() = 0; |
| 27 | virtual void StartSensorBroadcasters() = 0; |
brians | 343bc11 | 2013-02-10 01:53:46 +0000 | [diff] [blame] | 28 | }; |
| 29 | |
| 30 | } // namespace crio |
| 31 | } // namespace aos |