mirror of
https://github.com/Team4388/Robot-Essentials.git
synced 2026-06-08 16:28:02 -06:00
port from 2023
This commit is contained in:
@@ -0,0 +1,13 @@
|
|||||||
|
package frc4388.utility;
|
||||||
|
|
||||||
|
// This is a seperate class in case I want to encode rotation or other
|
||||||
|
// information about the tag
|
||||||
|
public class AprilTag {
|
||||||
|
public final double x, y, z;
|
||||||
|
|
||||||
|
public AprilTag(double _x, double _y, double _z) {
|
||||||
|
x = _x;
|
||||||
|
y = _y;
|
||||||
|
z = _z;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
package frc4388.utility;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
|
||||||
|
public class DeferredBlock {
|
||||||
|
private static ArrayList<Runnable> m_blocks = new ArrayList<>();
|
||||||
|
private static boolean m_hasRun = false;
|
||||||
|
|
||||||
|
public DeferredBlock(Runnable block) {
|
||||||
|
m_blocks.add(block);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void execute() {
|
||||||
|
if (m_hasRun) return;
|
||||||
|
|
||||||
|
for (Runnable block : m_blocks) {
|
||||||
|
block.run();
|
||||||
|
}
|
||||||
|
|
||||||
|
m_blocks.clear(); // for garbage collection
|
||||||
|
m_hasRun = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
package frc4388.utility;
|
||||||
|
|
||||||
|
public class UtilityStructs {
|
||||||
|
public static class TimedOutput {
|
||||||
|
public double leftX = 0.0;
|
||||||
|
public double leftY = 0.0;
|
||||||
|
public double rightX = 0.0;
|
||||||
|
public double rightY = 0.0;
|
||||||
|
|
||||||
|
public long timedOffset = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user