Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[choreolib] AutoChooser Fixes and Sim behavior changes #1057

Merged
merged 12 commits into from
Dec 29, 2024

Conversation

oh-yes-0-fps
Copy link
Collaborator

@oh-yes-0-fps oh-yes-0-fps commented Dec 20, 2024

Makes changing alliance while disabled re-evaluate command creator
Makes going from disconnect->auto in sim quick load the auto then run it
Prevents a crash from composition going between enabled and disconnected
Fix an issue with selected in the sendables api being set when it shouldn't
Added .instance to work with elastic

@oh-yes-0-fps oh-yes-0-fps requested a review from shueja December 20, 2024 17:41
@oh-yes-0-fps
Copy link
Collaborator Author

The .instance isn't needed for glass but it is needed for elastic so this just adds a dummy value of 0 as per the elastic source it's not used.

Going from disconnected to auto in sim will quick load the auto
@oh-yes-0-fps oh-yes-0-fps changed the title [choreolib] AutoChooser Fix: removed selected getter and added .instance for elastic [choreolib] AutoChooser Fixes and Sim behavior changes Dec 20, 2024
@@ -43,17 +44,20 @@ public class AutoChooser implements Sendable {
private final HashMap<String, Supplier<Command>> autoRoutines =
new HashMap<>(Map.of(NONE_NAME, Commands::none));

// private final StringEntry selected, active;
// private final StringArrayEntry options;
private int allianceId = -1;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why use a number here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

For easier comparison

Copy link
Contributor

@bryceroethel bryceroethel Dec 25, 2024

Choose a reason for hiding this comment

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

What is wrong with using .equals() with the return value of DriverStation.getAlliance()? As per Optional's documentation:

Indicates whether some other object is "equal to" this Optional. The other object is considered equal if:
- it is also an Optional and;
- both instances have no value present or;
- the present values are "equal to" each other via equals().

@shueja shueja merged commit a7ccbb9 into SleipnirGroup:main Dec 29, 2024
33 checks passed
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