-
Notifications
You must be signed in to change notification settings - Fork 4
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
Autonomous #22
Autonomous #22
Conversation
This introduces some semi-sketchy callback logic to InternalSubsystem to implement a "WaitUntilShotFired" command. Perhaps we should think of a better way to do this.
} | ||
|
||
@Override | ||
public boolean isFinished() { | ||
boolean doneShooting = shotRequested && !internals.shotRequested(); | ||
this.finished = finished || doneShooting; // in case someone ever queues a new shot before successive isFinished calls (???) |
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 it's realistic for a driver to request a new shot in the 20ms periodic window between the first tick after the old shot is fired and the tick immediately following it. Also, drivers won't be able to request shots in autonomous (which is when this command would be used) and there's no way for two calls to this command in a SequentialCommandGroup to trigger this because the first command's isFinished()
needs to return true before the second command's initialize()
runs.
For isFinished()
, we may not have to store shotRequested
either; if initialize()
always runs before the first call to isFinished()
, isFinished()
can be implemented like
@Override
public boolean isFinished() {
return !internals.shotRequested();
}
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.
ok, does it hurt?
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 guess not? But it's an impossible scenario anyways and it adds another field variable
We'll need to think about how team color plays into the auton sequences. Do we just write 6 command groups or should we try to dynamically set which balls we're pathfinding to in the code? Will start positions change? |
I think it makes sense to have 6 command groups, because we'll be starting in different positions. It seems easiest to me to return a different commandgroup based on some state variable that can be adjusted from shuffleboard |
Tasks to do before merge:
ENCODER_ROTATIONS_TO_METERS
) Monterey Bay Regional #27kS
,kV
,kA
) Monterey Bay Regional #27