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.

TUR-02: Turret with no switch - start angle and the angle carried to TeleOp

high prioritySimulator or real robotabout 30 minTurret

  • Your robot needs: Turret.
  • 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: Setting up a turret, Setting up a turret.

Why

A motor turret with no home switch only knows its angle if it starts where startAngle says. After autonomous it is somewhere else, so TeleOp starts from the angle the last program ended at (for 5 minutes). If any of this goes wrong, every shot goes wide by the same angle.

Safety

  • The turret moves by itself while it follows the goal. Fingers and wires away from it.
  • Hard stops at the wire limits.

Setup

  • A turret with no .homeSwitch(...) line, and min, max in Tunables.Turret.
  • A mark or a small jig that holds the turret at startAngle (0 = straight forward, the default).
  • An autonomous that turns the turret (it follows the goal, or a step turns it).
  • Simulator: lesson 9's turret robot (the commands): "TurretBot Shoot from Start", then "TurretBot TeleOp".

Steps

  1. Put the turret on its mark. INIT the autonomous: Turret : startAngle 0 deg: put the turret there by hand before INIT, or every angle is off.
  2. Run the autonomous to the end. Write the turret's last angle.
  3. Within 5 minutes, INIT TeleOp: Turret : ... deg, carried from the last program (... s ago ...). The angle matches step 2.
  4. START TeleOp, point the turret straight forward with the stick, and check the angle reads about 0.
  5. Stop. Restart the robot app (or wait more than 5 minutes). Turn the turret 20 degrees by hand. INIT TeleOp: it must say no angle from a program before: turn it to startAngle 0 deg by hand and INIT again.
  6. Write min = 10, max = 170 (a range without 0) and no startAngle. INIT: no stop, and a note says it counts from the middle of the range (90). Put your numbers back.

Pass rule

The carried angle in step 3 is within 2 degrees of where autonomous ended, step 4 reads within 3 degrees of the real angle, and step 5 shows the "no angle from a program before" line (1 of 1).

Record

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

  • motor, gear ratio, min, max, startAngle
  • autonomous end angle and TeleOp's carried angle
  • the real angle vs the Driver Station in step 4
  • the lines shown in steps 5 and 6

If your robot is different

With keepAngle = false in Tunables.Turret, TeleOp never carries the angle: say if you use it and why. A turret with an absolute encoder (.analogEncoder(...)) knows its angle at INIT: check that its absolute encoder: ... deg line is right instead of steps 1 and 5.

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: AIM-01 Turret follows the goal with the camera

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