vel correction setup

This commit is contained in:
aarav18
2022-03-16 15:35:38 -06:00
parent 38459ba40c
commit 2f23aed7f1
5 changed files with 27 additions and 63 deletions
@@ -48,7 +48,7 @@ public class BoomBoom extends SubsystemBase {
// SimpleMotorFeedforward feedforward = new SimpleMotorFeedforward(69, 42, 0); //get real values later
public static class ShooterTableEntry {
public Double distance, hoodExt, drumVelocity, duration;
public Double distance, hoodExt, drumVelocity;
}
private ShooterTableEntry[] m_shooterTable;
@@ -116,17 +116,6 @@ public class BoomBoom extends SubsystemBase {
return linearInterpolate(m_shooterTable, distance, e -> e.distance, e -> e.hoodExt).doubleValue();
}
/**
* This is a function that takes a value (distance) and returns a value (duration) that is a linear
* interpolation of the two values (duration) at the two closest points in the table (m_shooterTable)
* to the given value (distance).
* @param distance Distance in shooter table
* @return Shot duration in seconds
*/
public Double getDuration(final Double distance) {
return linearInterpolate(m_shooterTable, distance, e -> e.distance, e -> e.duration).doubleValue();
}
/**
* Using the given lookup value (x) and lookup getter function, locates the nearest entries in the
* given table to be used as the lower (x0) and upper (x1) bounds for interpolation. Returns the