Where would i add a hail mary hang (Code to use our hanger at the last second) in the Command Based Robot Template? Would i use it at a command level or inside of teleop periodic?
Well I’m not sure what you mean by that, but if you’d like to do some action at the last second of the match, I would suggest starting a Notifier function to run a second before the end of the match.
To clarify, what file would i check the match time constantly and then use the notifier when the match is ending?
You wouldn’t need to check the time constantly, you can simply set a Notifier up at the start of Operator period (outside of the OperatorControl loop, of course), and have it timeout after 2:15 minutes (not sure if that’s how long operator period is).
Check out the Notifer class and its usage, I’m sure you will understand.
Thank you so much! We have used notifiers before and it didn’t occur to me to use them for this. Good luck at your competitions!
Sticking with the command based approach. We created a command with a timeout of how long you want to wait from when the match starts. You schedule the command on teleop init. The IsFinished function returns IsTimedOut. Init and Execute are empty. Put the code to start the hail mary climb in the End function.
It’s simple and it works.
I’m curious as to why you would have this be based on time, instead of as a button? Presumably activating your climbing mechanism at the very end is useless unless you happen to be in the right position…
I believe it is a measure that a lot of teams are using that will allow them to hang at the buzzer without needing to remember the button like if they were shooting last second from the pyramid it would automatically lift them.
Yes, but to be effective the robot must know, or be able to obtain, its on-field position and orientation and use that to navigate to an open location on its pyramid and do the hang.
The “do the hang” is the simple part.
Not if the shooting position and the hanging position are the same. That way they can concentate on getting the shots off without watching the clock.
Then you’re assuming the position and orientation to be that of your shooting position. If it will not do you any harm to execute your last ditch move if this is incorrect, then I can see this as a valid strategy.
To clarify, our hanging mechanism is powered by two pneumatic valves and 2 gas shocks. The hail mary was put in place just for the slim chance that the drivers are going to the pyramid at the end of a match and just barely make it and can’t press the button to hang. The system eliminates that one disappointing match where we can’t hang.