Package com.crossbotics.ftchelper.robot
Class Lift
- All Implemented Interfaces:
Subsystem
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 Summary
Methods inherited from class com.crossbotics.ftchelper.robot.MotorPositions
addTelemetry, alsoMotor, alsoMotorReversed, goTo, hold, isAt, isAtTarget, manual, part, position, positions, reversed, secondMotorName, stepDown, stepUp, stop, update
-
Method Details
-
slide
A lift on this motor. Its encoder gives the height. A second motor on the same slide:Lift.slide("lift_left").alsoMotorReversed("lift_right")(seeMotorPositions.alsoMotor(java.lang.String)).- Parameters:
motor- the motor's configuration name
-
bottomSwitch
A touch sensor at the bottom of the travel.- Parameters:
switchName- its configuration name
-