From e24e36486bca66a7c8c241dc406691f2715990f2 Mon Sep 17 00:00:00 2001 From: samuel desharnais Date: Wed, 24 Apr 2024 17:23:49 -0400 Subject: [PATCH 1/4] --- src/main/java/frc/robot/subsystem/Drive.java | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/main/java/frc/robot/subsystem/Drive.java b/src/main/java/frc/robot/subsystem/Drive.java index b802bd8..899b592 100644 --- a/src/main/java/frc/robot/subsystem/Drive.java +++ b/src/main/java/frc/robot/subsystem/Drive.java @@ -58,9 +58,7 @@ public class Drive extends SubsystemBase { public SwerveModulePosition[] distance(){ return swerveDrive.getModulePositions(); } -public void reset(){ -} @Override public void periodic() { From bb4bee0d96809c71e39947a89d2439dae439b084 Mon Sep 17 00:00:00 2001 From: samuel desharnais Date: Wed, 24 Apr 2024 17:38:05 -0400 Subject: [PATCH 2/4] --- src/main/java/frc/robot/RobotContainer.java | 7 ++-- .../java/frc/robot/command/AvancerAuto.java | 40 +++++++++++++++++++ 2 files changed, 44 insertions(+), 3 deletions(-) create mode 100644 src/main/java/frc/robot/command/AvancerAuto.java diff --git a/src/main/java/frc/robot/RobotContainer.java b/src/main/java/frc/robot/RobotContainer.java index 796c625..1d96ab5 100644 --- a/src/main/java/frc/robot/RobotContainer.java +++ b/src/main/java/frc/robot/RobotContainer.java @@ -14,10 +14,11 @@ import edu.wpi.first.wpilibj.smartdashboard.SendableChooser; import edu.wpi.first.wpilibj2.command.Command; import edu.wpi.first.wpilibj2.command.ParallelCommandGroup; import edu.wpi.first.wpilibj2.command.RunCommand; - +import edu.wpi.first.wpilibj2.command.SequentialCommandGroup; // Manettes import edu.wpi.first.wpilibj2.command.button.CommandJoystick; import edu.wpi.first.wpilibj2.command.button.CommandXboxController; +import frc.robot.command.AvancerAuto; // Commands import frc.robot.command.Balayer; import frc.robot.command.GrimpeurDroit; @@ -68,7 +69,7 @@ public class RobotContainer { GrimpeurDroit grimpeurDroit = new GrimpeurDroit(grimpeur, manette::getLeftY); GrimpeurGauche grimpeurGauche = new GrimpeurGauche(grimpeur, manette::getRightY); Debalayer debalayer = new Debalayer(balayeuse, accumulateur); - + AvancerAuto avancerAuto = new AvancerAuto(drive); public RobotContainer() { dashboard.addCamera("limelight", "limelight","limelight.local:5800") @@ -115,6 +116,6 @@ public class RobotContainer { private void configureBindings() {} public Command getAutonomousCommand(){ - return autoChooser.getSelected(); + return new SequentialCommandGroup(lancer.withTimeout(2),avancerAuto.withTimeout(3)); } } diff --git a/src/main/java/frc/robot/command/AvancerAuto.java b/src/main/java/frc/robot/command/AvancerAuto.java new file mode 100644 index 0000000..63bd322 --- /dev/null +++ b/src/main/java/frc/robot/command/AvancerAuto.java @@ -0,0 +1,40 @@ +// Copyright (c) FIRST and other WPILib contributors. +// Open Source Software; you can modify and/or share it under the terms of +// the WPILib BSD license file in the root directory of this project. + +package frc.robot.command; + +import edu.wpi.first.wpilibj2.command.Command; +import frc.robot.subsystem.Drive; + +public class AvancerAuto extends Command { + private Drive drive; + /** Creates a new AvancerAuto. */ + public AvancerAuto(Drive drive) { + this.drive = drive; + addRequirements(drive); + // Use addRequirements() here to declare subsystem dependencies. + } + + // Called when the command is initially scheduled. + @Override + public void initialize() {} + + // Called every time the scheduler runs while the command is scheduled. + @Override + public void execute() { + drive.drive(0.5, 0, 0); + } + + // Called once the command ends or is interrupted. + @Override + public void end(boolean interrupted) { + drive.drive(0, 0, 0); + } + + // Returns true when the command should end. + @Override + public boolean isFinished() { + return false; + } +} From f9d9e4fe34643f8010b5ebc92c3a4ce7e889d8ff Mon Sep 17 00:00:00 2001 From: samuel desharnais Date: Wed, 24 Apr 2024 17:39:41 -0400 Subject: [PATCH 3/4] --- src/main/java/frc/robot/RobotContainer.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/frc/robot/RobotContainer.java b/src/main/java/frc/robot/RobotContainer.java index 1d96ab5..0720314 100644 --- a/src/main/java/frc/robot/RobotContainer.java +++ b/src/main/java/frc/robot/RobotContainer.java @@ -90,7 +90,7 @@ public class RobotContainer { manette.start().whileTrue(new RestGyro(drive)); manette.a().whileTrue(new GuiderBas(guideur)); manette.b().whileTrue(new GuiderHaut(guideur)); - + manette.x().whileTrue(avancerAuto); //joystick joystick.button(3).whileTrue(new Balayer(balayeuse, accumulateur)); manette1.rightBumper().whileTrue(new LancerNote(lanceur, accumulateur)); @@ -116,6 +116,6 @@ public class RobotContainer { private void configureBindings() {} public Command getAutonomousCommand(){ - return new SequentialCommandGroup(lancer.withTimeout(2),avancerAuto.withTimeout(3)); + return new SequentialCommandGroup(lancer.withTimeout(2)); } } From 41e0e4732216a6b267b02843d6d7943ad2e8f3e8 Mon Sep 17 00:00:00 2001 From: samuel desharnais Date: Wed, 24 Apr 2024 17:54:10 -0400 Subject: [PATCH 4/4] --- src/main/java/frc/robot/RobotContainer.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/frc/robot/RobotContainer.java b/src/main/java/frc/robot/RobotContainer.java index 0720314..f39cd66 100644 --- a/src/main/java/frc/robot/RobotContainer.java +++ b/src/main/java/frc/robot/RobotContainer.java @@ -116,6 +116,6 @@ public class RobotContainer { private void configureBindings() {} public Command getAutonomousCommand(){ - return new SequentialCommandGroup(lancer.withTimeout(2)); + return autoChooser.getSelected(); //new SequentialCommandGroup(lancer.withTimeout(2)); } }