Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/main/java/frc/robot/RobotContainer.java
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ private void configureBindings() {
applyDeadband(-controller.getLeftY() * speedMultiplier),
applyDeadband(-controller.getLeftX() * speedMultiplier),
applyDeadband(-controller.getRightX() * speedMultiplier),
fieldRelative,
true,
true),
drivetrain));

Expand Down Expand Up @@ -265,6 +265,6 @@ public void periodic() {
// autonomous command
public Command getAutonomousCommand() {
return Commands.sequence(
Commands.waitSeconds(2), coral.goToReef(drivetrain, () -> reefSection, () -> 3));
Commands.waitSeconds(1), coral.goToReef(drivetrain, () -> reefSection, () -> 3));
}
}
4 changes: 2 additions & 2 deletions src/main/java/frc/robot/config/CoralConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ public class CoralConfig {
public static final double MOVEMENT_I = 0.0;
public static final double MOVEMENT_D = 0.0;

public static final double POSITION_TOLERANCE = 0.5;
public static final double VELOCITY_TOLERANCE = 1.0;
public static final double POSITION_TOLERANCE = 0.15;
public static final double VELOCITY_TOLERANCE = 0.15;

public static final double INTAKE_HEIGHT = 0.065;
public static final Rotation2d INTAKE_ANGLE_UPPER = Rotation2d.fromRadians(1.65);
Expand Down
12 changes: 8 additions & 4 deletions src/main/java/frc/robot/subsystems/Coral.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public class Coral extends SubsystemBase {
private CoralPivot coralPivot = new CoralPivot();

// heights for levels
private double[] elevatorScoringHeights = {0.0, 0.900, 1.29, 1.360};
private double[] elevatorScoringHeights = {0.0, 0.910, 1.31, 1.360};

// rotations for levels
private Rotation2d[] coralScoringRotations = {
Expand All @@ -34,10 +34,10 @@ public class Coral extends SubsystemBase {
Rotation2d.fromRadians(0.3)
};
private Rotation2d[] reefClearRotationsPrimary = {
Rotation2d.fromRadians(1.5), Rotation2d.fromRadians(1.5)
Rotation2d.fromRadians(1.9), Rotation2d.fromRadians(1.9)
};
private Rotation2d[] reefClearRotationsSecondary = {
Rotation2d.fromRadians(0.95), Rotation2d.fromRadians(0.95)
Rotation2d.fromRadians(1.5), Rotation2d.fromRadians(1.5)
};
private double[] reefClearHeights = {0.65, 1.0564};

Expand Down Expand Up @@ -202,7 +202,11 @@ public Command goToReef(Drivetrain drivetrain, IntSupplier idx, IntSupplier heig
.getRadians());
},
() -> CoralConfig.MOVEMENT_DISTANCE)
.until(() -> movementController.atSetpoint())
.until(
() ->
movementController.atSetpoint()
&& drivetrain.rotController.atSetpoint()
&& drivetrain.xController.atSetpoint())
.andThen(
Commands.waitSeconds(1.0)
.andThen(
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/frc/robot/subsystems/Drivetrain.java
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,8 @@ public void periodic() {
// Puts the pose data from one camera into a list
List<PhotonPipelineResult> results = Vision.camera.getAllUnreadResults();

// If there is pose data from the cameras, get the latest estimated pose and update the 'vision'
// If there is pose data from the cameras, get the latest estimated pose and update the
// 'vision'
// photon pose estimator
// If there is no multi tag result and the distance from the camera to the target is greater
// than
Expand Down