Class Arm

All Implemented Interfaces:
Subsystem

public final class Arm extends MotorPositions<Arm>
An arm that swings on one motor, with named angles in degrees.

 arm = add(Arm.motor("arm", "gobilda-5203-117").gearRatio(2));   // Robot.java: 2 motor turns per arm turn

 public static class Arm {                                         // Tunables.java (degrees)
     public static double min = 0, max = 180;                     // the safe range
     public static double kP = 0.02, kI = 0, kD = 0.001, kF = 0.0;
     public static double stowed = 0, score = 110;                // named angles
 }
 

0 degrees is where the arm is when the program starts (the encoder counts from there). Start every match with the arm resting on the same stop, and measure the angles from it (so min is usually 0). Suggested button: operator right stick Y moves it by hand. Docs: docs/modules/robot.md (section "Arm")

  • Method Details

    • motor

      public static Arm motor(String motor, String motorId)
      An arm on this motor.
      Parameters:
      motor - the motor's configuration name
      motorId - the motor's parts-catalog id (see Motors), e.g. "gobilda-5203-117"
    • gearRatio

      public Arm gearRatio(double motorTurnsPerArmTurn)
      Motor turns per arm turn (gears, sprockets or a belt). Default 1.
    • bottomSwitch

      public Arm bottomSwitch(String switchName)
      A touch sensor at the min end: pressing it sets the angle to 0.