Limelight
This commit is contained in:
parent
fb12e88940
commit
039f8f5392
@ -9,14 +9,17 @@ package frc.robot.command;
|
|||||||
import edu.wpi.first.wpilibj2.command.Command;
|
import edu.wpi.first.wpilibj2.command.Command;
|
||||||
|
|
||||||
import frc.robot.subsystem.Lanceur;
|
import frc.robot.subsystem.Lanceur;
|
||||||
|
import frc.robot.subsystem.Limelight;
|
||||||
|
|
||||||
public class Lancer extends Command {
|
public class Lancer extends Command {
|
||||||
/** Creates a new Lanceur. */
|
/** Creates a new Lanceur. */
|
||||||
|
private Limelight limelight;
|
||||||
private Lanceur lanceur;
|
private Lanceur lanceur;
|
||||||
public Lancer(Lanceur lanceur) {
|
public Lancer(Lanceur lanceur,Limelight limelight) {
|
||||||
|
this.limelight = limelight;
|
||||||
this.lanceur = lanceur;
|
this.lanceur = lanceur;
|
||||||
// Use addRequirements() here to declare subsystem dependencies.
|
// Use addRequirements() here to declare subsystem dependencies.
|
||||||
addRequirements(lanceur);
|
addRequirements(lanceur,limelight);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Called when the command is initially scheduled.
|
// Called when the command is initially scheduled.
|
||||||
@ -26,8 +29,10 @@ public class Lancer extends Command {
|
|||||||
// Called every time the scheduler runs while the command is scheduled.
|
// Called every time the scheduler runs while the command is scheduled.
|
||||||
@Override
|
@Override
|
||||||
public void execute() {
|
public void execute() {
|
||||||
|
if(limelight.getv()){
|
||||||
lanceur.lancerspeaker();
|
lanceur.lancerspeaker();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Called once the command ends or is interrupted.
|
// Called once the command ends or is interrupted.
|
||||||
@Override
|
@Override
|
||||||
|
@ -9,15 +9,16 @@ package frc.robot.command;
|
|||||||
import edu.wpi.first.wpilibj2.command.Command;
|
import edu.wpi.first.wpilibj2.command.Command;
|
||||||
|
|
||||||
import frc.robot.subsystem.Lanceur;
|
import frc.robot.subsystem.Lanceur;
|
||||||
|
import frc.robot.subsystem.Limelight;
|
||||||
|
|
||||||
public class Lancerampli extends Command {
|
public class Lancerampli extends Command {
|
||||||
/** Creates a new Lanceur. */
|
/** Creates a new Lanceur. */
|
||||||
|
|
||||||
private Lanceur lanceur;
|
private Lanceur lanceur;
|
||||||
|
private Limelight limelight;
|
||||||
public Lancerampli(Lanceur lanceur) {
|
public Lancerampli(Lanceur lanceur,Limelight limelight) {
|
||||||
// Use addRequirements() here to declare subsystem dependencies.
|
// Use addRequirements() here to declare subsystem dependencies.
|
||||||
addRequirements(lanceur);
|
addRequirements(lanceur, limelight);
|
||||||
|
this.limelight = limelight;
|
||||||
this.lanceur = lanceur;
|
this.lanceur = lanceur;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -28,9 +29,12 @@ public class Lancerampli extends Command {
|
|||||||
// Called every time the scheduler runs while the command is scheduled.
|
// Called every time the scheduler runs while the command is scheduled.
|
||||||
@Override
|
@Override
|
||||||
public void execute() {
|
public void execute() {
|
||||||
|
if(limelight.getv()){
|
||||||
lanceur.lanceramp();
|
lanceur.lanceramp();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
// 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) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user