-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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
Competition Mode #875
Comments
Taking advantage of the fact that the robot controller app doesn't actually compile, run and stop programs each time they are run, instead just compiling them into one big robot controller app (meaning that static variables persist ) (https://www.reddit.com/r/FTC/comments/5yfnhj/help_passing_data_between_opmodes/?rdt=39096), I wrote this:
(Please note that I over-engineered the printing of NUMBERS.) This OpMode has a static HashMap that may be accessed from other classes (for enabling/disabling features). The keys of the HashMap are toString()s of saved gamepad states. The values of the HashMap are Longs constructed with little-endian binary, one bit at a time. (You can expand on this further, maybe corresponding numbers 0-9 with buttons on the gamepad.) If you just want to enable/disable features on the fly, just use a static boolean. Also, I've never tested this so this may or may not work (it does compile though). |
Our team uses Kotlin so we can just use a "object" (singleton) to do the same thing, however I feel like this should be base functionality. Also, you are unable to view the camera if you are running your op mode, which is built into the driver station and cannot be changed at runtime. |
Sorry, I don't understand. (I'm new to FTC but not Java) What do you mean by view the camera? |
On the driver station, when a camera is connected/you use opencv you can open a camera feed from the robot. |
Apparently phone driver stations let you view the camera even during runtime. I can't find any way to do this on a regular DS. |
If you want view the camera while the program is running, you can just make it run during initialization:
to
|
Ok, I actually tested and fixed TweakableNumbers (if you still want to use it):
Example use:
|
A Competition Mode of some kind could also be a clear signal to disable certain testing features that are illegal in competition. For example, FTC Dashboard's remote access features must currently be disabled manually (which teams often forget to do). This could automate that disabling. |
Currently there is no way to enable/disable features during runtime to make a program competition legal. This makes development a pain when working with vision based algorithms (Cannot view camera stream if op mode is running) or developing external software (such as ftc dashboard). Adding a toggle that could be viewed in the sdk would fix this. A simple toggle in the driver station app would suffice or you could make a more advanced one (I. E. Time Locked/Password Locked).
The text was updated successfully, but these errors were encountered: