I have seen many auton selectors in libraries such as EZ Template and JAR Template, but I wondered how they work in a match.
For JAR Template, does the brain screen turn on when the controller is connected to the comp switch, allowing people to select their desired autons?
And does the pre-auton function run immediately before autonomous or when the controller is connected to the comp switch?
3 Likes
I believe if you plug in the competition switch and run it, the auton selector should work fine, as that competition switch should not interfere with brain presses. If it doesn’t work, just try running the code before plugging in the competition switch nd selecting the auton, and then plug it in.
2 Likes
I don’t use EZ template or JAR template, but I made my own before last year and it worked during, and outside of, competitions. This is the way I structured it:
I made a task (thread) in the initialize function to run the auton selection function, so the driver could choose which one without execution blocking until they select one.
I then terminated the thread at the beginning of the autonomous function to make sure it had finished. The driver should have had enough time, but if they didn’t there was a default assigned.
The thread could be made (or not and just have the function block) in competition_initialize if you only want it to run during matches, but that removes the ability to test a certain auton during practices, requiring you to setting it as the default and recompile the code to the brain.