Skip to content

Commit

Permalink
[#422] fix diffs with main
Browse files Browse the repository at this point in the history
  • Loading branch information
Vilok1 committed Mar 21, 2024
1 parent f73965e commit 3c7ec97
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 3 deletions.
4 changes: 1 addition & 3 deletions src/main/java/frc/robot/RobotContainer.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@
import frc.robot.Constants.TunerConstants;
import frc.robot.Constants.VisionConstants;
import frc.robot.command.ChasePieces;
import frc.robot.command.ClimbAlign;
import frc.robot.command.Collect;
import frc.robot.command.CollectAndGo;
import frc.robot.command.CollisionDetection;
import frc.robot.command.HasPieceAuto;
import frc.robot.command.Index;
import frc.robot.command.ManualClimb;
import frc.robot.command.MoveToPose;
import frc.robot.command.PathFindToAuton;
import frc.robot.command.PathToPose;
Expand Down Expand Up @@ -228,8 +228,6 @@ protected void configureButtonBindings() {

new Trigger(() -> driver.getPOV() == 0).toggleOnTrue(leds.enableState(LED_STATES.DISABLED));

new Trigger(driver::getBButton).whileTrue(new ClimbAlign(drivetrain));

/* copilot */
new Trigger(coPilot::getBButton)
.whileTrue(new InstantCommand(() -> flywheel.stop(), flywheel)
Expand Down
42 changes: 42 additions & 0 deletions src/main/java/frc/robot/command/ManualClimb.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
package frc.robot.command;

import java.util.function.DoubleSupplier;

import edu.wpi.first.wpilibj2.command.Command;
import frc.robot.subsystems.Climber;

public class ManualClimb extends Command {

private Climber climber;
private DoubleSupplier leftPower;
private DoubleSupplier rightPower;

/**
* Creates a new ManualClimb.
* @param leftPower supplier for left motor power
* @param rightPower supplier for right motor power
* @param climber subsystem
*/
public ManualClimb(DoubleSupplier leftPower, DoubleSupplier rightPower, Climber climber) {
this.climber = climber;
this.leftPower = leftPower;
this.rightPower = rightPower;

addRequirements(climber);
}

@Override
public void execute() {
climber.setPower(leftPower.getAsDouble(), rightPower.getAsDouble());
}

@Override
public void end(boolean interrupted) {
climber.stop();
}

@Override
public boolean isFinished() {
return false;
}
}

0 comments on commit 3c7ec97

Please sign in to comment.