mirror of
https://github.com/team2059/Dent
synced 2024-12-18 20:52:29 -05:00
Added DentRobot.h
This commit is contained in:
parent
180884bfe7
commit
0036f2dd7a
@ -1,38 +1,25 @@
|
||||
#include "WPILib.h"
|
||||
#include "Commands/Drive.h"
|
||||
#include "Commands/Collect.h"
|
||||
#include "Commands/Eject.h"
|
||||
#include "Commands/Raise.h"
|
||||
#include "Commands/Lower.h"
|
||||
class DentRobot: public IterativeRobot {
|
||||
private:
|
||||
Command *autonomousCommand = NULL;
|
||||
LiveWindow *lw;
|
||||
void RobotInit() {
|
||||
CommandBase::init();
|
||||
lw = LiveWindow::GetInstance();
|
||||
}
|
||||
void DisabledPeriodic() {
|
||||
Scheduler::GetInstance()->Run();
|
||||
}
|
||||
void AutonomousInit() {
|
||||
if(autonomousCommand != NULL) {
|
||||
autonomousCommand->Start();
|
||||
}
|
||||
}
|
||||
void AutonomousPeriodic() {
|
||||
Scheduler::GetInstance()->Run();
|
||||
}
|
||||
void TeleopInit() {
|
||||
if(autonomousCommand != NULL) {
|
||||
autonomousCommand->Cancel();
|
||||
}
|
||||
}
|
||||
void TeleopPeriodic() {
|
||||
Scheduler::GetInstance()->Run();
|
||||
}
|
||||
void TestPeriodic() {
|
||||
lw->Run();
|
||||
}
|
||||
};
|
||||
#include "DentRobot.h"
|
||||
DentRobot::DentRobot():
|
||||
driveCommand(new Drive()){
|
||||
printf("Initialized");
|
||||
}
|
||||
void DentRobot::RobotInit(){
|
||||
printf("Initializing");
|
||||
CommandBase::init();
|
||||
}
|
||||
void DentRobot::DisabledPeriodic(){
|
||||
Scheduler::GetInstance()->Run();
|
||||
}
|
||||
void DentRobot::AutonomousInit(){
|
||||
}
|
||||
void DentRobot::AutonomousPeriodic(){
|
||||
Scheduler::GetInstance()->Run();
|
||||
}
|
||||
void DentRobot::TeleopInit(){
|
||||
}
|
||||
void DentRobot::TeleopPeriodic(){
|
||||
Scheduler::GetInstance()->Run();
|
||||
}
|
||||
void DentRobot::TestPeriodic(){
|
||||
}
|
||||
START_ROBOT_CLASS(DentRobot);
|
||||
|
23
src/DentRobot.h
Normal file
23
src/DentRobot.h
Normal file
@ -0,0 +1,23 @@
|
||||
#ifndef DENTROBOT_H
|
||||
#define DENTROBOT_H
|
||||
#include "WPILib.h"
|
||||
#include "Commands/Drive.h"
|
||||
#include "Commands/Collect.h"
|
||||
#include "Commands/Eject.h"
|
||||
#include "Commands/Raise.h"
|
||||
#include "Commands/Lower.h"
|
||||
class DentRobot: public IterativeRobot {
|
||||
private:
|
||||
Command *driveCommand = NULL;
|
||||
public:
|
||||
DentRobot();
|
||||
void RobotInit();
|
||||
void DisabledPeriodic();
|
||||
void AutonomousInit();
|
||||
void AutonomousPeriodic();
|
||||
void TeleopInit();
|
||||
void TeleopPeriodic();
|
||||
void TestPeriodic();
|
||||
};
|
||||
#endif
|
||||
// vim: ts=2:sw=2:et
|
Loading…
Reference in New Issue
Block a user