CTL-02: Move or free the library's buttons
- Your robot needs: any robot.
- Starter bots that fit: goBILDA starter bot, REV DUO starter bot, AndyMark Robits starter bot, Studica starter bot.
- Library version: v0.17.0 or newer.
- The docs it tests: The button menu: every way a button can work, Lesson 3: Buttons (Controls.java).
Why
Every library button (slow, field-centric, pause, menus) can move to another button or be freed for your own job. INIT must catch two jobs on one button and say which button.
Safety
- Real robot: low power. Check that SOME button still pauses the robot before you drive.
Setup
- Your
Controls.java. Inside its class, just after the closing}of thebuttons(...)method, add@Override protected void libraryButtons(LibraryButtons lib, Pad g1, Pad g2) { }(the whole method is in the buttons guide), andimport com.crossbotics.ftchelper.teleop.LibraryButtons;at the top of the file.
Steps
- Move one library job your drivers want elsewhere, for example
lib.slow(g1.rt);orlib.fieldCentric(g1.x);. - INIT: read the button map. The job is on its new button; the old one is listed as free.
- START and check the job works on the new button and the old one does nothing.
- Put one of your own jobs on the same button as a library job. INIT must stop and name the button.
- Free the pause:
lib.pause(null);. INIT must warn that nothing pauses the robot. Put it back.
Pass rule
The moved job works on its new button (1 of 1), step 4 stops INIT with the button's name, and step 5 shows the warning.
Record
Write these down while you test. The report form has them as a list to fill in.
- the lines you wrote in
libraryButtons - the INIT messages from steps 4 and 5 (copy them)
- whether the button map was easy to read
If your robot is different
Move whatever your drivers really want moved: that is the best test. One driver (oneDriver = true): library jobs you put on g2 go on gamepad 1: check that.
Report your result
Pass, fail, or could not run: every result helps. The form opens on GitHub with this test filled in (a free GitHub account is needed). No student names, please.
Report resultNo reports for this test yet: yours would be the first. Every test's reports.
All tests · Next: MEC-02 A servo's full range - 300 degrees instead of 270
Something wrong on this page? Tell us with a short GitHub form.