Profiles: practice vs competition
For: teams getting ready for practice and events. You need: a TeleOp or autonomous that runs (any lesson robot).
The same robot code should be helpful in the shop (debug numbers, gentle speeds, live tuning) and safe at an event (no tuning menu, no surprise values, nothing extra on the screen). A profile switches between the two without changing the code.
The two profiles
Section titled “The two profiles”| PRACTICE | COMPETITION | |
|---|---|---|
| Debug telemetry | starts ON | starts OFF |
| Tuning menu | can open | stays closed |
| INIT screen | warns “PRACTICE profile” | normal |
Your Profile.pick(a, b) values |
a |
b |
COMPETITION is the default, so a robot that was never set up is in the safe mode.
Choosing the profile
Section titled “Choosing the profile”It is saved on the Control Hub and stays until changed. Two ways:
- INIT menu (easiest): every autonomous (
EasyAuto,Auto) has a “Profile” line. D-pad to it, left/right to change. A TeleOp has none (it only warns when PRACTICE is on); a TeleOp you write yourself can add.profile()to anInitMenu. - Code:
Profile.set(Profile.PRACTICE).
To see which one is on, any OpMode can show Profile.current().
Using it in your code
Section titled “Using it in your code”// Numbers: Profile.pick(value in PRACTICE, value in COMPETITION)c.powerLimit = Profile.pick(0.6, 1.0); // gentle in the shop, full at eventsdouble slowest = Profile.pick(0.25, 0.35);
// Featuresboolean liveView = Profile.pick(true, false); // camera preview only in practice// or ask directly which profile is on:if (Profile.current().isPractice()) { ...extra checks, logging... }flowchart LR
P{Profile.current} -- PRACTICE --> A["practice value<br/>debug on, tuning allowed"]
P -- COMPETITION --> B["competition value<br/>debug off, tuning blocked"]
Event checklist
Section titled “Event checklist”At the event, before the first match:
- INIT any autonomous and set Profile: COMPETITION in its menu.
- Check the INIT screen has no “PRACTICE profile” warning.
- Check there is no “tuned value(s) differ from the code” warning (or that you meant it).
After the event, set PRACTICE again for the shop.
What should NOT differ between profiles
Section titled “What should NOT differ between profiles”Safety: limits, hard stops, jam handling, timeouts. Never make a profile turn off a safety feature. Profiles change comfort and convenience, not protection.