Skip to content

Commit 1e43818

Browse files
Cancel autonomous command at the end of auto instead of the beginning of teleop
1 parent 3416498 commit 1e43818

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

src/main/java/frc/robot/Robot.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
*/
3636
public class Robot extends LoggedRobot {
3737
private Command autonomousCommand;
38-
private RobotContainer robotContainer;
38+
private final RobotContainer robotContainer;
3939

4040
public Robot() {
4141
// Record metadata
@@ -142,9 +142,9 @@ public void autonomousInit() {
142142
@Override
143143
public void autonomousPeriodic() {}
144144

145-
/** This function is called once when teleop is enabled. */
145+
/** This function is called after autonomous exits. */
146146
@Override
147-
public void teleopInit() {
147+
public void autonomousExit() {
148148
// This makes sure that the autonomous stops running when
149149
// teleop starts running. If you want the autonomous to
150150
// continue until interrupted by another command, remove
@@ -154,6 +154,10 @@ public void teleopInit() {
154154
}
155155
}
156156

157+
/** This function is called once when teleop is enabled. */
158+
@Override
159+
public void teleopInit() {}
160+
157161
/** This function is called periodically during operator control. */
158162
@Override
159163
public void teleopPeriodic() {}

0 commit comments

Comments
 (0)