Skip to content

Conversation

gpeairs
Copy link
Member

@gpeairs gpeairs commented Sep 3, 2025

Using auto_speed=true in bspline! or BSplineRouting will optimize endpoint speeds to minimize the integral of the squared curvature. This is mainly for convenience, to avoid having to set speeds manually. Smooth changes in curvature are also often physically nice, but note that our BSpline construction only sets the tangent at the origin, not the curvature, so there is still a discontinuity in curvature at the start and end of the bend. (For a 90 degree turn, the radius of curvature varies from 92.5% to 102.5% of a circle's.) Maybe we should have a zero initial curvature option?

First commit has a version that uses the derivative of the curvature.

I would like to make this the default, but that will have to wait for v2.0 because it would be a breaking change.

Works nicely on a variety of test cases and is reasonably fast. Still need to convert those to unit tests.

Copy link

codecov bot commented Sep 3, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@gpeairs
Copy link
Member Author

gpeairs commented Sep 3, 2025

Added an endpoints_curvature keyword and auto_curvature option that allow you to enforce curvature boundary conditions on the BSpline. Like endpoints_speed they currently apply the same boundary condition to each endpoint, although more flexibility can be added later. auto_curvature will automatically use the curvature of the last segment, or zero if the path is empty. If neither is specified you get the old behavior.

I also switched back to integrating the square of the derivative of the curvature, since that gives a very nice approximation of an "Euler bend" (constant increase in curvature, roughly constant curvature, constant decrease in curvature) for a 90 degree turn.

@gpeairs gpeairs marked this pull request as ready for review September 18, 2025 20:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant