From 3699688b78a03699bf171b23142c8cacc30bbb20 Mon Sep 17 00:00:00 2001 From: rahul Date: Sat, 21 Feb 2026 17:23:33 -0800 Subject: [PATCH] fixed bug with csv loader --- src/main/deploy/passingdata.csv | 3 +++ src/main/deploy/passingflywheelvelocitydata.csv | 0 src/main/deploy/passinghoodangledata.csv | 0 src/main/deploy/velocityrangehub.csv | 3 +++ src/main/java/frc/robot/auto/ShooterFunctions.java | 14 ++++---------- 5 files changed, 10 insertions(+), 10 deletions(-) create mode 100644 src/main/deploy/passingdata.csv delete mode 100644 src/main/deploy/passingflywheelvelocitydata.csv delete mode 100644 src/main/deploy/passinghoodangledata.csv diff --git a/src/main/deploy/passingdata.csv b/src/main/deploy/passingdata.csv new file mode 100644 index 0000000..5dc9904 --- /dev/null +++ b/src/main/deploy/passingdata.csv @@ -0,0 +1,3 @@ +57.5,1,1 +124,1,1 +263,1,1 \ No newline at end of file diff --git a/src/main/deploy/passingflywheelvelocitydata.csv b/src/main/deploy/passingflywheelvelocitydata.csv deleted file mode 100644 index e69de29..0000000 diff --git a/src/main/deploy/passinghoodangledata.csv b/src/main/deploy/passinghoodangledata.csv deleted file mode 100644 index e69de29..0000000 diff --git a/src/main/deploy/velocityrangehub.csv b/src/main/deploy/velocityrangehub.csv index e69de29..5dc9904 100644 --- a/src/main/deploy/velocityrangehub.csv +++ b/src/main/deploy/velocityrangehub.csv @@ -0,0 +1,3 @@ +57.5,1,1 +124,1,1 +263,1,1 \ No newline at end of file diff --git a/src/main/java/frc/robot/auto/ShooterFunctions.java b/src/main/java/frc/robot/auto/ShooterFunctions.java index e649a86..f05aa88 100644 --- a/src/main/java/frc/robot/auto/ShooterFunctions.java +++ b/src/main/java/frc/robot/auto/ShooterFunctions.java @@ -29,16 +29,10 @@ public class ShooterFunctions { private static final String velocityPathHub = "flywheelvelocitydatahub.csv"; /** - * Path to the CSV file containing hood angle calibration data for passing. Formatted as Distance, + * Path to the CSV file containing hood angle and flywheel velocity calibration data for passing. Formatted as Distance, * Angle */ - private static final String anglePathPass = "passinghoodangledata.csv"; - - /** - * Path to the CSV file containing flywheel velocity calibration data for passing. Formatted as - * Distance, Velocity - */ - private static final String velocityPathPass = "passingflywheelvelocitydata.csv"; + private static final String passingPath = "passingdata.csv"; /** * Path to the CSV file containing minimum and maximum velocities to shoot at. Formatted as @@ -135,7 +129,7 @@ private UnivariateFunction loadFlywheelDataHub() throws IOException { */ private UnivariateFunction loadHoodAngleDataPass() throws IOException { SplineInterpolator interpolator = new SplineInterpolator(); - double[][] data = CSVLoader.loadCSV(anglePathPass); + double[][] data = CSVLoader.loadCSV(passingPath); double[] x = new double[data.length]; for (int i = 0; i < data.length; i++) { x[i] = data[i][0]; @@ -158,7 +152,7 @@ private UnivariateFunction loadHoodAngleDataPass() throws IOException { */ private UnivariateFunction loadFlywheelDataPass() throws IOException { SplineInterpolator interpolator = new SplineInterpolator(); - double[][] data = CSVLoader.loadCSV(velocityPathPass); + double[][] data = CSVLoader.loadCSV(passingPath); double[] x = new double[data.length]; for (int i = 0; i < data.length; i++) { x[i] = data[i][0];