Skip to content

Commit

Permalink
Added temp elevator lift
Browse files Browse the repository at this point in the history
  • Loading branch information
Imeanbusiness committed Feb 23, 2024
1 parent 7245ade commit 05cc46c
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/main/java/frc/robot/RobotContainer.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import frc.robot.auto.commands.SpeakerAlign;
import frc.robot.constants.OperatorConstants;
import frc.robot.elevator.Elevator;
import frc.robot.elevator.commands.ElevatorTempUp;
import frc.robot.intake.Intake;
import frc.robot.intake.commands.IntakePickup;
import frc.robot.intake.commands.IntakeShooterFeed;
Expand Down Expand Up @@ -47,6 +48,8 @@ public class RobotContainer {
private final Command intakeShooterFeed = new IntakeShooterFeed(intake);
private final Command intakePickup = new IntakePickup(intake);
private final Command eject = new IntakeAmpScore(intake);
private final Command elevatorTempUp = new ElevatorTempUp(elevator);


SendableChooser<Command> autoSelector = new SendableChooser<>();

Expand Down Expand Up @@ -107,8 +110,9 @@ private void configureSwerveDriveCommands() {
controller.getRightTrigger().onTrue(ampSuperShoot);
controller.getY().whileTrue(shooterSuperAlign);
controller.getLeftTrigger().onTrue(shooterSuperShoot);
controller.getRightBumper().whileTrue(intakePickup);
controller.getRightBumper().onTrue(intakePickup);
controller.getA().whileTrue(ampSuperAlign);
controller.getB().whileTrue(elevatorTempUp);


}
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/frc/robot/constants/ElevatorConstants.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,6 @@ public class ElevatorConstants {
public static final double MAX_HEIGHT = 28.0;
public static final double TARGET_HEIGHT = 28.0;
public static final double TOLERANCE = 0.1;

public static final double TEMP_MAX_HEIGHT = 5.0;
}
40 changes: 40 additions & 0 deletions src/main/java/frc/robot/elevator/commands/ElevatorTempUp.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
// Copyright (c) FIRST and other WPILib contributors.
// Open Source Software; you can modify and/or share it under the terms of
// the WPILib BSD license file in the root directory of this project.

package frc.robot.elevator.commands;

import edu.wpi.first.wpilibj2.command.Command;
import frc.robot.constants.ElevatorConstants;
import frc.robot.elevator.Elevator;

public class ElevatorTempUp extends Command {
private final Elevator elevator;
public ElevatorTempUp(Elevator elevator) {
this.elevator = elevator;
addRequirements(elevator);

}

// Called when the command is initially scheduled.
@Override
public void initialize() {
elevator.setHeight(ElevatorConstants.TEMP_MAX_HEIGHT);
}

// Called every time the scheduler runs while the command is scheduled.
@Override
public void execute() {}

// Called once the command ends or is interrupted.
@Override
public void end(boolean interrupted) {
elevator.setHeight(0);
}

// Returns true when the command should end.
@Override
public boolean isFinished() {
return false;
}
}

0 comments on commit 05cc46c

Please sign in to comment.