Open leonardoedgar opened 3 years ago
As far as I know, this is not implemented. However, this is easy to implement since this boils down to solving A x = b
and Eigen provides everything you need for it, you only have to build A
and b
. A bit cumbersome but nothing hard.
Noted, thanks
@leonardoedgar If you have an implementation, feel free to open a PR!
@hungpham2511 noted
Stale issue message
Hi. I am trying to find a way to construct a 3rd order piecewise-polynomial / cubic spline by specifying first-derivatives at the endpoints of the curve in cpp.
I found the implementation in Python here https://github.com/hungpham2511/toppra/blob/644e263269e45be8fc595bae59e959b9570edaa3/toppra/interpolator.py#L360 With the python implementation, a spline can be constructed by specifying boundary conditions such as the first-derivatives at the endpoints of the curve as documented here https://docs.scipy.org/doc/scipy/reference/generated/scipy.interpolate.CubicSpline.html
However, in cpp, all that I can find related to piecewise poly are here https://github.com/hungpham2511/toppra/blob/644e263269e45be8fc595bae59e959b9570edaa3/cpp/src/toppra/geometric_path/piecewise_poly_path.hpp#L23 The spline in cpp can only be constructed from these 2 scenarios:
In the scenario where the first-order derivatives at each knot are unknown, with a general form of a cubic spline in the following form (4n unknowns),
a cubic spline still can be constructed by specifying the following:
The values at each knot (2n equations)
The first and second derivative of all polynomials are identical in the points where they touch their adjacent polynomial (2n - 2 equations)
The first derivative at the curve endpoints (2 equations) f1'(x1) = a fn'(xn+1) = b, where a and b are known values
However, currently, this method is not available in cpp. Are there any suggestions to go about this?