diff --git a/examples/stage1/stage1a/solutions/ctre/src/main/java/first/robot/opmode/MyAuto.java b/examples/stage1/stage1a/solutions/ctre/src/main/java/first/robot/opmode/MyAuto.java index cc4573dc..f7ab0464 100644 --- a/examples/stage1/stage1a/solutions/ctre/src/main/java/first/robot/opmode/MyAuto.java +++ b/examples/stage1/stage1a/solutions/ctre/src/main/java/first/robot/opmode/MyAuto.java @@ -22,6 +22,7 @@ public MyAuto(Robot robot) { @Override public void start() { + /* Called once when the robot is enabled. */ autoTimer.restart(); // Reset the timer to zero at the start of auto } diff --git a/examples/stage1/stage1a/solutions/rev/src/main/java/first/robot/opmode/MyAuto.java b/examples/stage1/stage1a/solutions/rev/src/main/java/first/robot/opmode/MyAuto.java index fb0ec75f..b6bb4928 100644 --- a/examples/stage1/stage1a/solutions/rev/src/main/java/first/robot/opmode/MyAuto.java +++ b/examples/stage1/stage1a/solutions/rev/src/main/java/first/robot/opmode/MyAuto.java @@ -22,7 +22,8 @@ public MyAuto(Robot robot) { @Override public void start() { - autoTimer.restart(); + /* Called once when the robot is enabled. */ + autoTimer.restart(); // Reset the timer to zero at the start of auto } // [SimpleAutoStart] @@ -34,7 +35,7 @@ public void start() { */ @Override public void periodic() { - if (autoTimer.hasElapsed(4)) { + if (autoTimer.hasElapsed(4)) { // Drive for 4 seconds after the start of auto robot.drivetrain.arcadeDrive(0.0, 0.0); // Stop the robot after 4 seconds // [/SimpleAutoStart] // [SimpleAutoEnd] diff --git a/examples/stage1/stage1a/solutions/rev/src/main/java/first/robot/opmode/MyTeleop.java b/examples/stage1/stage1a/solutions/rev/src/main/java/first/robot/opmode/MyTeleop.java index 5ae1e5e3..b942e9b1 100644 --- a/examples/stage1/stage1a/solutions/rev/src/main/java/first/robot/opmode/MyTeleop.java +++ b/examples/stage1/stage1a/solutions/rev/src/main/java/first/robot/opmode/MyTeleop.java @@ -27,6 +27,7 @@ public MyTeleop(Robot robot) { /* Called periodically (set time interval) while the robot is enabled. */ @Override public void periodic() { + /* Called periodically (set time interval) while the robot is enabled. */ robot.drivetrain.arcadeDrive(-xboxController.getLeftY(), xboxController.getRightX()); // [/DriveSimPeriodic] // [/FullDrivetrain] diff --git a/examples/stage1/templates/ctre/src/main/java/first/robot/opmode/MyAuto.java b/examples/stage1/templates/ctre/src/main/java/first/robot/opmode/MyAuto.java index e73f0c2b..6d12a124 100644 --- a/examples/stage1/templates/ctre/src/main/java/first/robot/opmode/MyAuto.java +++ b/examples/stage1/templates/ctre/src/main/java/first/robot/opmode/MyAuto.java @@ -19,7 +19,9 @@ public MyAuto(Robot robot) { } @Override - public void start() {} + public void start() { + /* Called once when the robot is enabled. */ + } /* * This method runs periodically, using the same period as the Robot instance. diff --git a/examples/stage1/templates/rev/src/main/java/first/robot/Robot.java b/examples/stage1/templates/rev/src/main/java/first/robot/Robot.java index e52755b1..d014eeb9 100644 --- a/examples/stage1/templates/rev/src/main/java/first/robot/Robot.java +++ b/examples/stage1/templates/rev/src/main/java/first/robot/Robot.java @@ -7,8 +7,19 @@ import org.wpilib.framework.OpModeRobot; +/** + * The methods in this class are called automatically as described in the OpModeRobot documentation. + * OpMode classes anywhere in the package (or sub-packages) where this class is located are + * automatically registered to display in the Driver Station. If you change the name of this class + * or the package after creating this project, you must also update the Main.java file in the + * project. + */ public class Robot extends OpModeRobot { + /** + * This function is run when the robot is first started up and should be used for any + * initialization code. + */ public Robot() {} @Override diff --git a/examples/stage1/templates/rev/src/main/java/first/robot/opmode/MyAuto.java b/examples/stage1/templates/rev/src/main/java/first/robot/opmode/MyAuto.java index 5bd87918..6d12a124 100644 --- a/examples/stage1/templates/rev/src/main/java/first/robot/opmode/MyAuto.java +++ b/examples/stage1/templates/rev/src/main/java/first/robot/opmode/MyAuto.java @@ -13,13 +13,22 @@ public class MyAuto extends PeriodicOpMode { private final Robot robot; + /** The Robot instance is passed into the opmode via the constructor. */ public MyAuto(Robot robot) { this.robot = robot; } @Override - public void start() {} + public void start() { + /* Called once when the robot is enabled. */ + } + /* + * This method runs periodically, using the same period as the Robot instance. + * + * Additional periodic methods may be configured with addPeriodic(), + * which can have periods that differ from the main Robot instance. + */ @Override public void periodic() {} } diff --git a/examples/stage1/templates/rev/src/main/java/first/robot/opmode/MyTeleop.java b/examples/stage1/templates/rev/src/main/java/first/robot/opmode/MyTeleop.java index 312336ae..e2dcd616 100644 --- a/examples/stage1/templates/rev/src/main/java/first/robot/opmode/MyTeleop.java +++ b/examples/stage1/templates/rev/src/main/java/first/robot/opmode/MyTeleop.java @@ -13,10 +13,13 @@ public class MyTeleop extends PeriodicOpMode { private final Robot robot; + /** The Robot instance is passed into the opmode via the constructor. */ public MyTeleop(Robot robot) { this.robot = robot; } @Override - public void periodic() {} + public void periodic() { + /* Called periodically (set time interval) while the robot is enabled. */ + } }