param_func_dist.h
Go to the documentation of this file.
1 /***************************************************************************
2  * Software License Agreement (BSD License) *
3  * Copyright (C) 2016 by Horatiu George Todoran <todorangrg@gmail.com> *
4  * *
5  * Redistribution and use in source and binary forms, with or without *
6  * modification, are permitted provided that the following conditions *
7  * are met: *
8  * *
9  * 1. Redistributions of source code must retain the above copyright *
10  * notice, this list of conditions and the following disclaimer. *
11  * 2. Redistributions in binary form must reproduce the above copyright *
12  * notice, this list of conditions and the following disclaimer in *
13  * the documentation and/or other materials provided with the *
14  * distribution. *
15  * 3. Neither the name of the copyright holder nor the names of its *
16  * contributors may be used to endorse or promote products derived *
17  * from this software without specific prior written permission. *
18  * *
19  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS *
20  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT *
21  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS *
22  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE *
23  * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, *
24  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, *
25  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; *
26  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER *
27  * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT *
28  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY *
29  * WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE *
30  * POSSIBILITY OF SUCH DAMAGE. *
31  ***************************************************************************/
32 
33 #ifndef PARAM_FUNC_DIST_H
34 #define PARAM_FUNC_DIST_H
35 
36 #include <memory>
37 #include <vector>
38 #include <map>
39 #include <tuw_control/utils.h>
41 
42 namespace tuw
43 {
48 class ParamFuncsDist;
49 using ParamFuncsDistPtr = std::shared_ptr<ParamFuncsDist>;
50 using ParamFuncsDistConstPtr = std::shared_ptr<ParamFuncsDist const>;
51 class ParamFuncsDist : public ParamFuncs
52 {
53  // enums
55 public:
56  enum class TraveledDistCfMode
57  {
58  NONE,
59  V,
60  AV
61  };
62 
63  // special class member functions
64 public:
65  ParamFuncsDist() = default;
66 
67 public:
68  virtual ~ParamFuncsDist() = default;
69 
70 public:
71  ParamFuncsDist(const ParamFuncsDist& _other) = default;
72 
73 public:
74  ParamFuncsDist& operator=(const ParamFuncsDist& _other) = default;
75 
76 public:
77  ParamFuncsDist(ParamFuncsDist&&) = delete;
78 
79 public:
81 
82  // pure virtual functions
84 public:
85  virtual void setDistCfMode(TraveledDistCfMode _distCfMode, const std::vector<std::size_t>& _distRelFuncIdx) = 0;
87 public:
88  virtual void
89  setEvalDist(const double& _funcsDistEval,
93 public:
94  virtual double computeS() const = 0;
97 public:
98  virtual double computeT(
99  const double& _s, const ParamFuncs::EvalArcGuarantee& _evalArcGuarantee = ParamFuncs::EvalArcGuarantee::NONE) = 0;
104 public:
105  virtual void computeS2TLattice(const std::vector<double>& _sLattice, std::vector<double>& _tLattice) = 0;
115 public:
116  virtual void computeS2TLattice(const double& _arc0, const double& _ds, std::vector<double>& _tLattice) = 0;
117 };
118 }
119 
120 #endif // PARAM_FUNC_DIST_H
no closed-form distance computation mode
TraveledDistCfMode
Required type of traveled distance computation relative to the parametric function.
ParamFuncsDist()=default
virtual ~ParamFuncsDist()=default
agent base center linear acceleration is parametric function
ParamFuncsDist & operator=(const ParamFuncsDist &_other)=default
virtual void setEvalDist(const double &_funcsDistEval, const ParamFuncs::EvalArcGuarantee &_evalArcGuarantee=ParamFuncs::EvalArcGuarantee::NONE)=0
Moves to evaluation arc at which the traveled distance _funcsDistEval is achieved.
virtual void setDistCfMode(TraveledDistCfMode _distCfMode, const std::vector< std::size_t > &_distRelFuncIdx)=0
Initializer of the Closed form distance computation mode.
std::shared_ptr< ParamFuncsDist const > ParamFuncsDistConstPtr
virtual void computeS2TLattice(const std::vector< double > &_sLattice, std::vector< double > &_tLattice)=0
Computes arc parametrization lattice given a distance-parametrized lattice.
EvalArcGuarantee
Flags if any guarantees about evaluation arc relative to last evaluation arc are present.
Definition: param_func.h:80
virtual double computeT(const double &_s, const ParamFuncs::EvalArcGuarantee &_evalArcGuarantee=ParamFuncs::EvalArcGuarantee::NONE)=0
virtual double computeS() const =0
Extends manipulation of parametric functions collection with closed-form arc length (distance) comput...
std::shared_ptr< ParamFuncsDist > ParamFuncsDistPtr
agent base center linear velocity is parametric function
Storage and manipulation of parametric functions collection.
Definition: param_func.h:57


tuw_control
Author(s): George Todoran
autogenerated on Mon Jun 10 2019 15:27:21