Carma-platform v4.2.0
CARMA Platform is built on robot operating system (ROS) and utilizes open source software (OSS) that enables Cooperative Driving Automation (CDA) features to allow Automated Driving Systems to interact and cooperate with infrastructure and other vehicles through communication.
BSpline.hpp
Go to the documentation of this file.
1#pragma once
2
3/*
4 * Copyright (C) 2022 LEIDOS.
5 *
6 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
7 * use this file except in compliance with the License. You may obtain a copy of
8 * the License at
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15 * License for the specific language governing permissions and limitations under
16 * the License.
17 */
18
19#include <vector>
20#include <carma_wm/Geometry.hpp>
22#include <unsupported/Eigen/Splines>
23
25{
26namespace smoothing
27{
28
29 typedef Eigen::Spline<double, 2> Spline2d;
33class BSpline : public SplineI
34{
35public:
37 void setPoints(const std::vector<lanelet::BasicPoint2d>& points) override;
38 lanelet::BasicPoint2d operator()(double t) const override;
39 lanelet::BasicPoint2d first_deriv(double t) const override;
40 lanelet::BasicPoint2d second_deriv(double t) const override;
41private:
43};
44}; // namespace smoothing
45}; // namespace inlanecruising_plugin
Realization of SplineI that uses the Eigen::Splines library for interpolation.
Definition: BSpline.hpp:34
lanelet::BasicPoint2d operator()(double t) const override
Get the BasicPoint2d coordinate along the curve at t-th step.
Definition: BSpline.cpp:17
void setPoints(const std::vector< lanelet::BasicPoint2d > &points) override
Set key points which the spline will interpolate between.
Definition: BSpline.cpp:7
lanelet::BasicPoint2d first_deriv(double t) const override
Get the BasicPoint2d representing the first_deriv along the curve at t-th step.
Definition: BSpline.cpp:24
lanelet::BasicPoint2d second_deriv(double t) const override
Get the BasicPoint2d representing the first_deriv along the curve at t-th step.
Definition: BSpline.cpp:30
Interface to a spline interpolator that can be used to smoothly interpolate between points.
Definition: SplineI.hpp:30
Eigen::Spline< double, 2 > Spline2d
Definition: BSpline.hpp:29