Apollo  6.0
Open source self driving car software
spline_1d_seg.h
Go to the documentation of this file.
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 <vector>
25 
26 #include "Eigen/Core"
28 
29 namespace apollo {
30 namespace planning {
31 
32 class Spline1dSeg {
33  public:
34  // order represents the highest order.
35  explicit Spline1dSeg(const uint32_t order);
36  explicit Spline1dSeg(const std::vector<double>& params);
37  ~Spline1dSeg() = default;
38 
39  void SetParams(const std::vector<double>& params);
40  double operator()(const double x) const;
41  double Derivative(const double x) const;
42  double SecondOrderDerivative(const double x) const;
43  double ThirdOrderDerivative(const double x) const;
44 
45  const PolynomialXd& spline_func() const;
46  const PolynomialXd& Derivative() const;
47  const PolynomialXd& SecondOrderDerivative() const;
48  const PolynomialXd& ThirdOrderDerivative() const;
49 
50  private:
51  inline void SetSplineFunc(const PolynomialXd& spline_func);
52 
53  PolynomialXd spline_func_;
54  PolynomialXd derivative_;
55  PolynomialXd second_order_derivative_;
56  PolynomialXd third_order_derivative_;
57 };
58 
59 } // namespace planning
60 } // namespace apollo
PlanningContext is the runtime context in planning. It is persistent across multiple frames...
Definition: atomic_hash_map.h:25
Planning module main class. It processes GPS and IMU as input, to generate planning info...
Spline1dSeg(const uint32_t order)
const PolynomialXd & SecondOrderDerivative() const
Definition: spline_1d_seg.h:32
double operator()(const double x) const
void SetParams(const std::vector< double > &params)
Definition: polynomial_xd.h:29
const PolynomialXd & spline_func() const
const PolynomialXd & Derivative() const
const PolynomialXd & ThirdOrderDerivative() const