Skip to content

Commit 00814f1

Browse files
Widen algae net scoring tolerance (#482)
1 parent 92ea195 commit 00814f1

File tree

3 files changed

+5
-8
lines changed

3 files changed

+5
-8
lines changed

src/main/java/frc/robot/Constants.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,9 @@
77
import static edu.wpi.first.units.Units.Kilograms;
88
import static edu.wpi.first.units.Units.MetersPerSecond;
99

10-
import java.util.ArrayList;
1110
import java.util.List;
1211
import java.util.Optional;
1312
import java.util.function.Supplier;
14-
import java.util.stream.Stream;
1513

1614
import com.ctre.phoenix.led.CANdleConfiguration;
1715
import com.ctre.phoenix.led.StrobeAnimation;
@@ -310,7 +308,7 @@ public static class constAlgaeIntake {
310308
public static final double ALGAE_OUTTAKE_NET_SPEED = -0.5;
311309
public static final double CLIMB_ALGAE_VELOCITY = -0.3;
312310

313-
public static final Angle INTAKE_DEADZONE_DISTANCE = Units.Degrees.of(1); // TODO: Tune this
311+
public static final Angle INTAKE_DEADZONE_DISTANCE = Units.Degrees.of(3.5);
314312

315313
/**
316314
* The velocity that the motor goes at once it has zeroed (and can no longer
@@ -525,6 +523,7 @@ public static class constElevator {
525523
public static final Distance ALGAE_GROUND_INTAKE = Units.Inches.of(0);
526524
public static final Distance PREP_0 = Units.Inches.of(2.8);
527525
public static final Distance DEADZONE_DISTANCE = Units.Inches.of(1);
526+
public static final Distance NET_TOLERANCE = Units.Inches.of(4.414); // phr :)
528527
public static final Distance EJECT_DEADZONE = Units.Inches.of(0.5);
529528
public static final Distance CORAL_INTAKE_HIGHT = Units.Inches.of(0);
530529
public static final Distance INIT_TIP_HEIGHT = Units.Inches.of(30);

src/main/java/frc/robot/RobotContainer.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -470,10 +470,6 @@ public boolean isAligned() {
470470
return subDrivetrain.isAlignedCoral();
471471
}
472472

473-
public boolean elevatorAndAlgaeAtSetPoint() {
474-
return subElevator.atDesiredPosition() && subAlgaeIntake.isAtSetPoint();
475-
}
476-
477473
public boolean coralStuckSoftwareLimitEnable() {
478474
return comCoralStuckSoftwareLimit.isCoralStuck();
479475
}

src/main/java/frc/robot/commands/states/scoring/ScoringAlgae.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import edu.wpi.first.wpilibj2.command.Command;
88
import frc.robot.RobotContainer;
99
import frc.robot.Constants.constAlgaeIntake;
10+
import frc.robot.Constants.constElevator;
1011
import frc.robot.Constants.constLED;
1112
import frc.robot.subsystems.AlgaeIntake;
1213
import frc.robot.subsystems.Elevator;
@@ -49,7 +50,8 @@ public void initialize() {
4950
// Called every time the scheduler runs while the command is scheduled.
5051
@Override
5152
public void execute() {
52-
if (globalElevator.atDesiredPosition() && subAlgaeIntake.isAtSetPoint()) {
53+
if (globalElevator.isAtSetPointWithTolerance(constElevator.ALGAE_PREP_NET, constElevator.NET_TOLERANCE)
54+
&& subAlgaeIntake.isAtSetPoint()) {
5355
subAlgaeIntake.setAlgaeIntakeMotor(desiredSpeed);
5456
}
5557
}

0 commit comments

Comments
 (0)