Skip to content

Commit

Permalink
Update CentripetalRadiusAccelerationConstraint.java
Browse files Browse the repository at this point in the history
  • Loading branch information
BytingBulldogs3539 committed Jun 4, 2023
1 parent a1bbde6 commit 41a9000
Showing 1 changed file with 2 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,17 +38,12 @@ public double getMaxVelocity(Path.State state) {

// Special case when following a line, centripetal acceleration is 0 so don't
// constrain velocity
if (state.getCurvature() == 0.0) {
if (state.getRadius() == 0.0) {
return Double.POSITIVE_INFINITY;
}
if (state.getCurvature() == Double.POSITIVE_INFINITY) {
if (state.getRadius() == Double.POSITIVE_INFINITY) {
return Double.POSITIVE_INFINITY;
}

if (Double.isNaN(state.getCurvature())) {
return Double.POSITIVE_INFINITY;
}

return Math.sqrt((maxCentripetalAcceleration * state.getRadius()));
}
}

0 comments on commit 41a9000

Please sign in to comment.