Skip to content

Conversation

@The-Cool-Python-Guy
Copy link
Contributor

No description provided.

@@ -0,0 +1,81 @@
package frc.robot.autochooser;
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think you have a way to differentiate between an invalid combination of action+position and driver intentionally selecting "do nothing".

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This problem has actually been on my mind since I realized it a few minutes after leaving last Monday. I've got a solid distinction this time.


// schedule the autonomous command (example)
mode.set(RobotMode.AUTONOMOUS);
autonomousCommand = robotContainer.getAutonomousCommand();
Copy link
Contributor

Choose a reason for hiding this comment

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

we also want to get the location from the chooser and update or robot's initial position to that location.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not sure what you meant by "update or robot's initial position", but hopefully these changes reflect what you wanted.

Copy link
Contributor

Choose a reason for hiding this comment

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

What I meant is that we have code to do odometry so that we know our robot position at any point in time. When we start the match, we place the robot in a known position on the field for the autonomous (we usually have 3 options for that LEFT,MIDDLE,RIGHT) and base on the drive team selection, we need to initialize the robot odometry to where it is on the field. The position on the field is in the x,y, angle in the FieldLocation enum. no need to display it, but there's a getLocation method that returns the robot Pose2d. For now - just add a line in autonomousInit() that gets this pose, and we will pass it to the drivetrain later.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ahh, now I see. Should I keep the dashboard stuff, or is it unnecessary? (The location is part of the chooser anyway, so it seems a little redundant to keep it.)

Copy link
Contributor

@batchen1 batchen1 left a comment

Choose a reason for hiding this comment

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

I tried to run this, used "Do nothing" and "left" or "right" and the commands do not get started. I tested it with the previous version of the code and it worked.
Can you try it and let me know if I'm missing something?

@The-Cool-Python-Guy
Copy link
Contributor Author

The-Cool-Python-Guy commented Feb 10, 2026

It seems my code choked on "ApriltagSubsystem cannot be resolved", which is rather unusual. The import is correct down to the letter and the ApriltagSubsystem class exists and doesn't have errors. Is this something you've seen before? I'm very stumped here. It caused my code to short-circuit, and none of the code actually ran.

@The-Cool-Python-Guy
Copy link
Contributor Author

The test is now working in simulation. The problem is that I removed the implementation for equals() and hashCode() for AutoEvent (one of your comments mentioned removing methods from AutoEvent that were no longer necessary and I might have removed too many of them), which meant that in the map, it was looking for the same object reference rather than an "equal" object with the same hashcode.

Copy link
Contributor

@batchen1 batchen1 left a comment

Choose a reason for hiding this comment

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

Awesome!

@The-Cool-Python-Guy The-Cool-Python-Guy merged commit bfce8c5 into main Feb 10, 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.

2 participants