Skip to content

Commit

Permalink
Revert "Add temporary average calccer"
Browse files Browse the repository at this point in the history
This reverts commit 7edf6ee.
  • Loading branch information
FriedLongJohns committed Oct 7, 2023
1 parent c1ec9f8 commit 7fab557
Showing 1 changed file with 1 addition and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,6 @@ public class Drivetrain extends SubsystemBase implements SwerveDriveInterface {

public final float initPitch;
public final float initRoll;

//TEMP
public double[] sumVel = new double[] {0.,0.,0.,0.};
public int velCount = 0;
public final int cycleDur = 5; public int cCycle=0;


public Drivetrain() {

Expand Down Expand Up @@ -149,28 +143,14 @@ public void periodic() {
// SmartDashboard.putNumber("Pitch", gyro.getPitch());
// SmartDashboard.putNumber("Roll", gyro.getRoll());
SmartDashboard.putNumber("Raw gyro angle", gyro.getAngle());
SmartDashboard.putNumber("Robot Heading", getHeading());
SmartDashboard.putNumber("Robot Heading", getHeading());
// SmartDashboard.putNumber("AdjRoll", gyro.getPitch() - initPitch);
// SmartDashboard.putNumber("AdjPitch", gyro.getRoll() - initRoll);
// fieldOriented = SmartDashboard.getBoolean("Field Oriented", true);
// SmartDashboard.putNumber("Gyro Compass Heading", gyro.getCompassHeading());
// SmartDashboard.putNumber("Compass Offset", compassOffset);
// SmartDashboard.putBoolean("Current Magnetic Field Disturbance",
// gyro.isMagneticDisturbance());
cCycle++;
if (cCycle==cycleDur){
cCycle=0;
velCount++;

for (int i=0;i<4;i++) {
SwerveModule sm = modules[i];
sumVel[i] += sm.getCurrentSpeed();
}
}
SmartDashboard.putNumber("avg speed fl", sumVel[0]/velCount);
SmartDashboard.putNumber("avg speed fr", sumVel[1]/velCount);
SmartDashboard.putNumber("avg speed bl", sumVel[2]/velCount);
SmartDashboard.putNumber("avg speed br", sumVel[3]/velCount);
}

public void autoCancelDtCommand() {
Expand Down

0 comments on commit 7fab557

Please sign in to comment.