2 Commits

Author SHA1 Message Date
Antoine PerreaultE
9911ae781a Merge branch 'main' of https://git.demerso.net/PLS5618/Reefscape-2025 2025-11-24 18:36:50 -05:00
Antoine PerreaultE
1bf8f02db2 s'enligner avec un apriltag fini 2025-11-24 18:36:30 -05:00
2 changed files with 2 additions and 15 deletions

View File

@@ -74,8 +74,8 @@ public class AprilTag3 extends Command {
else if(tagId ==7){
drivetrain.setControl(drive.
withRotationalRate(tx/20).
withVelocityX((2-limelight3.derive(botx))).
withVelocityY(2-limelight3.derive(boty)));
withVelocityX(2-botx).
withVelocityY(2-boty));
}
}
else{

View File

@@ -21,19 +21,6 @@ public class Limelight3 extends SubsystemBase {
for(int port = 5800; port <=5807; port++){
PortForwarder.add(port, "limelight.local", port);
}
}
double previousValue = 0;
double previousTime = Timer.getFPGATimestamp();
public double derive(double currentValue) {
double previousValue = 0;
double previousTime = Timer.getFPGATimestamp();
double now = Timer.getFPGATimestamp();
double dt = now - previousTime;
double derivative = (currentValue - previousValue) / dt;
previousValue = currentValue;
previousTime = now;
return derivative;
}
public double[] getTargetPose(){
NetworkTable limelightTable = NetworkTableInstance.getDefault().getTable("limelight-balon");