diff --git a/src/main/java/frc/robot/RobotContainer.java b/src/main/java/frc/robot/RobotContainer.java index 8d9b156..e0d7d25 100644 --- a/src/main/java/frc/robot/RobotContainer.java +++ b/src/main/java/frc/robot/RobotContainer.java @@ -36,7 +36,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", 2).getEntry(); GenericEntry force2 = forces.add("Force2", 0).getEntry(); @@ -76,3 +76,5 @@ public class RobotContainer { , new Lancer(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));*/ diff --git a/src/main/java/frc/robot/commands/Avancer.java b/src/main/java/frc/robot/commands/Avancer.java index 476601e..c0ee5c7 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("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/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. diff --git a/src/main/java/frc/robot/commands/Lancez.java b/src/main/java/frc/robot/commands/Lancez.java index 18b4433..029a806 100644 --- a/src/main/java/frc/robot/commands/Lancez.java +++ b/src/main/java/frc/robot/commands/Lancez.java @@ -28,6 +28,9 @@ public class Lancez extends CommandBase { public void execute() { lanceur.lancer(0); } + + + // Called once the command ends or is interrupted. @Override diff --git a/src/main/java/frc/robot/commands/Reculer.java b/src/main/java/frc/robot/commands/Reculer.java index 9d67460..b0303ab 100644 --- a/src/main/java/frc/robot/commands/Reculer.java +++ b/src/main/java/frc/robot/commands/Reculer.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 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("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. 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){