Class Lift

All Implemented Interfaces:
Subsystem

public final class Lift extends MotorPositions<Lift>
A lift (a slide that goes up and down) on one motor, with named heights and an optional bottom switch. Heights are in encoder counts.

 lift = add(Lift.slide("lift").bottomSwitch("lift_bottom"));   // Robot.java

 public static class Lift {                                      // Tunables.java
     public static double min = 0, max = 2600;                  // the safe range (hard stops)
     public static double kP = 0.004, kI = 0, kD = 0.0002, kF = 0.05;
     public static double down = 0, low = 900, high = 2400;     // named heights: any names you like
 }
 

Suggested buttons (operator): A = lowest height, X = the second one, Y = the highest, D-pad up/down = next height up/down, left stick Y = by hand (it holds where you let go).

A bottom switch makes the bottom always right: pressing it sets the height to 0. Until it has been pressed once, the lift only goes down, slowly. Docs: docs/modules/robot.md (section "Lift")

  • Method Details

    • slide

      public static Lift slide(String motor)
      A lift on this motor.
      Parameters:
      motor - the motor's configuration name
    • bottomSwitch

      public Lift bottomSwitch(String switchName)
      A touch sensor at the bottom of the travel.
      Parameters:
      switchName - its configuration name