You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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.
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
toppra/toppra/interpolator.py
Line 360 in 644e263
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
toppra/cpp/src/toppra/geometric_path/piecewise_poly_path.hpp
Line 23 in 644e263
The spline in cpp can only be constructed from these 2 scenarios:
toppra/cpp/src/toppra/geometric_path/piecewise_poly_path.hpp
Line 35 in 644e263
toppra/cpp/src/toppra/geometric_path/piecewise_poly_path.hpp
Line 57 in 644e263
In the scenario where the first-order derivatives at each knot are unknown,
![Screenshot from 2021-01-08 16-28-45](https://user-images.githubusercontent.com/45716700/103992281-d2ff6d80-51ce-11eb-992b-957737c569e2.png)
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)
![Screenshot from 2021-01-08 16-31-03](https://user-images.githubusercontent.com/45716700/103992465-1954cc80-51cf-11eb-89f9-0774f11bf72a.png)
The first and second derivative of all polynomials are identical in the points where they touch their adjacent polynomial
![Screenshot from 2021-01-08 16-33-52](https://user-images.githubusercontent.com/45716700/103992650-63d64900-51cf-11eb-8124-6f84319fa4c8.png)
![Screenshot from 2021-01-08 16-31-08](https://user-images.githubusercontent.com/45716700/103992459-16f27280-51cf-11eb-8986-7dc24f51c14e.png)
(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?
The text was updated successfully, but these errors were encountered: