From 341581e04618bd66f0ca0f175cc84b9b6f67425b Mon Sep 17 00:00:00 2001 From: Antoine PerreaultE Date: Sat, 2 Dec 2023 10:13:09 -0500 Subject: [PATCH 1/6] changement --- src/main/java/frc/robot/commands/Force1.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/java/frc/robot/commands/Force1.java b/src/main/java/frc/robot/commands/Force1.java index 7b3cb09..78ccfd6 100644 --- a/src/main/java/frc/robot/commands/Force1.java +++ b/src/main/java/frc/robot/commands/Force1.java @@ -37,8 +37,10 @@ public class Force1 extends CommandBase { double vitesse = (100); if (lanceur.vitesse() > vitesse ){ accumulateur.tourneavant(); + accumulateur.Deaccumuler(); if(accumulateur.tourneavant()>1024) { accumulateur.tournearriere(); + accumulateur.reaccumuler(); } if(accumulateur.tournearriere()>-256){ accumulateur.stop(); From b7f5e39d17ace10f24f447d8c46a62d9f4d165d9 Mon Sep 17 00:00:00 2001 From: OlivierDubois Date: Sat, 2 Dec 2023 10:14:54 -0500 Subject: [PATCH 2/6] dash :( --- 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 0ee7bdb..906fbfe 100644 --- a/src/main/java/frc/robot/RobotContainer.java +++ b/src/main/java/frc/robot/RobotContainer.java @@ -35,7 +35,7 @@ public class RobotContainer { ShuffleboardTab dashboard = Shuffleboard.getTab("Dashboard"); ShuffleboardLayout forces = Shuffleboard.getTab("Dashboard") - .getLayout("Dashboard", BuiltInLayouts.kList) + .getLayout("forces", BuiltInLayouts.kList) .withSize(3, 7); GenericEntry force1 = forces.add("Force1", 0).getEntry(); GenericEntry force2 = forces.add("Force2", 0).getEntry(); From f53490a1cdef5602a9a432fafde6cb44d1b2f45c Mon Sep 17 00:00:00 2001 From: OlivierDubois Date: Sat, 2 Dec 2023 11:05:18 -0500 Subject: [PATCH 3/6] uhuhhhhhhhh --- src/main/java/frc/robot/commands/Force4.java | 2 +- src/main/java/frc/robot/commands/Force5.java | 2 +- src/main/java/frc/robot/commands/Force6.java | 2 +- src/main/java/frc/robot/commands/Force7.java | 1 - 4 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/main/java/frc/robot/commands/Force4.java b/src/main/java/frc/robot/commands/Force4.java index 8658cfc..1c3ed02 100644 --- a/src/main/java/frc/robot/commands/Force4.java +++ b/src/main/java/frc/robot/commands/Force4.java @@ -43,7 +43,7 @@ public class Force4 extends CommandBase { accumulateur.stop(); } - lanceur.lancer(force4.getDouble(0)); + } // Called once the command ends or is interrupted. diff --git a/src/main/java/frc/robot/commands/Force5.java b/src/main/java/frc/robot/commands/Force5.java index 1354f81..f9612a6 100644 --- a/src/main/java/frc/robot/commands/Force5.java +++ b/src/main/java/frc/robot/commands/Force5.java @@ -43,7 +43,7 @@ public class Force5 extends CommandBase { accumulateur.stop(); } - lanceur.lancer(force5.getDouble(0)); + } // Called once the command ends or is interrupted. diff --git a/src/main/java/frc/robot/commands/Force6.java b/src/main/java/frc/robot/commands/Force6.java index 6655df4..2305577 100644 --- a/src/main/java/frc/robot/commands/Force6.java +++ b/src/main/java/frc/robot/commands/Force6.java @@ -42,7 +42,7 @@ public class Force6 extends CommandBase { accumulateur.stop(); } - lanceur.lancer(force6.getDouble(0)); + } // Called once the command ends or is interrupted. diff --git a/src/main/java/frc/robot/commands/Force7.java b/src/main/java/frc/robot/commands/Force7.java index b1ba4cc..034f228 100644 --- a/src/main/java/frc/robot/commands/Force7.java +++ b/src/main/java/frc/robot/commands/Force7.java @@ -41,7 +41,6 @@ public class Force7 extends CommandBase { accumulateur.stop(); } - lanceur.lancer(force7.getDouble(0)); } // Called once the command ends or is interrupted. From 3e483c1b17d768d234ef2a6b803999b1b22062ce Mon Sep 17 00:00:00 2001 From: Antoine PerreaultE Date: Sat, 2 Dec 2023 11:20:25 -0500 Subject: [PATCH 4/6] j --- src/main/java/frc/robot/RobotContainer.java | 8 ++++---- src/main/java/frc/robot/commands/Force1.java | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/java/frc/robot/RobotContainer.java b/src/main/java/frc/robot/RobotContainer.java index 08ea78e..4dbf80d 100644 --- a/src/main/java/frc/robot/RobotContainer.java +++ b/src/main/java/frc/robot/RobotContainer.java @@ -78,7 +78,7 @@ public class RobotContainer { } public Command getAutonomousCommand() { - return new SequentialCommandGroup(new Avancer(drive), new Force7(lanceur, force7, accumulateur) - , new Force1(lanceur, accumulateur, force1), new Reculer(drive)); - } -} + /* return new SequentialCommandGroup(new Avancer(drive), new Force7(lanceur, force7, accumulateur) + , new Force1(lanceur, accumulateur, force1), new Reculer(drive));*/ + return null;} +} \ No newline at end of file diff --git a/src/main/java/frc/robot/commands/Force1.java b/src/main/java/frc/robot/commands/Force1.java index 78ccfd6..b863e74 100644 --- a/src/main/java/frc/robot/commands/Force1.java +++ b/src/main/java/frc/robot/commands/Force1.java @@ -42,7 +42,7 @@ public class Force1 extends CommandBase { accumulateur.tournearriere(); accumulateur.reaccumuler(); } - if(accumulateur.tournearriere()>-256){ + if(accumulateur.tournearriere()<-256){ accumulateur.stop(); } }} From e665ff63b76b4b6dd6983f6e5c33e0245ecb4128 Mon Sep 17 00:00:00 2001 From: OlivierDubois Date: Sat, 2 Dec 2023 11:33:28 -0500 Subject: [PATCH 5/6] mettre des choses dans le Dashboard --- src/main/java/frc/robot/commands/Avancer.java | 12 ++++++++++++ src/main/java/frc/robot/commands/Reculer.java | 11 +++++++++++ src/main/java/frc/robot/subsystems/Lanceur.java | 15 +++++++++++++-- 3 files changed, 36 insertions(+), 2 deletions(-) diff --git a/src/main/java/frc/robot/commands/Avancer.java b/src/main/java/frc/robot/commands/Avancer.java index 476601e..69e0047 100644 --- a/src/main/java/frc/robot/commands/Avancer.java +++ b/src/main/java/frc/robot/commands/Avancer.java @@ -4,13 +4,25 @@ package frc.robot.commands; +import edu.wpi.first.wpilibj.shuffleboard.BuiltInLayouts; +import edu.wpi.first.wpilibj.shuffleboard.Shuffleboard; +import edu.wpi.first.wpilibj.shuffleboard.ShuffleboardLayout; +import edu.wpi.first.wpilibj.shuffleboard.ShuffleboardTab; import edu.wpi.first.wpilibj2.command.CommandBase; import frc.robot.subsystems.Drive; public class Avancer extends CommandBase { private Drive drive; + ShuffleboardTab dashboard = Shuffleboard.getTab("Dashboard"); + ShuffleboardLayout avancer = Shuffleboard.getTab("Dashboard") + .getLayout("Avancer", BuiltInLayouts.kList) + .withSize(3, 3); /** Creates a new Avancer. */ public Avancer(Drive drive) { + avancer.add("x", 1); + avancer.add("y", 2); + avancer.add("z", 3); + this.drive = drive; addRequirements(drive); // Use addRequirements() here to declare subsystem dependencies. diff --git a/src/main/java/frc/robot/commands/Reculer.java b/src/main/java/frc/robot/commands/Reculer.java index 9d67460..a075f23 100644 --- a/src/main/java/frc/robot/commands/Reculer.java +++ b/src/main/java/frc/robot/commands/Reculer.java @@ -4,13 +4,24 @@ package frc.robot.commands; +import edu.wpi.first.wpilibj.shuffleboard.BuiltInLayouts; +import edu.wpi.first.wpilibj.shuffleboard.Shuffleboard; +import edu.wpi.first.wpilibj.shuffleboard.ShuffleboardLayout; +import edu.wpi.first.wpilibj.shuffleboard.ShuffleboardTab; import edu.wpi.first.wpilibj2.command.CommandBase; import frc.robot.subsystems.Drive; public class Reculer extends CommandBase { private Drive drive; + ShuffleboardTab dashboard = Shuffleboard.getTab("Dashboard"); + ShuffleboardLayout reculer = Shuffleboard.getTab("Dashboard") + .getLayout("Reculer", BuiltInLayouts.kList) + .withSize(3, 3); /** Creates a new Reculer. */ public Reculer(Drive drive) { + reculer.add("x", 1); + reculer.add("y", 2); + reculer.add("z", 3); this.drive = drive; addRequirements(drive); // Use addRequirements() here to declare subsystem dependencies. diff --git a/src/main/java/frc/robot/subsystems/Lanceur.java b/src/main/java/frc/robot/subsystems/Lanceur.java index 1a26f5f..929fed9 100644 --- a/src/main/java/frc/robot/subsystems/Lanceur.java +++ b/src/main/java/frc/robot/subsystems/Lanceur.java @@ -7,12 +7,23 @@ package frc.robot.subsystems; import com.revrobotics.CANSparkMax; import com.revrobotics.CANSparkMaxLowLevel.MotorType; +import edu.wpi.first.wpilibj.shuffleboard.BuiltInLayouts; +import edu.wpi.first.wpilibj.shuffleboard.Shuffleboard; +import edu.wpi.first.wpilibj.shuffleboard.ShuffleboardLayout; +import edu.wpi.first.wpilibj.shuffleboard.ShuffleboardTab; import edu.wpi.first.wpilibj2.command.SubsystemBase; import frc.robot.Constants; public class Lanceur extends SubsystemBase { - - public Lanceur(){} + ShuffleboardTab dashboard = Shuffleboard.getTab("Dashboard"); + ShuffleboardLayout pid = Shuffleboard.getTab("Dashboard") + .getLayout("Pid", BuiltInLayouts.kList) + .withSize(3, 7); + public Lanceur(){ + pid.add("p", 1); + pid.add("i", 2); + pid.add("d", 3); + } final CANSparkMax lanceur = new CANSparkMax(Constants.lanceur, MotorType.kBrushless); public void lancer(double vitesse){ From 134460f2e2bd51e06a0a4ebeb3152c00b0883f0f Mon Sep 17 00:00:00 2001 From: OlivierDubois Date: Sat, 2 Dec 2023 11:46:36 -0500 Subject: [PATCH 6/6] dAAAAAAAAAAsh --- src/main/java/frc/robot/commands/Avancer.java | 8 ++++---- src/main/java/frc/robot/commands/Reculer.java | 7 ++++--- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/main/java/frc/robot/commands/Avancer.java b/src/main/java/frc/robot/commands/Avancer.java index 69e0047..c0ee5c7 100644 --- a/src/main/java/frc/robot/commands/Avancer.java +++ b/src/main/java/frc/robot/commands/Avancer.java @@ -19,10 +19,10 @@ public class Avancer extends CommandBase { .withSize(3, 3); /** Creates a new Avancer. */ public Avancer(Drive drive) { - avancer.add("x", 1); - avancer.add("y", 2); - avancer.add("z", 3); - + avancer.add("vitesse x", 1); + avancer.add("vitesse y", 2); + avancer.add("vitesse z", 3); + avancer.add("distance", 4); this.drive = drive; addRequirements(drive); // Use addRequirements() here to declare subsystem dependencies. diff --git a/src/main/java/frc/robot/commands/Reculer.java b/src/main/java/frc/robot/commands/Reculer.java index a075f23..b0303ab 100644 --- a/src/main/java/frc/robot/commands/Reculer.java +++ b/src/main/java/frc/robot/commands/Reculer.java @@ -19,9 +19,10 @@ public class Reculer extends CommandBase { .withSize(3, 3); /** Creates a new Reculer. */ public Reculer(Drive drive) { - reculer.add("x", 1); - reculer.add("y", 2); - reculer.add("z", 3); + reculer.add("vitesse x", 1); + reculer.add("vitesse y", 2); + reculer.add("vitesse z", 3); + reculer.add("distance", 4); this.drive = drive; addRequirements(drive); // Use addRequirements() here to declare subsystem dependencies.