File tree Expand file tree Collapse file tree 3 files changed +5
-8
lines changed Expand file tree Collapse file tree 3 files changed +5
-8
lines changed Original file line number Diff line number Diff line change 77import static edu .wpi .first .units .Units .Kilograms ;
88import static edu .wpi .first .units .Units .MetersPerSecond ;
99
10- import java .util .ArrayList ;
1110import java .util .List ;
1211import java .util .Optional ;
1312import java .util .function .Supplier ;
14- import java .util .stream .Stream ;
1513
1614import com .ctre .phoenix .led .CANdleConfiguration ;
1715import 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 );
Original file line number Diff line number Diff 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 }
Original file line number Diff line number Diff line change 77import edu .wpi .first .wpilibj2 .command .Command ;
88import frc .robot .RobotContainer ;
99import frc .robot .Constants .constAlgaeIntake ;
10+ import frc .robot .Constants .constElevator ;
1011import frc .robot .Constants .constLED ;
1112import frc .robot .subsystems .AlgaeIntake ;
1213import 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 }
You can’t perform that action at this time.
0 commit comments