26 Eigen::MatrixXd matrix_points(2, points.size());
28 for(
auto const point : points){
29 matrix_points.col(row_index) <<
point.x(),
point.y();
32 spline_ = Eigen::SplineFitting<Spline2d>::Interpolate(matrix_points,3 );
36 Eigen::VectorXd values =
spline_(t);
37 lanelet::BasicPoint2d pt = {values.x(), values.y()};
42 Eigen::Array2Xd v =
spline_.derivatives(t, 1);
43 lanelet::BasicPoint2d output = {v(2), v(3)};
48 Eigen::Array2Xd v =
spline_.derivatives(t, 2);
49 lanelet::BasicPoint2d output = {v(4), v(5)};
void setPoints(const std::vector< lanelet::BasicPoint2d > &points) override
Set key points which the spline will interpolate between.
lanelet::BasicPoint2d first_deriv(double t) const override
Get the BasicPoint2d representing the first_deriv along the curve at t-th step.
lanelet::BasicPoint2d second_deriv(double t) const override
Get the BasicPoint2d representing the first_deriv along the curve at t-th step.
lanelet::BasicPoint2d operator()(double t) const override
Get the BasicPoint2d coordinate along the curve at t-th step.