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

View File

@ -19,7 +19,7 @@ public class Lancer extends Command {
this.limelight = limelight;
this.lanceur = lanceur;
// Use addRequirements() here to declare subsystem dependencies.
addRequirements(lanceur,limelight);
addRequirements(lanceur);
}
// Called when the command is initially scheduled.

View File

@ -17,7 +17,7 @@ public class Lancerampli extends Command {
private Limelight limelight;
public Lancerampli(Lanceur lanceur,Limelight limelight) {
// Use addRequirements() here to declare subsystem dependencies.
addRequirements(lanceur, limelight);
addRequirements(lanceur);
this.limelight = limelight;
this.lanceur = lanceur;
}

View File

@ -29,6 +29,7 @@ public class Limelight_tracker extends Command {
if (tracker.getv()){
drive.drive(0,0, tracker.getx());
}
else{
drive.drive(0, 0, 0);

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(){