-
Notifications
You must be signed in to change notification settings - Fork 0
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
Adds stateful command for Automated Teleop #194
base: main
Are you sure you want to change the base?
Conversation
The Mermaid diagram for the state machine is complete. It can be found under |
@linglejack06 I've noticed that the method to follow a path in the drivetrain disables alignment. Is this strictly necessary, or could we keep alignment enabled and drive to the path anyway? I'd prefer to prime and align as soon as the robot starts driving back from the source, but if it can't auto align, it would have to stop and wait before it could shoot upon arrival. |
@aidnem by using the path following it defaults to their alignment, but Im pretty sure there is something in the path configuration where i can override rotation ( we could then keep the align state on ). Ill look into it tonight or tomorrow morning and add it to this PR it shouldnt take long |
@aidnem I have just added the rotation target override which should work. We can test on Wednesday. |
Can you test in the sim 👀 |
I'll be out of the house all day but I can probably try it out tonight or tomorrow afternoon. Depending on whether or not they allow me into shop on Monday we could test it in real life then as well. |
I can try in sim if I have time. I also just remembered I forgot to remove the align state disabled in drive to path method so I will update that next time I get on my computer |
Coaches have informed me that I am not welcome in shop and therefore testing will have to wait until next Monday (no school Wednesday) when they allow everybody back in. I'll test sim when I get the chance. |
just pusehd the update with removal of the align state manual. If we keep structure how it is now, then best choice would be to set align state and target in the auto teleop command. If we add a state machine to drive class to handle automated driving, then i could add the align state and target in that state machine. @jkleiber do you have a preference? I know you had mentioned adding the automated state machine to the drivetrain class |
@linglejack06 if possible, using the Action + State framework we've been using is preferred. But if there's no reason to do Actions (i.e. any state can transition to any other state) then you can just make a mode machine where you set the drive mode in the command. For example, you could have modes for: auto align, path follow, manual, etc |
@jkleiber Here's the first test of running it in the sim. Sorry for the terrible quality, GitHub won't let me upload a video over 10MB so I had to shrink and trim it severely. automated.teleop.1st.sim.test.cropped.movThis shows that the state machine is at least somewhat functional (it drives where it is trying to and then transitions to 'ACQUIRE_NOTE'). Once I figure out how to use note simulation, I'll test a full cycle. |
@aidnem that video looks good - if you or @linglejack06 want to take a crack at #170 it would obviously be nice to not have this crusty driving behavior in the sim |
Oh you're right, I thought they were the same PR. |
Purpose
This PR adds a new command to control teleop autonomously.
Closes #182.
Features
A state machine with the following states:
START
DRIVE_TO_SPEAKER
.DRIVE_TO_SOURCE
.DRIVE_TO_SOURCE
ACQUIRE_NOTE
to go intake the note.ACQUIRE_NOTE
DRIVE_TO_SPEAKER
DRIVE_TO_SPEAKER
SHOOT_NOTE
. This currently only checks range to the speaker in deciding whether or not to switch to the score note state.SHOOT_NOTE
DRIVE_TO_SOURCE
.The state machine can be seen in the diagram below:
Outstanding Work
DRIVE_TO_SOURCE
to detect when a note is near and switch toACQUIRE_NOTE
.ACQUIRE_NOTE
to use note vision and/or retry logic to be able to actually intake notes by itself.