- 3.0.2 optimal control module.
SplinerBase.h
Go to the documentation of this file.
1 /**********************************************************************************************************************
2 This file is part of the Control Toolbox (https://github.com/ethz-adrl/control-toolbox), copyright by ETH Zurich.
3 Licensed under the BSD-2 license (see LICENSE file in main directory)
4 **********************************************************************************************************************/
5 
6 #pragma once
7 
8 namespace ct {
9 namespace optcon {
10 
19 template <class T, typename SCALAR = double>
21 {
22 public:
23  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
24 
28  SplinerBase() = default;
29 
33  virtual ~SplinerBase() = default;
34 
35  typedef T vector_t;
36  typedef Eigen::Matrix<SCALAR, T::DIM, T::DIM> matrix_t;
37  typedef std::vector<vector_t, Eigen::aligned_allocator<vector_t>> vector_array_t;
38 
39 
45  virtual void computeSpline(const vector_array_t& points) = 0;
46 
56  virtual vector_t evalSpline(const SCALAR time, const size_t shotIdx) = 0;
57 
66  virtual vector_t splineDerivative_t(const SCALAR time, const size_t shotIdx) const = 0;
67 
77  virtual vector_t splineDerivative_h_i(const SCALAR time, const size_t shotIdx) const = 0;
78 
88  virtual matrix_t splineDerivative_q_i(const SCALAR time, const size_t shotIdx) const = 0;
89 
99  virtual matrix_t splineDerivative_q_iplus1(const SCALAR time, const size_t shotIdx) const = 0;
100 };
101 
102 } // namespace optcon
103 } // namespace ct
virtual void computeSpline(const vector_array_t &points)=0
Updates the vector on the shots.
virtual ~SplinerBase()=default
Destructor.
virtual vector_t splineDerivative_h_i(const SCALAR time, const size_t shotIdx) const =0
Returns the spline derivatives with respect to the time segment between the shots.
Abstract base class for the control input splining between the DMS shots.
Definition: SplinerBase.h:20
std::vector< vector_t, Eigen::aligned_allocator< vector_t > > vector_array_t
Definition: SplinerBase.h:37
CppAD::AD< CppAD::cg::CG< double > > SCALAR
EIGEN_MAKE_ALIGNED_OPERATOR_NEW SplinerBase()=default
Default constructor.
virtual vector_t splineDerivative_t(const SCALAR time, const size_t shotIdx) const =0
Returns the spline derivatives with respect to time.
virtual matrix_t splineDerivative_q_iplus1(const SCALAR time, const size_t shotIdx) const =0
Returns the spline derivative with respect to the control input at shot i+1.
virtual vector_t evalSpline(const SCALAR time, const size_t shotIdx)=0
Depending on the spline type, this method evaluates the control input between the shots...
virtual matrix_t splineDerivative_q_i(const SCALAR time, const size_t shotIdx) const =0
Return the spline derivative with respect to the control input at shot i.
T vector_t
Definition: SplinerBase.h:35
Eigen::Matrix< SCALAR, T::DIM, T::DIM > matrix_t
Definition: SplinerBase.h:36