diff --git a/src/main/java/frc/robot/RobotContainer.java b/src/main/java/frc/robot/RobotContainer.java index 906fbfe..08ea78e 100644 --- a/src/main/java/frc/robot/RobotContainer.java +++ b/src/main/java/frc/robot/RobotContainer.java @@ -23,6 +23,7 @@ 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; import frc.robot.subsystems.Drive; import frc.robot.subsystems.Lanceur; @@ -64,6 +65,7 @@ public class RobotContainer { Force5 Force5 = new Force5(lanceur, null, accumulateur); Force6 Force6 = new Force6(lanceur, null, accumulateur); Force7 Force7 = new Force7(lanceur, null, accumulateur); + accumulateurtest accumulateurtest = new accumulateurtest(accumulateur); joystick1.button(7).onTrue(Force1); joystick1.button(8).onTrue(Force2); joystick1.button(9).onTrue(Force3); @@ -71,7 +73,7 @@ public class RobotContainer { joystick1.button(11).onTrue(Force5); joystick1.button(12).onTrue(Force6); joystick1.button(3).onTrue(Force7); - + joystick1.button(5).toggleOnTrue(accumulateurtest); } diff --git a/src/main/java/frc/robot/commands/Force1.java b/src/main/java/frc/robot/commands/Force1.java index 8d4e567..78ccfd6 100644 --- a/src/main/java/frc/robot/commands/Force1.java +++ b/src/main/java/frc/robot/commands/Force1.java @@ -37,17 +37,24 @@ public class Force1 extends CommandBase { double vitesse = (100); if (lanceur.vitesse() > vitesse ){ accumulateur.tourneavant(); - accumulateur.tournearriere(); - } else { - accumulateur.stop(); + accumulateur.Deaccumuler(); + if(accumulateur.tourneavant()>1024) { + accumulateur.tournearriere(); + accumulateur.reaccumuler(); } - } + if(accumulateur.tournearriere()>-256){ + accumulateur.stop(); + } + }} + + // Called once the command ends or is interrupted. @Override public void end(boolean interrupted) { lanceur.lancer(0); + accumulateur.stop(); } // Returns true when the command should end. diff --git a/src/main/java/frc/robot/commands/accumulateurtest.java b/src/main/java/frc/robot/commands/accumulateurtest.java new file mode 100644 index 0000000..3701643 --- /dev/null +++ b/src/main/java/frc/robot/commands/accumulateurtest.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.Accumulateur; + +public class accumulateurtest extends CommandBase { + private Accumulateur accumulateur; + /** Creates a new accumulateurtest. */ + public accumulateurtest(Accumulateur accumulateur) { + this.accumulateur = accumulateur; + addRequirements(accumulateur); + // 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() { + accumulateur.reaccumuler(); + } + + // Called once the command ends or is interrupted. + @Override + public void end(boolean interrupted) { + accumulateur.stop(); + } + + // Returns true when the command should end. + @Override + public boolean isFinished() { + return false; + } +} diff --git a/vendordeps/PathplannerLib2023.json b/vendordeps/PathplannerLib2023.json new file mode 100644 index 0000000..51cdc33 --- /dev/null +++ b/vendordeps/PathplannerLib2023.json @@ -0,0 +1,36 @@ +{ + "fileName": "PathplannerLib2023.json", + "name": "PathplannerLib", + "version": "2023.4.4", + "uuid": "1b42324f-17c6-4875-8e77-1c312bc8c786", + "frcYear": "2023", + "mavenUrls": [ + "https://3015rangerrobotics.github.io/pathplannerlib/repo" + ], + "jsonUrl": "https://3015rangerrobotics.github.io/pathplannerlib/PathplannerLib2023.json", + "javaDependencies": [ + { + "groupId": "com.pathplanner.lib", + "artifactId": "PathplannerLib-java", + "version": "2023.4.4" + } + ], + "jniDependencies": [], + "cppDependencies": [ + { + "groupId": "com.pathplanner.lib", + "artifactId": "PathplannerLib-cpp", + "version": "2023.4.4", + "libName": "PathplannerLib", + "headerClassifier": "headers", + "sharedLibrary": false, + "skipInvalidPlatforms": true, + "binaryPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "osxuniversal", + "linuxathena" + ] + } + ] +} \ No newline at end of file