From aaaecdbb5d11085144fa4eda4cbddd2f307115e7 Mon Sep 17 00:00:00 2001 From: samuel desharnais Date: Wed, 23 Nov 2022 17:46:28 -0500 Subject: [PATCH 01/10] ggfhvhb --- simgui.json | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/simgui.json b/simgui.json index 3405fd2..8d5fd7d 100644 --- a/simgui.json +++ b/simgui.json @@ -6,6 +6,13 @@ "/LiveWindow/Ungrouped/MecanumDrive[1]": "MecanumDrive", "/LiveWindow/Ungrouped/Scheduler": "Scheduler", "/LiveWindow/Ungrouped/navX-Sensor[4]": "Gyro" + }, + "windows": { + "/LiveWindow/Ungrouped/MecanumDrive[1]": { + "window": { + "visible": true + } + } } } } From cdcaf9bb0496eb6156fc0dca6c183658e155374c Mon Sep 17 00:00:00 2001 From: Antoine PerreaultE Date: Wed, 23 Nov 2022 18:00:44 -0500 Subject: [PATCH 02/10] asdfg --- src/main/java/frc/robot/RobotContainer.java | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/main/java/frc/robot/RobotContainer.java b/src/main/java/frc/robot/RobotContainer.java index 8ecee90..d947f14 100644 --- a/src/main/java/frc/robot/RobotContainer.java +++ b/src/main/java/frc/robot/RobotContainer.java @@ -4,12 +4,22 @@ package frc.robot; +import edu.wpi.first.math.estimator.KalmanFilter; import edu.wpi.first.wpilibj.GenericHID; +import edu.wpi.first.wpilibj.Joystick; import edu.wpi.first.wpilibj.XboxController; import edu.wpi.first.wpilibj2.command.Command; import edu.wpi.first.wpilibj2.command.RunCommand; +import edu.wpi.first.wpilibj2.command.button.JoystickButton; import frc.robot.subsystems.BasePilotable; +import frc.robot.subsystems.Poussoir; +import frc.robot.subsystems.Pistonshaker; +import frc.robot.commands.Activer_poussoir; +import frc.robot.commands.ActiverBlockeur; +import frc.robot.commands.DesactiverBlockeur; +import frc.robot.commands.Activershaker; + /** * This class is where the bulk of the robot should be declared. Since Command-based is a @@ -40,7 +50,13 @@ public class RobotContainer { * edu.wpi.first.wpilibj.Joystick} or {@link XboxController}), and then passing it to a {@link * edu.wpi.first.wpilibj2.command.button.JoystickButton}. */ - private void configureButtonBindings() {} + private void configureButtonBindings() { + + + + + + } /** * Use this to pass the autonomous command to the main {@link Robot} class. From c70ea7ab6386da5f3d9c4afde0c1c90ebea41500 Mon Sep 17 00:00:00 2001 From: samuel desharnais Date: Wed, 23 Nov 2022 18:05:25 -0500 Subject: [PATCH 03/10] ydfhgtguhj --- src/main/java/frc/robot/commands/Reculer.java | 41 +++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 src/main/java/frc/robot/commands/Reculer.java diff --git a/src/main/java/frc/robot/commands/Reculer.java b/src/main/java/frc/robot/commands/Reculer.java new file mode 100644 index 0000000..776c2fa --- /dev/null +++ b/src/main/java/frc/robot/commands/Reculer.java @@ -0,0 +1,41 @@ +// 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.commands; + +import edu.wpi.first.wpilibj2.command.CommandBase; +import frc.robot.subsystems.BasePilotable; + +public class Reculer extends CommandBase { + private BasePilotable basePilotable; + /** Creates a new Reculer. */ + public Reculer(BasePilotable basePilotable) { + basePilotable = new BasePilotable(); + // Use addRequirements() here to declare subsystem dependencies. + addRequirements(basePilotable); + } + + // 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() { + basePilotable.drive(0.5, 0.5, 0); + } + + // Called once the command ends or is interrupted. + @Override + public void end(boolean interrupted) { + basePilotable.drive(0, 0, 0); + } + + // Returns true when the command should end. + @Override + public boolean isFinished() { + return false; + } +} From ff28d1a0d6cd2aa6b61eeebcf140762eeef93ba4 Mon Sep 17 00:00:00 2001 From: samuel desharnais Date: Wed, 23 Nov 2022 18:11:40 -0500 Subject: [PATCH 04/10] hg, --- src/main/java/frc/robot/commands/Tourner.java | 41 +++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 src/main/java/frc/robot/commands/Tourner.java diff --git a/src/main/java/frc/robot/commands/Tourner.java b/src/main/java/frc/robot/commands/Tourner.java new file mode 100644 index 0000000..1a710cc --- /dev/null +++ b/src/main/java/frc/robot/commands/Tourner.java @@ -0,0 +1,41 @@ +// 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.commands; + +import edu.wpi.first.wpilibj2.command.CommandBase; +import frc.robot.subsystems.BasePilotable; + +public class Tourner extends CommandBase { + private BasePilotable basePilotable; + /** Creates a new Tourner. */ + public Tourner(BasePilotable basePilotable) { + basePilotable = new BasePilotable(); + // Use addRequirements() here to declare subsystem dependencies. + addRequirements(basePilotable); + } + + // 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() { + basePilotable.drive(0, 0, 0.5); + } + + // Called once the command ends or is interrupted. + @Override + public void end(boolean interrupted) { + basePilotable.drive(0, 0, 0); + } + + // Returns true when the command should end. + @Override + public boolean isFinished() { + return false; + } +} From 947a7832ee81eb4f1a481a3ace5f0328db6344ab Mon Sep 17 00:00:00 2001 From: samuel desharnais Date: Wed, 23 Nov 2022 18:20:25 -0500 Subject: [PATCH 05/10] fhgfj --- src/main/java/frc/robot/commands/Avancer.java | 40 +++++++++++++++++++ src/main/java/frc/robot/commands/Reculer.java | 2 +- 2 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 src/main/java/frc/robot/commands/Avancer.java diff --git a/src/main/java/frc/robot/commands/Avancer.java b/src/main/java/frc/robot/commands/Avancer.java new file mode 100644 index 0000000..b669a57 --- /dev/null +++ b/src/main/java/frc/robot/commands/Avancer.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.commands; + +import edu.wpi.first.wpilibj2.command.CommandBase; +import frc.robot.subsystems.BasePilotable; + +public class Avancer extends CommandBase { + private BasePilotable basePilotable; + /** Creates a new Avancer. */ + public Avancer(BasePilotable basePilotable) { + basePilotable = new BasePilotable(); + // Use addRequirements() here to declare subsystem dependencies. + addRequirements(basePilotable); + } + + // 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() { + basePilotable.drive(0.5, 0.5, 0); + } + + // Called once the command ends or is interrupted. + @Override + public void end(boolean interrupted) { + basePilotable.drive(0, 0, 0); + } + + // Returns true when the command should end. + @Override + public boolean isFinished() { + return false; + } +} diff --git a/src/main/java/frc/robot/commands/Reculer.java b/src/main/java/frc/robot/commands/Reculer.java index 776c2fa..8923870 100644 --- a/src/main/java/frc/robot/commands/Reculer.java +++ b/src/main/java/frc/robot/commands/Reculer.java @@ -24,7 +24,7 @@ public class Reculer extends CommandBase { // Called every time the scheduler runs while the command is scheduled. @Override public void execute() { - basePilotable.drive(0.5, 0.5, 0); + basePilotable.drive(-0.5, -0.5, 0); } // Called once the command ends or is interrupted. From 7cb89bbd0ae819abb525d77030e9254768a07d8b Mon Sep 17 00:00:00 2001 From: samuel desharnais Date: Wed, 23 Nov 2022 18:25:19 -0500 Subject: [PATCH 06/10] gkvjhb --- .../frc/robot/commands/{Tourner.java => TournerDroite.java} | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename src/main/java/frc/robot/commands/{Tourner.java => TournerDroite.java} (91%) diff --git a/src/main/java/frc/robot/commands/Tourner.java b/src/main/java/frc/robot/commands/TournerDroite.java similarity index 91% rename from src/main/java/frc/robot/commands/Tourner.java rename to src/main/java/frc/robot/commands/TournerDroite.java index 1a710cc..ef211a6 100644 --- a/src/main/java/frc/robot/commands/Tourner.java +++ b/src/main/java/frc/robot/commands/TournerDroite.java @@ -7,10 +7,10 @@ package frc.robot.commands; import edu.wpi.first.wpilibj2.command.CommandBase; import frc.robot.subsystems.BasePilotable; -public class Tourner extends CommandBase { +public class TournerDroite extends CommandBase { private BasePilotable basePilotable; /** Creates a new Tourner. */ - public Tourner(BasePilotable basePilotable) { + public TournerDroite(BasePilotable basePilotable) { basePilotable = new BasePilotable(); // Use addRequirements() here to declare subsystem dependencies. addRequirements(basePilotable); From 4c58e53150b2008760d4ba63bed47f5daa41f51c Mon Sep 17 00:00:00 2001 From: samuel desharnais Date: Wed, 23 Nov 2022 18:30:31 -0500 Subject: [PATCH 07/10] fhcgjnm --- .../frc/robot/commands/TournerGauche.java | 39 +++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 src/main/java/frc/robot/commands/TournerGauche.java diff --git a/src/main/java/frc/robot/commands/TournerGauche.java b/src/main/java/frc/robot/commands/TournerGauche.java new file mode 100644 index 0000000..04e7b40 --- /dev/null +++ b/src/main/java/frc/robot/commands/TournerGauche.java @@ -0,0 +1,39 @@ +// 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.commands; + +import edu.wpi.first.wpilibj2.command.CommandBase; +import frc.robot.subsystems.BasePilotable; + +public class TournerGauche extends CommandBase { + private BasePilotable basePilotable; + /** Creates a new TournerGauche. */ + public TournerGauche(BasePilotable basePilotable) { + // Use addRequirements() here to declare subsystem dependencies. + addRequirements(basePilotable); + } + + // 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() { + basePilotable.drive(0, 0, -0.5); + } + + // Called once the command ends or is interrupted. + @Override + public void end(boolean interrupted) { + basePilotable.drive(0, 0, 0); + } + + // Returns true when the command should end. + @Override + public boolean isFinished() { + return false; + } +} From 1200cb0b483f4e9bb38ba5f20f880cec3e949018 Mon Sep 17 00:00:00 2001 From: Antoine PerreaultE Date: Wed, 23 Nov 2022 18:40:33 -0500 Subject: [PATCH 08/10] D --- src/main/java/frc/robot/RobotContainer.java | 12 ++++--- src/main/java/frc/robot/commands/BoutonY.java | 32 +++++++++++++++++++ 2 files changed, 39 insertions(+), 5 deletions(-) create mode 100644 src/main/java/frc/robot/commands/BoutonY.java diff --git a/src/main/java/frc/robot/RobotContainer.java b/src/main/java/frc/robot/RobotContainer.java index d947f14..83ea5a4 100644 --- a/src/main/java/frc/robot/RobotContainer.java +++ b/src/main/java/frc/robot/RobotContainer.java @@ -8,7 +8,7 @@ import edu.wpi.first.math.estimator.KalmanFilter; import edu.wpi.first.wpilibj.GenericHID; import edu.wpi.first.wpilibj.Joystick; import edu.wpi.first.wpilibj.XboxController; - +import edu.wpi.first.wpilibj.XboxController.Button; import edu.wpi.first.wpilibj2.command.Command; import edu.wpi.first.wpilibj2.command.RunCommand; import edu.wpi.first.wpilibj2.command.button.JoystickButton; @@ -51,10 +51,12 @@ public class RobotContainer { * edu.wpi.first.wpilibj2.command.button.JoystickButton}. */ private void configureButtonBindings() { - - - - + JoystickButton buttonA = new JoystickButton(manette, XboxController.Button.kA.value); + buttonA.whileHeld(Poussoir); + JoystickButton rightbumper = new JoystickButton(manette, XboxController.Button.kLeftBumper.value); + rightbumper.whileHeld(Pistonshaker); + JoystickButton buttonY = new JoystickButton(manette, XboxController.Button.kY.value); + buttonY.whenPressed(DesactiverBlockeur, ActiverBlockeur); } diff --git a/src/main/java/frc/robot/commands/BoutonY.java b/src/main/java/frc/robot/commands/BoutonY.java new file mode 100644 index 0000000..884458b --- /dev/null +++ b/src/main/java/frc/robot/commands/BoutonY.java @@ -0,0 +1,32 @@ +// 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.commands; + +import edu.wpi.first.wpilibj2.command.CommandBase; + +public class boutonY extends CommandBase { + /** Creates a new boutonY. */ + public boutonY() { + // 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() {} + + // Called once the command ends or is interrupted. + @Override + public void end(boolean interrupted) {} + + // Returns true when the command should end. + @Override + public boolean isFinished() { + return false; + } +} From 3bd6f484921bb2db5751fb39adecd5944357028a Mon Sep 17 00:00:00 2001 From: Antoine PerreaultE Date: Wed, 23 Nov 2022 18:41:35 -0500 Subject: [PATCH 09/10] g --- src/main/java/frc/robot/commands/BoutonA.java | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 src/main/java/frc/robot/commands/BoutonA.java diff --git a/src/main/java/frc/robot/commands/BoutonA.java b/src/main/java/frc/robot/commands/BoutonA.java new file mode 100644 index 0000000..5490290 --- /dev/null +++ b/src/main/java/frc/robot/commands/BoutonA.java @@ -0,0 +1,32 @@ +// 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.commands; + +import edu.wpi.first.wpilibj2.command.CommandBase; + +public class BoutonA extends CommandBase { + /** Creates a new boutonY. */ + public BoutonA() { + // 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() {} + + // Called once the command ends or is interrupted. + @Override + public void end(boolean interrupted) {} + + // Returns true when the command should end. + @Override + public boolean isFinished() { + return false; + } +} From d2f5238fdf52190cd385442b6d4e1ebf568cbeba Mon Sep 17 00:00:00 2001 From: Antoine PerreaultE Date: Wed, 23 Nov 2022 18:41:52 -0500 Subject: [PATCH 10/10] h --- src/main/java/frc/robot/commands/BoutonY.java | 32 ------------------- 1 file changed, 32 deletions(-) delete mode 100644 src/main/java/frc/robot/commands/BoutonY.java diff --git a/src/main/java/frc/robot/commands/BoutonY.java b/src/main/java/frc/robot/commands/BoutonY.java deleted file mode 100644 index 884458b..0000000 --- a/src/main/java/frc/robot/commands/BoutonY.java +++ /dev/null @@ -1,32 +0,0 @@ -// 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.commands; - -import edu.wpi.first.wpilibj2.command.CommandBase; - -public class boutonY extends CommandBase { - /** Creates a new boutonY. */ - public boutonY() { - // 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() {} - - // Called once the command ends or is interrupted. - @Override - public void end(boolean interrupted) {} - - // Returns true when the command should end. - @Override - public boolean isFinished() { - return false; - } -}