Skip to content

Commit e641faa

Browse files
committed
fix curvature
1 parent a07c3cb commit e641faa

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
@@ -147,6 +147,16 @@ public Point2D getDerivative(double t, int n) {
147147
return splines.get(index).getDerivative(getSplineTFromT(t, index), n);
148148
}
149149

150+
/**
151+
* Returns the curvature as a {@link Pose2D} at t
152+
* @param t t parameter to get curvature of
153+
* @return the curvature as a {@link Pose2D} at t
154+
*/
155+
public double getCurvature(double t) {
156+
int index = getSplineFromT(t);
157+
return splines.get(index).getCurvature(getSplineTFromT(t, index));
158+
}
159+
150160
/**
151161
* Returns the closest associated t value on the spline from a {@link Point2D} using Newton's method on the distance function
152162
* @param point the {@link Point2D} that to get closest point from

0 commit comments

Comments
 (0)