Skip to content

Commit caa2c87

Browse files
committed
add updating spline length [spline groups may still be buggy]
1 parent 9d1f939 commit caa2c87

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/main/java/com/github/mittyrobotics/pathfollowing/QuinticHermiteSplineGroup.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,4 +240,14 @@ public QuinticHermiteSplineGroup getNewPath(Pose2D newPos, Vector2D newVel, Vect
240240
}
241241
return group;
242242
}
243+
244+
/**
245+
* Updates the total spline length when one {@link QuinticHermiteSpline} is edited
246+
* @param index index of edited {@link QuinticHermiteSpline}
247+
* @param prevLength previous length of edited {@link QuinticHermiteSpline}
248+
*/
249+
public void updateSplineLength(int index, double prevLength) {
250+
length -= prevLength;
251+
length += splines.get(index).getLength();
252+
}
243253
}

0 commit comments

Comments
 (0)