Skip to content

Conversation

kcooney
Copy link
Contributor

@kcooney kcooney commented Jul 14, 2025

This change updates the templates that included code that canceled autonomous commands in TeleopInit() to instead cancel them in AutonomousExit().

While in a real competition teleop mode starts after autonomous mode ends, when using the simulator the user can change modes in any order. Commands scheduled in AutonomousInit() should therefore be canceled in AutonomousExit().

@kcooney kcooney requested review from a team as code owners July 14, 2025 06:46
@sciencewhiz
Copy link
Contributor

I think canceling should work in autonomousExit, but you wouldn't want to do more like start a new command (that doesn't run when disabled) in autonomousExit, since the robot is disabled at that point.

@auscompgeek
Copy link
Member

I agree, I think all the templates should still override teleopInit (to do nothing).

@kcooney
Copy link
Contributor Author

kcooney commented Jul 24, 2025

I agree, I think all the templates should still override teleopInit (to do nothing).

I added back teleopInit() and TeleopInit() (with empty method bodies) to the places where I removed it.

@kcooney
Copy link
Contributor Author

kcooney commented Jul 24, 2025

I think canceling should work in autonomousExit, but you wouldn't want to do more like start a new command (that doesn't run when disabled) in autonomousExit, since the robot is disabled at that point.

With my changes, the only things the templates do on autonomousExit() or AutonomousExit() is cancel the auto command (if any).

@kcooney
Copy link
Contributor Author

kcooney commented Sep 1, 2025

@PeterJohnson I'm not sure how do I get one of the WPILib maintainers to look at this. Could you help?

@KangarooKoala
Copy link
Contributor

If someone's reviewed already, you can usually just re-request their review in GitHub. If that hasn't happened yet (like this this case), usually it comes down to either asking here on GitHub or in the programming channels of the unofficial FRC Discord server.

I will note that things have been fairly busy for the last few months with preparations for the 2027 SystemCore changes, and stuff like updating templates can fall through the cracks of reviewing a bit more easily. However, people seem to still be fairly good at reviewing once reminded.

(For what it's worth as someone who's not an actual WPILib maintainer, the changes seem fine to me. You may want to rebase, though, since it's been so long.)

This change updates the templates that included code that canceled
autonomous commands in TeleopInit() to instead cancel them in
AutonomousExit().

While in a real competition teleop mode starts after autonomous mode
ends, when using the simulator the user can change modes in any order.
Commands scheduled in AutonomousInit() should therefore be canceled in
AutonomousExit().
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants