9 Eigen::MatrixXd matrix_points(2, points.size());
11 for(
auto const point : points){
12 matrix_points.col(row_index) <<
point.x(),
point.y();
15 spline_ = Eigen::SplineFitting<Spline2d>::Interpolate(matrix_points,3 );
19 Eigen::VectorXd values =
spline_(t);
20 lanelet::BasicPoint2d pt = {values.x(), values.y()};
25 Eigen::Array2Xd v =
spline_.derivatives(t, 1);
26 lanelet::BasicPoint2d output = {v(2), v(3)};
31 Eigen::Array2Xd v =
spline_.derivatives(t, 2);
32 lanelet::BasicPoint2d output = {v(4), v(5)};
lanelet::BasicPoint2d operator()(double t) const override
Get the BasicPoint2d coordinate along the curve at t-th step.
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.