This commit is contained in:
Olivier Dubois 2023-12-02 10:15:03 -05:00
commit 5ba5694ea8
4 changed files with 90 additions and 5 deletions

View File

@ -23,6 +23,7 @@ import frc.robot.commands.Force5;
import frc.robot.commands.Force6; import frc.robot.commands.Force6;
import frc.robot.commands.Force7; import frc.robot.commands.Force7;
import frc.robot.commands.Reculer; import frc.robot.commands.Reculer;
import frc.robot.commands.accumulateurtest;
import frc.robot.subsystems.Accumulateur; import frc.robot.subsystems.Accumulateur;
import frc.robot.subsystems.Drive; import frc.robot.subsystems.Drive;
import frc.robot.subsystems.Lanceur; import frc.robot.subsystems.Lanceur;
@ -64,6 +65,7 @@ public class RobotContainer {
Force5 Force5 = new Force5(lanceur, null, accumulateur); Force5 Force5 = new Force5(lanceur, null, accumulateur);
Force6 Force6 = new Force6(lanceur, null, accumulateur); Force6 Force6 = new Force6(lanceur, null, accumulateur);
Force7 Force7 = new Force7(lanceur, null, accumulateur); Force7 Force7 = new Force7(lanceur, null, accumulateur);
accumulateurtest accumulateurtest = new accumulateurtest(accumulateur);
joystick1.button(7).onTrue(Force1); joystick1.button(7).onTrue(Force1);
joystick1.button(8).onTrue(Force2); joystick1.button(8).onTrue(Force2);
joystick1.button(9).onTrue(Force3); joystick1.button(9).onTrue(Force3);
@ -71,7 +73,7 @@ public class RobotContainer {
joystick1.button(11).onTrue(Force5); joystick1.button(11).onTrue(Force5);
joystick1.button(12).onTrue(Force6); joystick1.button(12).onTrue(Force6);
joystick1.button(3).onTrue(Force7); joystick1.button(3).onTrue(Force7);
joystick1.button(5).toggleOnTrue(accumulateurtest);
} }

View File

@ -37,17 +37,24 @@ public class Force1 extends CommandBase {
double vitesse = (100); double vitesse = (100);
if (lanceur.vitesse() > vitesse ){ if (lanceur.vitesse() > vitesse ){
accumulateur.tourneavant(); accumulateur.tourneavant();
accumulateur.tournearriere(); accumulateur.Deaccumuler();
} else { if(accumulateur.tourneavant()>1024) {
accumulateur.stop(); accumulateur.tournearriere();
accumulateur.reaccumuler();
} }
} if(accumulateur.tournearriere()>-256){
accumulateur.stop();
}
}}
// Called once the command ends or is interrupted. // Called once the command ends or is interrupted.
@Override @Override
public void end(boolean interrupted) { public void end(boolean interrupted) {
lanceur.lancer(0); lanceur.lancer(0);
accumulateur.stop();
} }
// Returns true when the command should end. // Returns true when the command should end.

View File

@ -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;
}
}

View File

@ -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"
]
}
]
}