This commit is contained in:
2024-02-08 19:47:36 -05:00
parent 95eb98c812
commit 99f3a8fe2c
4 changed files with 8 additions and 7 deletions

View File

@ -32,6 +32,11 @@ public class Drive extends SubsystemBase {
}
public Drive() {
try {
this.swerveDrive = new SwerveParser(swerveJsonDirectory).createSwerveDrive(2);
} catch (IOException e) {
e.printStackTrace();
}
AutoBuilder.configureHolonomic(swerveDrive::getPose, swerveDrive::resetOdometry, swerveDrive::getRobotVelocity, swerveDrive::setChassisSpeeds, new HolonomicPathFollowerConfig(
new PIDConstants(5,0,0), new PIDConstants(5,0,0), 4.5,
0.275,
@ -43,11 +48,6 @@ public class Drive extends SubsystemBase {
}
return false;
}, this);
try {
this.swerveDrive = new SwerveParser(swerveJsonDirectory).createSwerveDrive(2);
} catch (IOException e) {
e.printStackTrace();
}
}
public SwerveModulePosition[] distance(){