blob: 3deb0e4d8ffc8d70524504182ec92e98bed7fb6d [file] [log] [blame]
Campbell Crowleyc0cfb132015-12-30 20:58:02 -08001#ifndef FRC971_WPILIB_NEWROBOTBASE_H_
2#define FRC971_WPILIB_NEWROBOTBASE_H_
3
Parker Schuhd3b7a8872018-02-19 16:42:27 -08004#include "frc971/wpilib/ahal/RobotBase.h"
Campbell Crowleyc0cfb132015-12-30 20:58:02 -08005
6namespace frc971 {
7namespace wpilib {
8
9class WPILibRobotBase {
10public:
11 virtual void Run() = 0;
12};
13
14#define AOS_ROBOT_CLASS(_ClassName_) \
15 START_ROBOT_CLASS(::frc971::wpilib::WPILibAdapterRobot<_ClassName_>)
16
17template <typename T>
Parker Schuhd3b7a8872018-02-19 16:42:27 -080018class WPILibAdapterRobot : public frc::RobotBase {
Campbell Crowleyc0cfb132015-12-30 20:58:02 -080019 public:
20 void StartCompetition() override { robot_.Run(); }
21
22 private:
23 T robot_;
24};
25
Brian Silverman4be7ffe2016-01-02 14:16:06 -080026} // namespace wpilib
27} // namespace frc971
Campbell Crowleyc0cfb132015-12-30 20:58:02 -080028
Brian Silverman4be7ffe2016-01-02 14:16:06 -080029#endif // FRC971_WPILIB_NEWROBOTBASE_H_