summaryrefslogtreecommitdiff
path: root/src/org/usfirst/frc/team4272/robot2017/Robot.java
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@lukeshu.com>2017-04-04 16:20:55 -0400
committerLuke Shumaker <lukeshu@lukeshu.com>2017-04-04 16:20:55 -0400
commit31a99043d50cae624c956a8a8f80146a1c430d16 (patch)
tree75e3d8ead115e3614c41e913d2aec87519454a9c /src/org/usfirst/frc/team4272/robot2017/Robot.java
parent36dd135b709840a7a18093195fae6ecbfba34e36 (diff)
stuff
Diffstat (limited to 'src/org/usfirst/frc/team4272/robot2017/Robot.java')
-rw-r--r--src/org/usfirst/frc/team4272/robot2017/Robot.java48
1 files changed, 41 insertions, 7 deletions
diff --git a/src/org/usfirst/frc/team4272/robot2017/Robot.java b/src/org/usfirst/frc/team4272/robot2017/Robot.java
index b65ce35..851f3f1 100644
--- a/src/org/usfirst/frc/team4272/robot2017/Robot.java
+++ b/src/org/usfirst/frc/team4272/robot2017/Robot.java
@@ -43,27 +43,43 @@ public class Robot extends IterativeRobot {
private Autonomous auto;
private Teleop teleop;
+ private boolean networkInitialized = false;
+ private void networkInit() {
+ Autonomous.networkInit();
+ }
+
/**
* This function is run when the robot is first started up and should be
* used for any initialization code.
*/
public void robotInit() {
- Autonomous.robotInit();
}
public void autonomousInit() {
try {
+ if (!networkInitialized) {
+ networkInit();
+ networkInitialized = true;
+ }
auto = new Autonomous(robot);
- } catch (Exception e) {}
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
}
public void autonomousPeriodic() {
try {
robot.run(auto.run(control));
- } catch (Exception e) {}
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
}
public void teleopInit() {
try {
+ if (!networkInitialized) {
+ networkInit();
+ networkInitialized = true;
+ }
teleop = new Teleop(robot);
} catch (Exception e) {}
}
@@ -71,18 +87,36 @@ public class Robot extends IterativeRobot {
public void teleopPeriodic() {
try {
robot.run(teleop.run(control, oi));
- } catch (Exception e) {}
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
}
public void disabledInit() {
+ try {
+ if (!networkInitialized) {
+ networkInit();
+ networkInitialized = true;
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
}
public void disabledPeriodic() {
}
- /**
- * This function is called periodically during test mode
- */
+ public void testInit() {
+ try {
+ if (!networkInitialized) {
+ networkInit();
+ networkInitialized = true;
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
public void testPeriodic() {
}
}