This commit is contained in:
Samuel
2026-04-01 13:13:18 -04:00
parent 4438560698
commit 5916f4f141
4 changed files with 106 additions and 155 deletions

View File

@@ -45,8 +45,8 @@ import frc.robot.generated.TunerConstants;
import frc.robot.subsystems.Balayeuse;
import frc.robot.subsystems.CommandSwerveDrivetrain;
import frc.robot.subsystems.Grimpeur;
import frc.robot.subsystems.LEDSubsystem;
import frc.robot.subsystems.Lanceur;
import frc.robot.subsystems.Led;
import frc.robot.subsystems.LimeLight3;
import frc.robot.subsystems.Limelight3G;
@@ -57,7 +57,7 @@ public class RobotContainer {
Lanceur lanceur = new Lanceur();
LimeLight3 limeLight3 = new LimeLight3();
Limelight3G limeLight3G = new Limelight3G();
Led led = new Led();
LEDSubsystem ledSubsystem = new LEDSubsystem();
CommandXboxController manette = new CommandXboxController(0);
CommandXboxController manette1 = new CommandXboxController(1);
private double MaxSpeed = TunerConstants.kSpeedAt12Volts.in(MetersPerSecond); // kSpeedAt12Volts desired top speed
@@ -67,10 +67,6 @@ public class RobotContainer {
private final SwerveRequest.FieldCentric drive = new SwerveRequest.FieldCentric()
.withDeadband(MaxSpeed * 0.1).withRotationalDeadband(MaxAngularRate * 0.1) // Add a 10% deadband
.withDriveRequestType(DriveRequestType.OpenLoopVoltage); // Use open-loop control for drive motors
private final SwerveRequest.SwerveDriveBrake brake = new SwerveRequest.SwerveDriveBrake();
private final SwerveRequest.PointWheelsAt point = new SwerveRequest.PointWheelsAt();
private final Telemetry logger = new Telemetry(MaxSpeed);
public final CommandSwerveDrivetrain drivetrain = TunerConstants.createDrivetrain();
@@ -99,6 +95,7 @@ public class RobotContainer {
}
private void configureBindings() {
ledSubsystem.setDefaultCommand(ledSubsystem.updateLEDs());
drivetrain.setDefaultCommand(
drivetrain.applyRequest(() ->
drive.withVelocityY(MathUtil.applyDeadband(-manette.getLeftX()*Math.abs(-manette.getLeftX())*MaxSpeed*0.7, 0.05))