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 (or two: MotorPositions.alsoMotor(java.lang.String)), 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
 }
 

Usual buttons (lines to write in Controls.java) (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/reference/robot-java.md (section "Lift")

  • Method Details

    • slide

      public static Lift slide(String motor)
      A lift on this motor. Its encoder gives the height. A second motor on the same slide: Lift.slide("lift_left").alsoMotorReversed("lift_right") (see MotorPositions.alsoMotor(java.lang.String)).
      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