Ensure 2 samples when drawing paths

This commit is contained in:
Ryan Brott
2023-10-21 14:19:36 -07:00
parent a6b4dbebc4
commit e291d590a6
2 changed files with 2 additions and 2 deletions

View File

@ -223,7 +223,7 @@ public final class MecanumDrive {
List<Double> disps = com.acmerobotics.roadrunner.Math.range(
0, t.path.length(),
(int) Math.ceil(t.path.length() / 2));
Math.max(2, (int) Math.ceil(t.path.length() / 2)));
xPoints = new double[disps.size()];
yPoints = new double[disps.size()];
for (int i = 0; i < disps.size(); i++) {

View File

@ -231,7 +231,7 @@ public final class TankDrive {
List<Double> disps = com.acmerobotics.roadrunner.Math.range(
0, t.path.length(),
(int) Math.ceil(t.path.length() / 2));
Math.max(2, (int) Math.ceil(t.path.length() / 2)));
xPoints = new double[disps.size()];
yPoints = new double[disps.size()];
for (int i = 0; i < disps.size(); i++) {