Skip to content

Commit

Permalink
fix ground pickup issue
Browse files Browse the repository at this point in the history
  • Loading branch information
JayK445 committed Nov 11, 2023
1 parent 38d200a commit 8e417cd
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 13 deletions.
26 changes: 13 additions & 13 deletions src/main/java/frc/robot/RobotContainer.java
Original file line number Diff line number Diff line change
Expand Up @@ -600,19 +600,19 @@ public void end(boolean interrupted) {
"N9 1Cone + Mobility",
new N9_1ConePlusMobility(4.95, 3, intakeSubsystem, elevatorSubsystem, drivebaseSubsystem));

autoSelector.addOption(
"Score High Cone [DOES NOT CALIBRATE]",
new SetZeroModeCommand(
elevatorSubsystem) // FIXME pretty sure this shouldn't zero wrist, double check
// later
.raceWith(
new IntakeModeCommand(intakeSubsystem, Modes.INTAKE, () -> false)
.andThen(
new ScoreCommand(
intakeSubsystem,
elevatorSubsystem,
Constants.SCORE_STEP_MAP.get(
NodeSelectorUtility.NodeType.CONE.atHeight(Height.HIGH))))));
// autoSelector.addOption(
// "Score High Cone [DOES NOT CALIBRATE]",
// new SetZeroModeCommand(
// elevatorSubsystem) // FIXME pretty sure this shouldn't zero wrist, double check
// // later
// .raceWith(
// new IntakeModeCommand(intakeSubsystem, Modes.INTAKE, () -> false)
// .andThen(
// new ScoreCommand(
// intakeSubsystem,
// elevatorSubsystem,
// Constants.SCORE_STEP_MAP.get(
// NodeSelectorUtility.NodeType.CONE.atHeight(Height.HIGH))))));

driverView.add("auto selector", autoSelector).withSize(4, 1).withPosition(7, 0);

Expand Down
15 changes: 15 additions & 0 deletions src/main/java/frc/robot/commands/GroundIntakeElevatorCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@

import edu.wpi.first.wpilibj2.command.CommandBase;
import frc.robot.Constants;
import frc.robot.Constants.Elevator;
import frc.robot.subsystems.ElevatorSubsystem;
import frc.util.Util;

import java.util.function.BooleanSupplier;

public class GroundIntakeElevatorCommand extends CommandBase {
Expand All @@ -25,4 +28,16 @@ public void execute() {
elevatorSubsystem.setTargetState(Constants.Elevator.Setpoints.GROUND_INTAKE_CONE);
}
}

@Override
public boolean isFinished() {
return Util.epsilonEquals(
elevatorSubsystem.getCurrentAngleDegrees(),
elevatorSubsystem.getTargetAngle(),
Elevator.ANGLE_EPSILON)
&& Util.epsilonEquals(
elevatorSubsystem.getCurrentExtensionInches(),
elevatorSubsystem.getTargetExtension(),
Elevator.EXTENSION_EPSILON);
}
}

0 comments on commit 8e417cd

Please sign in to comment.