pid d`édouard

This commit is contained in:
EdwardFaucher
2025-10-29 18:34:30 -04:00
parent 837435643b
commit 3715451972
8 changed files with 84 additions and 45 deletions

View File

@@ -31,10 +31,10 @@ public class Elevateur extends SubsystemBase {
teb.add("encodeurelevateursationhaut", -0.4).getEntry();
private GenericEntry distanceDeploiePince =
teb.add("encodeurDeploiePince", 0.2).getEntry();
public Elevateur() {
teb.addDouble("encodeur elevateur",this::position);
teb.addBoolean("limit elevateur", this::limit2);
teb.addDouble("amperage elevateur", this::amp);
}
final SparkMax monte = new SparkMax(22, MotorType.kBrushless);
final DigitalInput limit2 = new DigitalInput(0);
@@ -89,7 +89,9 @@ public class Elevateur extends SubsystemBase {
public double distanceDeploiePince(){
return distanceDeploiePince.getDouble(0.2);
}
public double amp(){
return monte.getOutputCurrent();
}
@Override
public void periodic() {

View File

@@ -20,8 +20,15 @@ public class Limelight3 extends SubsystemBase {
PortForwarder.add(port, "limelight.local", port);
}
}
public double getX(){
return LimelightHelpers.getTX("limelight-balon");
public double getTx(){
NetworkTable table = NetworkTableInstance.getDefault().getTable("limelight-balon");
NetworkTableEntry tx = table.getEntry("tx");
return tx.getDouble(0.0);
}
public double getRx(){
NetworkTable table = NetworkTableInstance.getDefault().getTable("limelight-balon");
NetworkTableEntry rx = table.getEntry("rx");
return rx.getDouble(0.0);
}
public boolean getV(){
return LimelightHelpers.getTV("limelight-balon");

View File

@@ -19,6 +19,7 @@ public class Pince extends SubsystemBase {
teb.addDouble("encodeur pince", this::encodeurpivot);
teb.addDouble("amperage corail", this::emperagecoral);
teb.addDouble("amperage algue", this::emperagealgue);
teb.addDouble("amperage pivotis", this::ampPivote);
}
final SparkMax coral = new SparkMax(20, MotorType.kBrushless);
final SparkMax pivoti = new SparkMax(14, MotorType.kBrushless);
@@ -63,7 +64,9 @@ public double emperagealgue(){
return algue1.getOutputCurrent();
}
public boolean x = false;
public double ampPivote(){
return pivoti.getOutputCurrent();
}
@Override
public void periodic() {
// This method will be called once per scheduler run