algae barge shot is in, but needs tuning
This commit is contained in:
parent
51ef5ff2d0
commit
50f402f36f
@ -34,6 +34,7 @@ import edu.wpi.first.wpilibj.smartdashboard.SendableChooser;
|
||||
import edu.wpi.first.wpilibj2.command.Command;
|
||||
import edu.wpi.first.wpilibj2.command.Commands;
|
||||
import edu.wpi.first.wpilibj2.command.button.CommandXboxController;
|
||||
import edu.wpi.first.wpilibj2.command.button.Trigger;
|
||||
|
||||
public class RobotContainer {
|
||||
private ClimberPivot climberPivot;
|
||||
@ -226,6 +227,8 @@ public class RobotContainer {
|
||||
.until(() -> driver.a().getAsBoolean())
|
||||
);
|
||||
|
||||
operator.rightTrigger().onTrue(shootAlgae());
|
||||
|
||||
}
|
||||
private void configureNamedCommands() {
|
||||
new EventTrigger("Lift L4").onTrue(safeMoveManipulator(ElevatorConstants.kL4Position, ManipulatorPivotConstants.kL4Position));
|
||||
@ -489,6 +492,14 @@ public class RobotContainer {
|
||||
.raceWith(elevator.maintainPosition()));
|
||||
}
|
||||
|
||||
private Command shootAlgae(){
|
||||
return manipulatorPivot.goToSetpoint(() -> ManipulatorPivotConstants.kBargeShotPosition)
|
||||
.andThen(elevator.goToSetpoint(() -> ElevatorConstants.kL4Position), manipulatorPivot.goToSetpoint(() -> ManipulatorPivotConstants.kBargeShotPosition)
|
||||
.raceWith(elevator.maintainPosition())).until(() -> elevator.getEncoderPosition()>30).andThen(manipulator.runManipulator(() -> -1, false),
|
||||
elevator.goToSetpoint(() -> ElevatorConstants.kL4Position), manipulatorPivot.goToSetpoint(() -> ManipulatorPivotConstants.kBargeShotPosition)
|
||||
.raceWith(elevator.maintainPosition()));
|
||||
}
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
private Command startingConfig() {
|
||||
return moveManipulatorUtil(0, 0, false, true)
|
||||
|
@ -48,6 +48,8 @@ public class ManipulatorPivotConstants {
|
||||
public static final double kNetPosition = Units.degreesToRadians(175.0+90);
|
||||
/**The closest position to the elevator brace without hitting it */
|
||||
public static final double kPivotSafeStowPosition = Units.degreesToRadians(71.0+90);
|
||||
|
||||
public static final double kBargeShotPosition = Units.degreesToRadians(222);
|
||||
/**The forward rotation limit of the pivot */
|
||||
public static final double kRotationLimit = Units.degreesToRadians(175.0+90);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user