Skip to content
This repository has been archived by the owner on Feb 9, 2024. It is now read-only.

Commit

Permalink
the final merge? PLEASE
Browse files Browse the repository at this point in the history
  • Loading branch information
PatribotsProgramming committed Nov 7, 2023
2 parents 0583ef9 + c86c66b commit fbf536d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 20 deletions.
2 changes: 1 addition & 1 deletion src/main/java/auto/AutoSegmentedWaypoints.java
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ else if (SwerveTrajectory.trajectoryStatus.equals("done")) {
}

// 0.2 seconds since the claw has moved (and if there are more waypoints)
if (((Timer.getFPGATimestamp() - autoDelay > 0.3 && clawHasStarted) || currentWaypointNumber == 0) || (clawSpeed == PlacementConstants.CLAW_STOPPED_SPEED)) {
if (((Timer.getFPGATimestamp() - autoDelay > 0.15 && clawHasStarted) || currentWaypointNumber == 0) || (clawSpeed == PlacementConstants.CLAW_STOPPED_SPEED)) {
stateHasFinished = true;
}
}
Expand Down
23 changes: 4 additions & 19 deletions src/main/java/frc/robot/Robot.java
Original file line number Diff line number Diff line change
Expand Up @@ -103,13 +103,6 @@ public void robotInit() {
}
Timer.delay(0.25);

// Wait wait wait wait for the DS to connect
// then assign our alliance color
while (DriverStation.getAlliance() == Alliance.Invalid) {
DriverStation.refreshData();
}

FieldConstants.ALLIANCE = DriverStation.getAlliance();
}

/**
Expand All @@ -122,22 +115,11 @@ public void robotInit() {
@Override
public void robotPeriodic() {

double dt = Timer.getFPGATimestamp() - DriverUI.currentTimestamp;
SmartDashboard.putNumber("Timer/dTPrelog", dt);

Logger.updateEntries();
arduinoController.periodic();
claw.updateOutputCurrent();
arm.logPositions();
swerve.logPositions();

dt = Timer.getFPGATimestamp() - DriverUI.currentTimestamp;

if (dt > 0.02) DriverUI.overrunCount++;

SmartDashboard.putNumber("Timer/dTPostlog", dt);
SmartDashboard.putNumber("Timer/overrunCounter", DriverUI.overrunCount);
DriverUI.currentTimestamp = Timer.getFPGATimestamp();

}

Expand All @@ -164,7 +146,10 @@ public void disabledInit() {

@Override
public void disabledPeriodic() {
FieldConstants.ALLIANCE = DriverStation.getAlliance();
if (DriverStation.getAlliance() != Alliance.Invalid) {
FieldConstants.ALLIANCE = DriverStation.getAlliance();
}

if (FieldConstants.ALLIANCE != Alliance.Invalid) {
if (Math.abs(swerve.getPitch().getDegrees()) > 35) {
arduinoController.setLEDState(LEDConstants.BELLY_PAN_CHROMA);
Expand Down

0 comments on commit fbf536d

Please sign in to comment.