Minor change to add manual, again, just a proof of concept, don't use this
This commit is contained in:
parent
771bcc89e1
commit
431c1c2f01
@ -29,6 +29,7 @@ import edu.wpi.first.wpilibj2.command.Command;
|
||||
import edu.wpi.first.wpilibj2.command.Commands;
|
||||
import edu.wpi.first.wpilibj2.command.WaitUntilCommand;
|
||||
import edu.wpi.first.wpilibj2.command.button.CommandXboxController;
|
||||
import edu.wpi.first.wpilibj2.command.button.Trigger;
|
||||
|
||||
public class RobotContainer {
|
||||
private ClimberPivot climberPivot;
|
||||
@ -185,6 +186,10 @@ public class RobotContainer {
|
||||
operator.y().onTrue(
|
||||
elevator.setTargetPosition(ElevatorPositions.kL2)
|
||||
);
|
||||
|
||||
new Trigger(() -> Math.abs(MathUtil.applyDeadband(operator.getLeftY(), .05)) > .05).onTrue(
|
||||
elevator.runManualElevator(operator::getLeftY)
|
||||
);
|
||||
|
||||
|
||||
}
|
||||
|
@ -151,7 +151,10 @@ public class Elevator extends SubsystemBase {
|
||||
* @return Sets motor voltage to translate the elevator and maintain position
|
||||
*/
|
||||
public Command runManualElevator(DoubleSupplier speed) {
|
||||
return run(() -> {
|
||||
return startRun(() -> {
|
||||
mode = ElevatorControlMode.kManualMaintain;
|
||||
},
|
||||
() -> {
|
||||
double desired = speed.getAsDouble();
|
||||
|
||||
if(Math.abs(MathUtil.applyDeadband(desired, .05)) > 0) {
|
||||
|
Loading…
Reference in New Issue
Block a user