This commit is contained in:
2024-11-13 19:52:11 -05:00
4 changed files with 28 additions and 6 deletions

View File

@ -27,10 +27,13 @@ public class FollowAprilTag extends Command {
@Override
public void execute() {
if (enlignement.getv()==1)
{
lanceur.tourelRotation(0,0, enlignement.getx()/30);
}
if (lanceur.limitswitch1() || lanceur.limitswitch2()){
lanceur.lance(0);}
else
{
lanceur.tourelRotation(0, 0, 0);

View File

@ -4,14 +4,18 @@
package frc.robot.Commands;
import edu.wpi.first.wpilibj2.command.Command;
import edu.wpi.first.wpilibj2.command.WaitCommand;
import frc.robot.Subsystems.Accumulateur;
import frc.robot.Subsystems.Lanceur;
public class Lancer extends Command {
private Lanceur lanceur;
private Accumulateur accumulateur;
/** Creates a new Lancer. */
public Lancer(Lanceur lanceur) {
public Lancer(Lanceur lanceur,Accumulateur accumulateur) {
this.lanceur = lanceur;
addRequirements(lanceur);
this.accumulateur = accumulateur;
addRequirements(lanceur, accumulateur);
// Use addRequirements() here to declare subsystem dependencies.
}
// Called when the command is initially scheduled.
@ -22,7 +26,12 @@ public class Lancer extends Command {
// Called every time the scheduler runs while the command is scheduled.
@Override
public void execute() {
lanceur.lance(0.5);
lanceur.lance();
accumulateur.Petitlanceur(0.7);
accumulateur.desaccumule(0.2);
}
// Called once the command ends or is interrupted.
@Override