-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRobot.cpp
More file actions
44 lines (38 loc) · 967 Bytes
/
Robot.cpp
File metadata and controls
44 lines (38 loc) · 967 Bytes
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
/** Singleton instance for a robot that contains all of the relevant
* subsystems. Provides methods for initializing and setting radiation levels
* @author Jordan Burklund
* @date Sept. 2015
**/
#include "Robot.h"
Robot* Robot::instance = NULL;
/* Constructor */
Robot::Robot() {}
/** Gets the Singleton instance of this robot.
* @return Pointer to the Robot object
**/
Robot* Robot::getInstance() {
if(instance == NULL) {
instance = new Robot();
}
return instance;
}
/** Calls initialize methods for all subsystems
**/
void Robot::initializeSubsystems() {
initializePauseTimer();
drivetrain->initialize();
button->initialize();
roller->initialize();
radInd->initialize();
}
/** Set the radiation level for the robot
* when the robot is carying an unshielded rod
**/
void Robot::setRadLevel(int newRadLevel) {
radLevel = newRadLevel;
}
/** Get the radiation level for the robot
**/
int Robot::getRadLevel() {
return radLevel;
}