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.

AIM-03: Whole-robot aim - the robot turns to the goal while you drive

high prioritySimulator or real robotabout 30 minAiming

Why

Most robots have no turret: they aim by turning. Whole-robot aim turns the robot to the goal while the driver drives, and the turn stick always wins. Drive trains turn very differently, so the numbers (turnKp, minTurnPower) need testing on many robots.

Safety

  • Clear floor, PRACTICE profile. The robot turns by itself while aim is on.
  • Hand near STOP, and the driver ready to let go of the button.

Setup

  • A camera with .goal(...), or odometry with Tunables.Aim.goalX, goalY.
  • In Controls.java: g1.rb.toggle(robot.aimMode()).says("aim the robot at the goal on/off").rumble();
  • Simulator: lesson 9's flywheelbot commands, then "FlywheelBot TeleOp".

Steps

  1. INIT your TeleOp, START. Drive until the goal is in view (or the pose is set, with odometry).
  2. Turn the robot about 45 degrees away from the goal. Press RB: the robot turns to face the goal.
  3. With aim on, drive forward and sideways (mecanum) or forward only (tank). The robot keeps facing the goal.
  4. Push the turn stick: the robot turns as the stick says. Let go: the aim takes over again.
  5. Hide the goal (cover the camera, no odometry): it must not turn by itself (Aim: no goal).
  6. Press RB again: aim off.

Pass rule

In step 2 the robot ends within toleranceDeg (2 degrees by default) of the goal within 2 seconds, and in step 5 it does not turn by itself (0 degrees).

Record

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

  • drive type, camera or odometry
  • turnKp, maxTurnPower, minTurnPower you ended with
  • how far off it stopped (degrees) and how long it took (seconds)
  • any shaking, and when

If your robot is different

A tank drive can only drive forward while it aims: that is expected. If it stops a few degrees short, try minTurnPower and say what worked. If you put aim on another button, say which. A robot with a turret that follows the goal must NOT use this (INIT stops): that message is worth reporting if it was unclear.

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: DRV-01 First drive with the five files - wheels, sticks, slow and pause

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