Skip to content
Work in progress. This library and its docs are new and still changing, and some parts are not yet tested on a real robot. Something wrong or unclear?Tell us with a short GitHub form.

SHOT-04: Speed trim on the D-pad, and last match's trim

high prioritySimulator or real robotabout 20 minShooter and shot tables

Why

Some days every shot is a bit short. The operator trims all speeds by 1% per D-pad press. The trim must stop at 15%, never ask for more than the motor can do, start at 0 every INIT, and only OFFER last time's trim (never put it back by itself).

Safety

  • Safety glasses if you fire pieces. You can do this test without firing (watch the numbers).

Setup

  • A launcher with speed from the distance (.speedFromDistance(camera) or .speedFromOdometry()) and a shot table.
  • Two drivers: the trim is on gamepad 2 (one driver: gamepad 1).

Steps

  1. INIT, START. Spin up (LB). Read the launcher's first line: Speed trim: 0%.
  2. Press gamepad 2's D-pad up 3 times (each press counts when you let go): Speed trim: +3%. The target speed goes up about 3%.
  3. Hold D-pad up: one more step every 0.25 s. Keep holding: it stops at +15% (or says (motor limit) first).
  4. Double-tap D-pad down: back to 0%.
  5. Trim to +3%. STOP. INIT again: the trim is 0% and the Driver Station says Trim last time: +3% (double-tap D-pad up after START to use it).
  6. START, double-tap D-pad up: the trim is +3%.

Pass rule

Each press changes the target by 1% of the table's speed (within 10 RPM), the trim never passes 15% or the motor's top speed, and after INIT the trim is 0 until you double-tap D-pad up (1 of 1).

Record

Write these down while you test. The report form has them as a list to fill in.

  • the target speed at 0% and at +3% (RPM)
  • where it stopped in step 3 (+15% or motor limit, and the RPM)
  • the INIT line in step 5
  • one driver or two

If your robot is different

With a fixed speed (no table) the D-pad changes speedRpm by stepRpm instead of trimming: report that it did so, if that is your robot. If you put the trim on other buttons in your own code, say how.

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 result

No reports for this test yet: yours would be the first. Every test's reports.

All tests · Next: SET-02 A part that is not on the robot yet - optional() and the COMPETITION warning

Something wrong on this page? Tell us with a short GitHub form.