Apollo 11.0
自动驾驶开放平台
spline_2d.h
浏览该文件的文档.
1/******************************************************************************
2 * Copyright 2017 The Apollo Authors. All Rights Reserved.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 *****************************************************************************/
16
22#pragma once
23
24#include <utility>
25#include <vector>
26
27#include "Eigen/Core"
28
31
32namespace apollo {
33namespace planning {
34
35class Spline2d {
36 public:
37 Spline2d(const std::vector<double>& t_knots, const uint32_t order);
38 std::pair<double, double> operator()(const double t) const;
39 double x(const double t) const;
40 double y(const double t) const;
41 double DerivativeX(const double t) const;
42 double DerivativeY(const double t) const;
43 double SecondDerivativeX(const double t) const;
44 double SecondDerivativeY(const double t) const;
45 double ThirdDerivativeX(const double t) const;
46 double ThirdDerivativeY(const double t) const;
47 bool set_splines(const Eigen::MatrixXd& params, const uint32_t order);
48 const Spline2dSeg& smoothing_spline(const uint32_t index) const;
49 const std::vector<double>& t_knots() const;
50 uint32_t spline_order() const;
51
52 private:
53 uint32_t find_index(const double x) const;
54
55 private:
56 std::vector<Spline2dSeg> splines_;
57 std::vector<double> t_knots_;
58 uint32_t spline_order_;
59};
60
61} // namespace planning
62} // namespace apollo
double ThirdDerivativeX(const double t) const
Definition spline_2d.cc:95
double DerivativeX(const double t) const
Definition spline_2d.cc:61
double DerivativeY(const double t) const
Definition spline_2d.cc:70
const std::vector< double > & t_knots() const
Definition spline_2d.cc:138
double x(const double t) const
Definition spline_2d.cc:45
bool set_splines(const Eigen::MatrixXd &params, const uint32_t order)
: set splines
Definition spline_2d.cc:113
double SecondDerivativeX(const double t) const
Definition spline_2d.cc:79
const Spline2dSeg & smoothing_spline(const uint32_t index) const
Definition spline_2d.cc:134
std::pair< double, double > operator()(const double t) const
Definition spline_2d.cc:37
double y(const double t) const
Definition spline_2d.cc:53
double SecondDerivativeY(const double t) const
Definition spline_2d.cc:87
double ThirdDerivativeY(const double t) const
Definition spline_2d.cc:103
uint32_t spline_order() const
Definition spline_2d.cc:140
Planning module main class.
class register implement
Definition arena_queue.h:37