Skip to content

Code crashes if selected auto DNE o(*°▽°*)o - #297

Closed
Wu-Fan-529 wants to merge 1 commit into
mainfrom
code-crashes-if-selected-auto-dne
Closed

Code crashes if selected auto DNE o(*°▽°*)o#297
Wu-Fan-529 wants to merge 1 commit into
mainfrom
code-crashes-if-selected-auto-dne

Conversation

@Wu-Fan-529

Copy link
Copy Markdown
Member

No description provided.

Copilot AI review requested due to automatic review settings April 24, 2026 01:03
@Wu-Fan-529
Wu-Fan-529 requested a review from a team as a code owner April 24, 2026 01:03

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR hardens autonomous selection to prevent failures when the dashboard-selected auto routine no longer exists, by falling back to a “do nothing” command.

Changes:

  • Promotes the “Do Nothing” command to a RobotContainer field so it can be reused as a consistent fallback/default.
  • Updates getAutonomousCommand() to return “Do Nothing” when autoChooser.getSelected() is null.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

public String pathString = "";
public Pose2d pathStartPose = new Pose2d();
public Pose2d pathEndPose = new Pose2d();
Command DoNothing = Commands.none();

public Command getAutonomousCommand() {
return autoChooser.getSelected();
return autoChooser.getSelected() == null ? DoNothing : autoChooser.getSelected();
@TaylerUva TaylerUva closed this Apr 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants