File tree Expand file tree Collapse file tree
src/main/java/frc/robot/lib Expand file tree Collapse file tree Original file line number Diff line number Diff line change 33import java .io .FileNotFoundException ;
44import java .io .FileReader ;
55import java .io .IOException ;
6+ import java .nio .file .Paths ;
67import java .util .Arrays ;
78import java .util .List ;
89
910import org .apache .commons .csv .CSVFormat ;
1011import org .apache .commons .csv .CSVParser ;
1112import org .apache .commons .csv .CSVRecord ;
1213
14+ import edu .wpi .first .wpilibj .Filesystem ;
15+
1316public class LinearInterpolation {
1417 public double [] xs , ys ;
1518 public double [] slopes , intercepts ;
@@ -19,7 +22,7 @@ public class LinearInterpolation {
1922 // Performs linear interpolation for a strictly monotonically increasing function.
2023 public LinearInterpolation (String filename ) {
2124 try {
22- CSVParser csvParser = CSVFormat .DEFAULT .parse (new FileReader (filename ));
25+ CSVParser csvParser = CSVFormat .DEFAULT .parse (new FileReader (Filesystem . getDeployDirectory (). toPath (). resolve ( Paths . get ( filename )). toFile () ));
2326 List <CSVRecord > records = csvParser .getRecords ();
2427 numPoints = records .size () - 1 ; // Subtract 1 because of the labels.
2528 // Set the size of the arrays
You can’t perform that action at this time.
0 commit comments