-
Notifications
You must be signed in to change notification settings - Fork 0
RM_Loggable_Autochooser #28
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
Conversation
…oggableAutochooser
…n edited copy of it.
…lected command for the drive team.
| @@ -0,0 +1,81 @@ | |||
| package frc.robot.autochooser; | |||
There was a problem hiding this comment.
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".
There was a problem hiding this comment.
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(); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.)
…oved more important parts of the elastic dashboard outside 'if debug'.
batchen1
left a comment
There was a problem hiding this 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?
|
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. |
… be used in a map the way it's expected to.
|
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. |
batchen1
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome!
No description provided.