forked from rosekunkel/422-robot-2013
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTeam422Robot.cpp
67 lines (59 loc) · 1.37 KB
/
Team422Robot.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
/**
* @file Team422Robot.cpp
* @brief Implementation of the main class for the robot
* @author Nyle Rodgers
* @author William Kunkel
*/
#include "Team422Robot.h"
/**
* Robot-wide initialization, such as allocating Commands.
*
* @author Nyle Rodgers
* @author William Kunkel
*/
void Team422Robot::RobotInit() {
CommandBase::init();
autonomousCommand = new AutonomousCommand();
liveWindow = LiveWindow::GetInstance();
dashboard = DriverStationLCD::GetInstance();
}
/**
* Commands and other code to run at the beginning of the autonomous phase
*
* @author Nyle Rodgers
* @author William Kunkel
*/
void Team422Robot::AutonomousInit() {
autonomousCommand->Start();
}
/**
* Code to run periodically during the teleoperated phase, namely running the
* scheduler
*
* @author Nyle Rodgers
*/
void Team422Robot::AutonomousPeriodic() {
Scheduler::GetInstance()->Run();
}
void Team422Robot::TeleopInit() {
autonomousCommand->Cancel();
}
/**
* Code to run periodically during the autonomous phase, namely running the
* scheduler
*
* @author Nyle Rodgers
*/
void Team422Robot::TeleopPeriodic() {
Scheduler::GetInstance()->Run();
}
/**
* Code to run periodically while in test mode, like the Live Window
*
* @author Nyle Rodgers
*/
void Team422Robot::TestPeriodic() {
liveWindow->Run();
}
// Start the robot, the equivalent of the "main" function
START_ROBOT_CLASS(Team422Robot);