This commit is contained in:
Antoine PerreaultE 2024-01-10 19:03:59 -05:00
parent 2b57758fc5
commit 6c93d58f09
5 changed files with 6 additions and 19 deletions

View File

@ -31,7 +31,6 @@ import frc.robot.commands.Force5;
import frc.robot.commands.Force6; import frc.robot.commands.Force6;
import frc.robot.commands.Force7; import frc.robot.commands.Force7;
import frc.robot.commands.LanceurAuto; import frc.robot.commands.LanceurAuto;
import frc.robot.commands.Force1;
import frc.robot.commands.AvancerGauche; import frc.robot.commands.AvancerGauche;
import frc.robot.commands.accumulateurtest; import frc.robot.commands.accumulateurtest;
import frc.robot.subsystems.Accumulateur; import frc.robot.subsystems.Accumulateur;

View File

@ -38,18 +38,16 @@ public class Avancer extends CommandBase {
// Called every time the scheduler runs while the command is scheduled. // Called every time the scheduler runs while the command is scheduled.
@Override @Override
public void execute() { public void execute() {
drive.drive(0.5, 0.2, 0); drive.drive(0.5, -0.2, 0);
} }
// Called once the command ends or is interrupted. // Called once the command ends or is interrupted.
@Override @Override
public void end(boolean interrupted) { public void end(boolean interrupted) {}
drive.drive(0, 0, 0);
}
// Returns true when the command should end. // Returns true when the command should end.
@Override @Override
public boolean isFinished() { public boolean isFinished() {
return drive.distance()[0].distanceMeters>0.01; return drive.distance()[0].distanceMeters>1;
} }
} }

View File

@ -31,7 +31,7 @@ public class Force1 extends CommandBase {
// Called every time the scheduler runs while the command is scheduled. // Called every time the scheduler runs while the command is scheduled.
@Override @Override
public void execute() { public void execute() {
lanceur.lancer(0.3); lanceur.lancer(0.33);
} }
// Called once the command ends or is interrupted. // Called once the command ends or is interrupted.

View File

@ -24,7 +24,7 @@ public class LanceurAuto extends CommandBase {
// Called every time the scheduler runs while the command is scheduled. // Called every time the scheduler runs while the command is scheduled.
@Override @Override
public void execute() { public void execute() {
lanceur.lancer(0.75); lanceur.lancer(0.755);
} }
// Called once the command ends or is interrupted. // Called once the command ends or is interrupted.

View File

@ -7,25 +7,15 @@ package frc.robot.subsystems;
import java.io.File; import java.io.File;
import java.io.IOException; import java.io.IOException;
import edu.wpi.first.cameraserver.CameraServer;
import edu.wpi.first.math.geometry.Translation2d; import edu.wpi.first.math.geometry.Translation2d;
import edu.wpi.first.math.kinematics.SwerveModulePosition; import edu.wpi.first.math.kinematics.SwerveModulePosition;
import edu.wpi.first.wpilibj.Filesystem; import edu.wpi.first.wpilibj.Filesystem;
import edu.wpi.first.wpilibj.shuffleboard.BuiltInLayouts; import edu.wpi.first.wpilibj.shuffleboard.BuiltInLayouts;
import edu.wpi.first.wpilibj.shuffleboard.Shuffleboard; import edu.wpi.first.wpilibj.shuffleboard.Shuffleboard;
import edu.wpi.first.wpilibj.shuffleboard.ShuffleboardLayout; import edu.wpi.first.wpilibj.shuffleboard.ShuffleboardLayout;
import com.revrobotics.CANSparkMax;
import com.revrobotics.CANSparkMaxLowLevel.MotorType;
import edu.wpi.first.math.geometry.Translation2d;
import edu.wpi.first.math.kinematics.SwerveModulePosition;
import edu.wpi.first.wpilibj.Filesystem;
import edu.wpi.first.wpilibj.shuffleboard.Shuffleboard;
import edu.wpi.first.wpilibj.shuffleboard.ShuffleboardTab; import edu.wpi.first.wpilibj.shuffleboard.ShuffleboardTab;
import edu.wpi.first.wpilibj2.command.SubsystemBase; import edu.wpi.first.wpilibj2.command.SubsystemBase;
import frc.robot.Constants;
import swervelib.SwerveDrive; import swervelib.SwerveDrive;
import swervelib.encoders.CanAndCoderSwerve;
import swervelib.parser.SwerveParser; import swervelib.parser.SwerveParser;
public class Drive extends SubsystemBase { public class Drive extends SubsystemBase {
@ -49,7 +39,7 @@ public class Drive extends SubsystemBase {
final CanAndCoderSwerve arrieregaucheangle = new CanAndCoderSwerve(Constants.arrieregaucheAngle); final CanAndCoderSwerve arrieregaucheangle = new CanAndCoderSwerve(Constants.arrieregaucheAngle);
final CanAndCoderSwerve arrieredroitangle = new CanAndCoderSwerve(Constants.arrieredroitAngle); */ final CanAndCoderSwerve arrieredroitangle = new CanAndCoderSwerve(Constants.arrieredroitAngle); */
public void drive(double x, double y, double zRotation){ public void drive(double x, double y, double zRotation){
swerveDrive.drive(new Translation2d(x, y), zRotation, false, false); swerveDrive.drive(new Translation2d(x, y), zRotation, true, false);
} }