Compare commits

..

No commits in common. "910caa963e52baa4402123cb487d5ec30cc46322" and "954c82a7a07327af9c59f123b74fcebd754c9266" have entirely different histories.

4 changed files with 7 additions and 24 deletions

View File

@ -22,8 +22,7 @@ public class Desaccumuler 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(accumulateur.photocell()){accumulateur.desaccumule(0.1);} accumulateur.desaccumule(0.1);
} }
// Called once the command ends or is interrupted. // Called once the command ends or is interrupted.
@Override @Override

View File

@ -12,8 +12,9 @@ import com.ctre.phoenix.motorcontrol.can.WPI_TalonSRX;
public class Accumulateur extends SubsystemBase { public class Accumulateur extends SubsystemBase {
/** Creates a new Accumulateur. */ /** Creates a new Accumulateur. */
public Accumulateur() {dashboard.addBoolean("photocellacc", this::photocell).withSize(1, 1).withPosition(0, 1); public Accumulateur() {dashboard.addBoolean("photocellacc", this::limitswitch)
.withSize(1, 1)
.withPosition(0, 1);
} }
ShuffleboardTab dashboard = Shuffleboard.getTab("dashboard"); ShuffleboardTab dashboard = Shuffleboard.getTab("dashboard");
@ -28,8 +29,8 @@ public class Accumulateur extends SubsystemBase {
final DigitalInput photocell = new DigitalInput(94); final DigitalInput photocell = new DigitalInput(94);
public void encodeur(){ public void encodeur(){
} }
public boolean photocell(){ public boolean limitswitch(){
return photocell.get(); return !photocell.get();
} }
public void desaccumule(double vitesse){ public void desaccumule(double vitesse){
accumulateur1.set(vitesse); accumulateur1.set(vitesse);

View File

@ -30,11 +30,6 @@ public class Lanceur extends SubsystemBase {
.withSize(0,0) .withSize(0,0)
.withPosition(1, 4) .withPosition(1, 4)
.getEntry(); .getEntry();
private GenericEntry rotation =
dashboard.add("rottourel", 0.2)
.withSize(0,0)
.withPosition(1, 5)
.getEntry();
public void encodeur(double distance){ public void encodeur(double distance){
lanceur1.configSelectedFeedbackSensor(FeedbackDevice.CTRE_MagEncoder_Relative); lanceur1.configSelectedFeedbackSensor(FeedbackDevice.CTRE_MagEncoder_Relative);
lanceur2.configSelectedFeedbackSensor(FeedbackDevice.CTRE_MagEncoder_Relative); lanceur2.configSelectedFeedbackSensor(FeedbackDevice.CTRE_MagEncoder_Relative);
@ -45,7 +40,7 @@ public class Lanceur extends SubsystemBase {
lanceur2.setInverted(true); lanceur2.setInverted(true);
} }
public void lance(double vitesse){ public void lance(double vitesse){
lanceur1.set(vitesse);lanceur2.set(vitesse); lanceur1.set(vitesse);
} }
public void lance(){ public void lance(){
lance(vitesse.getDouble(0.2)); lance(vitesse.getDouble(0.2));
@ -53,9 +48,6 @@ public class Lanceur extends SubsystemBase {
public void tourelRotation(double x, double y, double rotation){ public void tourelRotation(double x, double y, double rotation){
tourelle.set(rotation); tourelle.set(rotation);
} }
public void tourelRotation(){
tourelle.set(rotation.getDouble(0.1));
}
public double vitessetourel(){ public double vitessetourel(){
return(tourelle.getEncoder().getVelocity()); return(tourelle.getEncoder().getVelocity());
} }

View File

@ -6,20 +6,11 @@ package frc.robot.Subsystems;
import edu.wpi.first.wpilibj2.command.SubsystemBase; import edu.wpi.first.wpilibj2.command.SubsystemBase;
import edu.wpi.first.net.PortForwarder; import edu.wpi.first.net.PortForwarder;
import edu.wpi.first.networktables.GenericEntry;
import edu.wpi.first.networktables.NetworkTable; import edu.wpi.first.networktables.NetworkTable;
import edu.wpi.first.networktables.NetworkTableEntry; import edu.wpi.first.networktables.NetworkTableEntry;
import edu.wpi.first.networktables.NetworkTableInstance; import edu.wpi.first.networktables.NetworkTableInstance;
import edu.wpi.first.wpilibj.shuffleboard.Shuffleboard;
import edu.wpi.first.wpilibj.shuffleboard.ShuffleboardTab;
public class Limelight3G extends SubsystemBase { public class Limelight3G extends SubsystemBase {
ShuffleboardTab dashboard = Shuffleboard.getTab("dashboard");
private GenericEntry orientation =
dashboard.add("orientation tourel", 0.1)
.withSize(0, 0)
.withPosition(2, 4)
.getEntry();
NetworkTable table = NetworkTableInstance.getDefault().getTable("limelight"); NetworkTable table = NetworkTableInstance.getDefault().getTable("limelight");
NetworkTableEntry tx = table.getEntry("tx"); NetworkTableEntry tx = table.getEntry("tx");
NetworkTableEntry ty = table.getEntry("ty"); NetworkTableEntry ty = table.getEntry("ty");