From 2ef438cf63970eba283cc3165141b2c3c927a792 Mon Sep 17 00:00:00 2001 From: Antoine PerreaultE Date: Mon, 4 Dec 2023 18:59:33 -0500 Subject: [PATCH 1/5] a --- src/main/java/frc/robot/RobotContainer.java | 6 ------ src/main/java/frc/robot/commands/Lancer.java | 8 ++++---- src/main/java/frc/robot/commands/Lancez.java | 2 +- 3 files changed, 5 insertions(+), 11 deletions(-) diff --git a/src/main/java/frc/robot/RobotContainer.java b/src/main/java/frc/robot/RobotContainer.java index 9b07d21..bc3e55f 100644 --- a/src/main/java/frc/robot/RobotContainer.java +++ b/src/main/java/frc/robot/RobotContainer.java @@ -16,12 +16,6 @@ import edu.wpi.first.wpilibj2.command.button.CommandJoystick; import edu.wpi.first.wpilibj2.command.button.CommandXboxController; import frc.robot.commands.Avancer; import frc.robot.commands.Lancer; -import frc.robot.commands.Force2; -import frc.robot.commands.Force3; -import frc.robot.commands.Force4; -import frc.robot.commands.Force5; -import frc.robot.commands.Force6; -import frc.robot.commands.Force7; import frc.robot.commands.Reculer; import frc.robot.commands.accumulateurtest; import frc.robot.subsystems.Accumulateur; diff --git a/src/main/java/frc/robot/commands/Lancer.java b/src/main/java/frc/robot/commands/Lancer.java index ebce965..f72cbf7 100644 --- a/src/main/java/frc/robot/commands/Lancer.java +++ b/src/main/java/frc/robot/commands/Lancer.java @@ -12,13 +12,13 @@ import frc.robot.subsystems.Accumulateur; import frc.robot.subsystems.Lanceur; public class Lancer extends ParallelCommandGroup { - private Lanceur lanceur; - private Accumulateur accumulateur; + // private Lanceur lanceur; + // private Accumulateur accumulateur; public Lancer(Lanceur lanceur,Accumulateur accumulateur,GenericEntry vitesse) { - this.lanceur = lanceur; - this.accumulateur = accumulateur; + // this.lanceur = lanceur; + // this.accumulateur = accumulateur; // Add your commands in the addCommands() call, e.g. // addCommands(new FooCommand(), new BarCommand()); diff --git a/src/main/java/frc/robot/commands/Lancez.java b/src/main/java/frc/robot/commands/Lancez.java index 23ce090..e45d955 100644 --- a/src/main/java/frc/robot/commands/Lancez.java +++ b/src/main/java/frc/robot/commands/Lancez.java @@ -19,7 +19,7 @@ public class Lancez extends CommandBase { // Called when the command is initially scheduled. @Override public void initialize() { - lanceur.setPID(0, 0, 0); + lanceur.setPID(0.19166, 0, 0); } // Called every time the scheduler runs while the command is scheduled. From 66ae081336cc0e32f87b17a516d32e57a7f8e0a9 Mon Sep 17 00:00:00 2001 From: OlivierDubois Date: Mon, 4 Dec 2023 19:13:58 -0500 Subject: [PATCH 2/5] dashboard2.0 --- src/main/java/frc/robot/subsystems/Lanceur.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/java/frc/robot/subsystems/Lanceur.java b/src/main/java/frc/robot/subsystems/Lanceur.java index 929fed9..34c64fd 100644 --- a/src/main/java/frc/robot/subsystems/Lanceur.java +++ b/src/main/java/frc/robot/subsystems/Lanceur.java @@ -15,11 +15,14 @@ import edu.wpi.first.wpilibj2.command.SubsystemBase; import frc.robot.Constants; public class Lanceur extends SubsystemBase { + ShuffleboardTab dash2 = Shuffleboard.getTab("Dashboard2.0"); + ShuffleboardTab dashboard = Shuffleboard.getTab("Dashboard"); ShuffleboardLayout pid = Shuffleboard.getTab("Dashboard") .getLayout("Pid", BuiltInLayouts.kList) .withSize(3, 7); public Lanceur(){ + dash2.add("test", 1); pid.add("p", 1); pid.add("i", 2); pid.add("d", 3); From 8c6d2c7269b8b20afcc727e3394df2fc27592814 Mon Sep 17 00:00:00 2001 From: OlivierDubois Date: Mon, 4 Dec 2023 19:45:15 -0500 Subject: [PATCH 3/5] dash test 3.0 --- src/main/java/frc/robot/subsystems/Lanceur.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/java/frc/robot/subsystems/Lanceur.java b/src/main/java/frc/robot/subsystems/Lanceur.java index 34c64fd..dddd1b3 100644 --- a/src/main/java/frc/robot/subsystems/Lanceur.java +++ b/src/main/java/frc/robot/subsystems/Lanceur.java @@ -18,14 +18,14 @@ public class Lanceur extends SubsystemBase { ShuffleboardTab dash2 = Shuffleboard.getTab("Dashboard2.0"); ShuffleboardTab dashboard = Shuffleboard.getTab("Dashboard"); - ShuffleboardLayout pid = Shuffleboard.getTab("Dashboard") - .getLayout("Pid", BuiltInLayouts.kList) - .withSize(3, 7); + //ShuffleboardLayout pid = Shuffleboard.getTab("Dashboard") + //.getLayout("Pid", BuiltInLayouts.kList) + //.withSize(3, 7); public Lanceur(){ dash2.add("test", 1); - pid.add("p", 1); - pid.add("i", 2); - pid.add("d", 3); + dashboard.add("p", 1); + dashboard.add("i", 2); + dashboard.add("d", 3); } final CANSparkMax lanceur = new CANSparkMax(Constants.lanceur, MotorType.kBrushless); From f8a525cbeb49dbf8e4998ce326fa788142975f26 Mon Sep 17 00:00:00 2001 From: Antoine PerreaultE Date: Mon, 4 Dec 2023 19:47:28 -0500 Subject: [PATCH 4/5] ghvnbm --- src/main/java/frc/robot/RobotContainer.java | 2 +- src/main/java/frc/robot/commands/Lancer.java | 3 ++- src/main/java/frc/robot/commands/LancerTest.java | 4 +++- src/main/java/frc/robot/commands/Lancez.java | 5 +++-- 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/main/java/frc/robot/RobotContainer.java b/src/main/java/frc/robot/RobotContainer.java index 9f25d03..9df979c 100644 --- a/src/main/java/frc/robot/RobotContainer.java +++ b/src/main/java/frc/robot/RobotContainer.java @@ -15,7 +15,7 @@ import edu.wpi.first.wpilibj2.command.SequentialCommandGroup; import edu.wpi.first.wpilibj2.command.button.CommandJoystick; import edu.wpi.first.wpilibj2.command.button.CommandXboxController; import frc.robot.commands.Avancer; -import frc.robot.commands.Lancer; +//import frc.robot.commands.Lancer; import frc.robot.commands.LancerTest; import frc.robot.commands.Force2; import frc.robot.commands.Force3; diff --git a/src/main/java/frc/robot/commands/Lancer.java b/src/main/java/frc/robot/commands/Lancer.java index f72cbf7..90c6fa8 100644 --- a/src/main/java/frc/robot/commands/Lancer.java +++ b/src/main/java/frc/robot/commands/Lancer.java @@ -1,7 +1,7 @@ // 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.networktables.GenericEntry; @@ -27,3 +27,4 @@ public class Lancer extends ParallelCommandGroup { new AccAvancer(accumulateur),new AccReculer(accumulateur)); } } +*/ \ No newline at end of file diff --git a/src/main/java/frc/robot/commands/LancerTest.java b/src/main/java/frc/robot/commands/LancerTest.java index 95eaeb0..3c8a6d4 100644 --- a/src/main/java/frc/robot/commands/LancerTest.java +++ b/src/main/java/frc/robot/commands/LancerTest.java @@ -18,7 +18,9 @@ public class LancerTest extends CommandBase { // Called when the command is initially scheduled. @Override - public void initialize() {} + public void initialize() { + lanceur.setPID(0.000000000000075572, 0, 0); + } // Called every time the scheduler runs while the command is scheduled. @Override diff --git a/src/main/java/frc/robot/commands/Lancez.java b/src/main/java/frc/robot/commands/Lancez.java index e45d955..ef3d3a7 100644 --- a/src/main/java/frc/robot/commands/Lancez.java +++ b/src/main/java/frc/robot/commands/Lancez.java @@ -1,7 +1,7 @@ // 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; @@ -9,7 +9,7 @@ import frc.robot.subsystems.Lanceur; public class Lancez extends CommandBase { private Lanceur lanceur; - /** Creates a new Lancez. */ + /** Creates a new Lancez. public Lancez(Lanceur lanceur) { this.lanceur = lanceur; addRequirements(lanceur); @@ -43,3 +43,4 @@ public class Lancez extends CommandBase { return false; } } +*/ \ No newline at end of file From 92325aebca6c9d3327089725c91da9d6c3ae93ab Mon Sep 17 00:00:00 2001 From: Antoine PerreaultE Date: Tue, 5 Dec 2023 18:16:33 -0500 Subject: [PATCH 5/5] =?UTF-8?q?Force=201=20=C3=A1=207?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/frc/robot/RobotContainer.java | 37 +++++++------- .../commands/{LancerTest.java => Force1.java} | 7 +-- src/main/java/frc/robot/commands/Force2.java | 22 ++------- src/main/java/frc/robot/commands/Force3.java | 48 +++++++------------ src/main/java/frc/robot/commands/Force4.java | 36 ++++---------- src/main/java/frc/robot/commands/Force5.java | 36 ++++---------- src/main/java/frc/robot/commands/Force6.java | 37 ++++---------- src/main/java/frc/robot/commands/Force7.java | 35 ++++---------- 8 files changed, 86 insertions(+), 172 deletions(-) rename src/main/java/frc/robot/commands/{LancerTest.java => Force1.java} (85%) diff --git a/src/main/java/frc/robot/RobotContainer.java b/src/main/java/frc/robot/RobotContainer.java index 9df979c..6e03240 100644 --- a/src/main/java/frc/robot/RobotContainer.java +++ b/src/main/java/frc/robot/RobotContainer.java @@ -11,12 +11,11 @@ import edu.wpi.first.wpilibj.shuffleboard.ShuffleboardLayout; import edu.wpi.first.wpilibj.shuffleboard.ShuffleboardTab; import edu.wpi.first.wpilibj2.command.Command; import edu.wpi.first.wpilibj2.command.RunCommand; -import edu.wpi.first.wpilibj2.command.SequentialCommandGroup; import edu.wpi.first.wpilibj2.command.button.CommandJoystick; import edu.wpi.first.wpilibj2.command.button.CommandXboxController; import frc.robot.commands.Avancer; +import frc.robot.commands.Force1; //import frc.robot.commands.Lancer; -import frc.robot.commands.LancerTest; import frc.robot.commands.Force2; import frc.robot.commands.Force3; import frc.robot.commands.Force4; @@ -61,21 +60,27 @@ public class RobotContainer { private void configureBindings() { accumulateurtest accumulateurtest = new accumulateurtest(accumulateur); - LancerTest lancertest = new LancerTest(lanceur); - // joystick1.button(7).onTrue(new Lancer(lanceur, accumulateur, force1)); - /* joystick1.button(8).onTrue(new Lancer(lanceur, accumulateur, force2)); - joystick1.button(9).onTrue(new Lancer(lanceur, accumulateur, force3)); - joystick1.button(10).onTrue(new Lancer(lanceur, accumulateur, force4)); - joystick1.button(11).onTrue(new Lancer(lanceur, accumulateur, force5)); - joystick1.button(12).onTrue(new Lancer(lanceur, accumulateur, force6));*/ - // joystick1.button(3).onTrue(new Lancer(lanceur, accumulateur, force7)); - joystick1.button(5).whileTrue(accumulateurtest); - joystick1.button(1).whileTrue(lancertest); - + Force1 Force1 = new Force1(lanceur, force1); + Force2 Force2 = new Force2(lanceur, force2); + Force3 Force3 = new Force3(lanceur, force3); + Force4 Force4 = new Force4(lanceur, force4); + Force5 Force5 = new Force5(lanceur, force5); + Force6 Force6 = new Force6(lanceur, force6); + Force7 Force7 = new Force7(lanceur, force7); + + //touche + + joystick1.button(3).whileTrue(accumulateurtest); + joystick1.button(1).whileTrue(Force1); + joystick1.button(7).whileTrue(Force2); + joystick1.button(8).whileTrue(Force3); + joystick1.button(9).whileTrue(Force4); + joystick1.button(10).whileTrue(Force5); + joystick1.button(11).whileTrue(Force6); + joystick1.button(12).whileTrue(Force7); } - - - public Command getAutonomousCommand() { + + public Command getAutonomousCommand() { return null; /* new SequentialCommandGroup(new Avancer(drive), new Force7(lanceur, force7, accumulateur) , new Lancer(lanceur, accumulateur, force1), new Reculer(drive)); diff --git a/src/main/java/frc/robot/commands/LancerTest.java b/src/main/java/frc/robot/commands/Force1.java similarity index 85% rename from src/main/java/frc/robot/commands/LancerTest.java rename to src/main/java/frc/robot/commands/Force1.java index 3c8a6d4..0241b5a 100644 --- a/src/main/java/frc/robot/commands/LancerTest.java +++ b/src/main/java/frc/robot/commands/Force1.java @@ -4,13 +4,14 @@ package frc.robot.commands; +import edu.wpi.first.networktables.GenericEntry; import edu.wpi.first.wpilibj2.command.CommandBase; import frc.robot.subsystems.Lanceur; -public class LancerTest extends CommandBase { +public class Force1 extends CommandBase { private Lanceur lanceur; /** Creates a new LancerTest. */ - public LancerTest(Lanceur lanceur) { + public Force1(Lanceur lanceur, GenericEntry force1) { this.lanceur = lanceur; addRequirements(lanceur); // Use addRequirements() here to declare subsystem dependencies. @@ -25,7 +26,7 @@ public class LancerTest extends CommandBase { // Called every time the scheduler runs while the command is scheduled. @Override public void execute() { - lanceur.lancer(0.5); + lanceur.lancer(0.3); } // Called once the command ends or is interrupted. diff --git a/src/main/java/frc/robot/commands/Force2.java b/src/main/java/frc/robot/commands/Force2.java index ea8564c..b8c46bc 100644 --- a/src/main/java/frc/robot/commands/Force2.java +++ b/src/main/java/frc/robot/commands/Force2.java @@ -6,39 +6,27 @@ package frc.robot.commands; import edu.wpi.first.networktables.GenericEntry; import edu.wpi.first.wpilibj2.command.CommandBase; -import frc.robot.subsystems.Accumulateur; import frc.robot.subsystems.Lanceur; public class Force2 extends CommandBase { private Lanceur lanceur; - private Accumulateur accumulateur; - GenericEntry force2; - /** Creates a new Force1. */ - public Force2(Lanceur lanceur,Accumulateur accumulateur, GenericEntry force2) { + /** Creates a new LancerTest. */ + public Force2(Lanceur lanceur, GenericEntry force2) { this.lanceur = lanceur; - this.accumulateur = accumulateur; - addRequirements(lanceur, accumulateur); - this.force2 = force2; + addRequirements(lanceur); // Use addRequirements() here to declare subsystem dependencies. } // Called when the command is initially scheduled. @Override public void initialize() { - lanceur.setPID(0,0,0); + lanceur.setPID(0.000000000000075572, 0, 0); } // Called every time the scheduler runs while the command is scheduled. @Override public void execute() { - double vitesse = (200); - lanceur.lancer(force2.getDouble(200)); - if (lanceur.vitesse() > vitesse ){ - accumulateur.tourneavant(); - accumulateur.tournearriere(); - } else { - accumulateur.stop(); - } + lanceur.lancer(0.35); } // Called once the command ends or is interrupted. diff --git a/src/main/java/frc/robot/commands/Force3.java b/src/main/java/frc/robot/commands/Force3.java index 4c1e363..5e1607e 100644 --- a/src/main/java/frc/robot/commands/Force3.java +++ b/src/main/java/frc/robot/commands/Force3.java @@ -2,54 +2,42 @@ // 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. -// 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 frc.robot.subsystems.Accumulateur; - import edu.wpi.first.networktables.GenericEntry; import edu.wpi.first.wpilibj2.command.CommandBase; import frc.robot.subsystems.Lanceur; public class Force3 extends CommandBase { - private Lanceur lanceur; - private Accumulateur accumulateur; - GenericEntry force3; - - /** Creates a new Force1. */ - public Force3(Lanceur lanceur,GenericEntry force3, Accumulateur accumulateur) { + /** Creates a new LancerTest. */ + public Force3(Lanceur lanceur, GenericEntry force3) { this.lanceur = lanceur; - addRequirements(lanceur, accumulateur); - this.force3 = force3; - this.accumulateur = accumulateur; + addRequirements(lanceur); // Use addRequirements() here to declare subsystem dependencies. } // Called when the command is initially scheduled. @Override public void initialize() { - lanceur.setPID(0, 0, 0); + lanceur.setPID(0.000000000000075572, 0, 0); } // Called every time the scheduler runs while the command is scheduled. @Override public void execute() { - - double vitesse = (300); - lanceur.lancer(force3.getDouble(300)); - if (lanceur.vitesse() > vitesse ){ - accumulateur.tourneavant(); - accumulateur.tournearriere(); - } else { - accumulateur.stop(); - } - } - @Override - public boolean isFinished() { - return false; - } + lanceur.lancer(0.4); } + + // Called once the command ends or is interrupted. + @Override + public void end(boolean interrupted) { + lanceur.lancer(0); + } + + // Returns true when the command should end. + @Override + public boolean isFinished() { + return false; + } +} diff --git a/src/main/java/frc/robot/commands/Force4.java b/src/main/java/frc/robot/commands/Force4.java index 1c3ed02..94e1726 100644 --- a/src/main/java/frc/robot/commands/Force4.java +++ b/src/main/java/frc/robot/commands/Force4.java @@ -3,59 +3,41 @@ // the WPILib BSD license file in the root directory of this project. package frc.robot.commands; -import frc.robot.subsystems.Accumulateur; - import edu.wpi.first.networktables.GenericEntry; import edu.wpi.first.wpilibj2.command.CommandBase; import frc.robot.subsystems.Lanceur; public class Force4 extends CommandBase { - private Lanceur lanceur; - private Accumulateur accumulateur; - GenericEntry force4; - - /** Creates a new Force1. */ - public Force4(Lanceur lanceur,GenericEntry force4, Accumulateur accumulateur) { + /** Creates a new LancerTest. */ + public Force4(Lanceur lanceur, GenericEntry force4) { this.lanceur = lanceur; - addRequirements(lanceur, accumulateur); - this.force4 = force4; - this.accumulateur = accumulateur; + addRequirements(lanceur); // Use addRequirements() here to declare subsystem dependencies. } // Called when the command is initially scheduled. @Override public void initialize() { - lanceur.setPID(0, 0, 0); + lanceur.setPID(0.000000000000075572, 0, 0); } // Called every time the scheduler runs while the command is scheduled. @Override public void execute() { - double vitesse = (400); - lanceur.lancer(force4.getDouble(400)); - if (lanceur.vitesse() > vitesse ){ - accumulateur.tourneavant(); - accumulateur.tournearriere(); - } else { - accumulateur.stop(); - } - - + lanceur.lancer(0.45); } // Called once the command ends or is interrupted. @Override public void end(boolean interrupted) { - lanceur.stop(); - accumulateur.stop(); - } + lanceur.lancer(0); + } // Returns true when the command should end. @Override public boolean isFinished() { - return lanceur.distance()>1; + return false; } -} \ No newline at end of file +} diff --git a/src/main/java/frc/robot/commands/Force5.java b/src/main/java/frc/robot/commands/Force5.java index f9612a6..f686549 100644 --- a/src/main/java/frc/robot/commands/Force5.java +++ b/src/main/java/frc/robot/commands/Force5.java @@ -3,59 +3,41 @@ // the WPILib BSD license file in the root directory of this project. package frc.robot.commands; -import frc.robot.subsystems.Accumulateur; - import edu.wpi.first.networktables.GenericEntry; import edu.wpi.first.wpilibj2.command.CommandBase; import frc.robot.subsystems.Lanceur; public class Force5 extends CommandBase { - private Lanceur lanceur; - private Accumulateur accumulateur; - GenericEntry force5; - - /** Creates a new Force1. */ - public Force5(Lanceur lanceur,GenericEntry force5, Accumulateur accumulateur) { + /** Creates a new LancerTest. */ + public Force5(Lanceur lanceur, GenericEntry force5) { this.lanceur = lanceur; - addRequirements(lanceur, accumulateur); - this.force5 = force5; - this.accumulateur = accumulateur; + addRequirements(lanceur); // Use addRequirements() here to declare subsystem dependencies. } // Called when the command is initially scheduled. @Override public void initialize() { - lanceur.setPID(0, 0, 0); + lanceur.setPID(0.000000000000075572, 0, 0); } // Called every time the scheduler runs while the command is scheduled. @Override public void execute() { - double vitesse = (500); - lanceur.lancer(force5.getDouble(500)); - if (lanceur.vitesse() > vitesse ){ - accumulateur.tourneavant(); - accumulateur.tournearriere(); - } else { - accumulateur.stop(); - } - - + lanceur.lancer(0.5); } // Called once the command ends or is interrupted. @Override public void end(boolean interrupted) { - lanceur.stop(); - accumulateur.stop(); - } + lanceur.lancer(0); + } // Returns true when the command should end. @Override public boolean isFinished() { - return lanceur.distance()>1; + return false; } -} \ No newline at end of file +} diff --git a/src/main/java/frc/robot/commands/Force6.java b/src/main/java/frc/robot/commands/Force6.java index 2305577..9d8a2e6 100644 --- a/src/main/java/frc/robot/commands/Force6.java +++ b/src/main/java/frc/robot/commands/Force6.java @@ -3,58 +3,41 @@ // the WPILib BSD license file in the root directory of this project. package frc.robot.commands; -import frc.robot.subsystems.Accumulateur; + import edu.wpi.first.networktables.GenericEntry; import edu.wpi.first.wpilibj2.command.CommandBase; import frc.robot.subsystems.Lanceur; public class Force6 extends CommandBase { - private Lanceur lanceur; - private Accumulateur accumulateur; - GenericEntry force6; - - - /** Creates a new Force1. */ - public Force6(Lanceur lanceur, GenericEntry force6, Accumulateur accumulateur) { + /** Creates a new LancerTest. */ + public Force6(Lanceur lanceur, GenericEntry force6) { this.lanceur = lanceur; - addRequirements(lanceur, accumulateur); - this.force6 = force6; - this.accumulateur = accumulateur; + addRequirements(lanceur); // Use addRequirements() here to declare subsystem dependencies. } // Called when the command is initially scheduled. @Override public void initialize() { - lanceur.setPID(0, 0, 0); + lanceur.setPID(0.000000000000075572, 0, 0); } // Called every time the scheduler runs while the command is scheduled. @Override public void execute() { - double vitesse = (600); - lanceur.lancer(force6.getDouble(600)); - if (lanceur.vitesse() > vitesse ){ - accumulateur.tourneavant(); - accumulateur.tournearriere(); - } else { - accumulateur.stop(); - } - - + lanceur.lancer(0.55); } // Called once the command ends or is interrupted. @Override public void end(boolean interrupted) { - lanceur.stop(); - accumulateur.stop(); - } + lanceur.lancer(0); + } // Returns true when the command should end. @Override public boolean isFinished() { - return lanceur.distance()>1; + return false; } -} \ No newline at end of file +} diff --git a/src/main/java/frc/robot/commands/Force7.java b/src/main/java/frc/robot/commands/Force7.java index 034f228..05c9468 100644 --- a/src/main/java/frc/robot/commands/Force7.java +++ b/src/main/java/frc/robot/commands/Force7.java @@ -3,56 +3,41 @@ // the WPILib BSD license file in the root directory of this project. package frc.robot.commands; -import frc.robot.subsystems.Accumulateur; + import edu.wpi.first.networktables.GenericEntry; import edu.wpi.first.wpilibj2.command.CommandBase; import frc.robot.subsystems.Lanceur; public class Force7 extends CommandBase { - private Lanceur lanceur; - private Accumulateur accumulateur; - GenericEntry force7; - - /** Creates a new Force1. */ - public Force7(Lanceur lanceur,GenericEntry force7, Accumulateur accumulateur) { + /** Creates a new LancerTest. */ + public Force7(Lanceur lanceur, GenericEntry force7) { this.lanceur = lanceur; - addRequirements(lanceur, accumulateur); - this.force7 = force7; - this.accumulateur = accumulateur; + addRequirements(lanceur); // Use addRequirements() here to declare subsystem dependencies. } // Called when the command is initially scheduled. @Override public void initialize() { - lanceur.setPID(0, 0, 0); + lanceur.setPID(0.000000000000075572, 0, 0); } // Called every time the scheduler runs while the command is scheduled. @Override public void execute() { - double vitesse = (700); - lanceur.lancer(force7.getDouble(700)); - if (lanceur.vitesse() > vitesse ){ - accumulateur.tourneavant(); - accumulateur.tournearriere(); - } else { - accumulateur.stop(); - } - + lanceur.lancer(0.6); } // Called once the command ends or is interrupted. @Override public void end(boolean interrupted) { - lanceur.stop(); - accumulateur.stop(); - } + lanceur.lancer(0); + } // Returns true when the command should end. @Override public boolean isFinished() { - return lanceur.distance()>1; + return false; } -} \ No newline at end of file +}