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: |
brians | 343bc11 | 2013-02-10 01:53:46 +0000 | [diff] [blame] | 11 | virtual void StartCompetition(); |
Brian Silverman | 3204dd8 | 2013-03-12 18:42:01 -0700 | [diff] [blame^] | 12 | |
| 13 | static ControlsManager &GetInstance() { |
brians | 343bc11 | 2013-02-10 01:53:46 +0000 | [diff] [blame] | 14 | return *static_cast<ControlsManager *>(&RobotBase::getInstance()); |
| 15 | } |
Brian Silverman | 3204dd8 | 2013-03-12 18:42:01 -0700 | [diff] [blame^] | 16 | DriverStation *GetDS() { |
brians | 343bc11 | 2013-02-10 01:53:46 +0000 | [diff] [blame] | 17 | return m_ds; |
| 18 | } |
Brian Silverman | 3204dd8 | 2013-03-12 18:42:01 -0700 | [diff] [blame^] | 19 | |
| 20 | private: |
| 21 | // Hooks that subclasses have to implement to do the correct things at the |
| 22 | // correct times. |
| 23 | virtual void RegisterControlLoops() = 0; |
| 24 | virtual void StartSensorBroadcasters() = 0; |
brians | 343bc11 | 2013-02-10 01:53:46 +0000 | [diff] [blame] | 25 | }; |
| 26 | |
| 27 | } // namespace crio |
| 28 | } // namespace aos |