SHOT-04: Speed trim on the D-pad, and last match's trim
- Your robot needs: Flywheel shooter, and Limelight 3A or Webcam or goBILDA Pinpoint or SparkFun OTOS or Dead wheels (2 or 3 pods).
- Starter bots that fit: none (it needs parts the starter bots do not have).
- Library version: v0.17.0 or newer.
- The docs it tests: Lesson 9: A shooter, a camera and a turret (for robots that shoot), Cookbook: "How do I...?".
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
- INIT, START. Spin up (LB). Read the launcher's first line:
Speed trim: 0%. - 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%. - Hold D-pad up: one more step every 0.25 s. Keep holding: it stops at +15% (or says
(motor limit)first). - Double-tap D-pad down: back to 0%.
- 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). - 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 resultNo 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.