blob: aa785878ce634a5dd602a9d821afa6034a5d2824 [file] [log] [blame]
brians343bc112013-02-10 01:53:46 +00001#include "WPILib/DriverStation.h"
2#include "WPILib/RobotBase.h"
3
4namespace aos {
5namespace crio {
6
Brian Silverman3204dd82013-03-12 18:42:01 -07007// 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.
brians343bc112013-02-10 01:53:46 +00009class ControlsManager : public RobotBase {
10 public:
brians343bc112013-02-10 01:53:46 +000011 virtual void StartCompetition();
Brian Silverman3204dd82013-03-12 18:42:01 -070012
13 static ControlsManager &GetInstance() {
brians343bc112013-02-10 01:53:46 +000014 return *static_cast<ControlsManager *>(&RobotBase::getInstance());
15 }
Brian Silverman3204dd82013-03-12 18:42:01 -070016 DriverStation *GetDS() {
brians343bc112013-02-10 01:53:46 +000017 return m_ds;
18 }
Brian Silverman3204dd82013-03-12 18:42:01 -070019
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;
brians343bc112013-02-10 01:53:46 +000025};
26
27} // namespace crio
28} // namespace aos