AIM-01: Turret follows the goal with the camera
- Your robot needs: Turret, and Limelight 3A or Webcam.
- Starter bots that fit: none (it needs parts the starter bots do not have).
- Library version: v0.16.0 or newer.
- The docs it tests: Lesson 9: A shooter, a camera and a turret (for robots that shoot), Lesson 9: A shooter, a camera and a turret (for robots that shoot).
Why
A turret that follows the goal takes the aiming off the drivers. It must turn the short way, never go past its limits, and say clearly when the goal is out of range. Every turret is built differently (gear ratio, range, where the camera is), so we need other turrets.
Safety
- Hard stops on the turret just past
minandmax. Check them by hand first. - Cables slack over the whole range. The flywheel off (do not fire in this test).
- Safety glasses if the launcher has pieces in it.
Setup
Turret.motor(...).gearRatio(...).follows(camera)inRobot.java,Tunables.Turretwithmin,max.- A goal tag (AprilTag) you can see: the field, or a printed tag at the right height.
- The turret at its
startAnglebefore INIT (by default 0 = straight forward; a mark or a jig helps), unless it has a home switch (TUR-01) or an absolute encoder. TeleOp started within 5 minutes of another program starts from the angle that program ended at. - Simulator: lesson 9's turret robot (
turretbot) commands, then "TurretBot TeleOp".
Steps
- INIT your TeleOp, START. Drive (or turn the robot) until the camera sees the goal.
- Watch the turret turn to the goal. Read the turret line on the Driver Station.
- Turn the robot slowly 90 degrees one way, then the other. The turret keeps on the goal.
- Turn the robot until the goal is past a turret limit: the turret waits at the limit, and the Driver Station says "goal out of turret range".
- Gamepad 2 right stick X: the turret turns by hand. Let go: following goes on.
- Gamepad 2 BACK: following off. BACK again: on.
Pass rule
In steps 2 and 3 the turret stays within its tolerance (1.5 degrees by default) of the goal while the robot turns slowly, it never goes past min or max (0 times), and step 4 shows the message.
Record
Write these down while you test. The report form has them as a list to fill in.
- camera (Limelight or webcam), on the turret or on the body
- gear ratio,
min,max,kPyou used - how far off it settled (degrees, from the Driver Station or by eye)
- any shaking or overshoot, and when
If your robot is different
A camera on the robot's body needs .cameraOnBody(): say if you used it. A turret with a different range (say 0 to 270), a servo turret (TUR-03) or a slip ring (TUR-04) is very useful. If the turret turns away from the goal, .reversed() fixes it: say whether the docs made that clear.
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: AIM-02 Odometry backup aim when the camera is covered
Something wrong on this page? Tell us with a short GitHub form.