33 #ifndef PARAM_FUNC_SPLINE0_DIST_H 34 #define PARAM_FUNC_SPLINE0_DIST_H 50 class ParamFuncsSpline0Dist;
66 std::array<double, nrModesMax_>
cache;
98 virtual double computeFuncVal(
const std::size_t& _funcIdx)
const override;
101 virtual double computeFuncDiff1(
const std::size_t& _funcIdx)
const override;
104 virtual double computeFuncDiff2(
const std::size_t& _funcIdx)
const override;
107 virtual double computeFuncInt1(
const std::size_t& _funcIdx)
const override;
110 virtual double computeFuncInt2(
const std::size_t& _funcIdx)
const override;
149 void computeS2TLattice(
const std::vector<double>& _sLattice, std::vector<double>& _tLattice)
override;
152 void computeS2TLattice(
const double& _arc0,
const double& _ds, std::vector<double>& _tLattice)
override;
157 static double computeDeltaS_V_AV(
const double& _dt,
const double& _v0,
const double& _av);
161 static double computeDeltaT_V_AV(
const double& _ds,
const double& _v0,
const double& _av);
214 #endif // PARAM_FUNC_SPLINE0_DIST_H virtual double computeFuncInt2(const std::size_t &_funcIdx) const override
Computes double integral of parametric function with index _funcIdx on interval [funcsArcBegin_, funcsArcEnd_].
TraveledDistCfMode distCfMode_
Closed form distance computation mode.
std::vector< std::vector< std::size_t > > arc2func_
Maps the arc parametrizations to the functions that use them.
void setDistCfMode(TraveledDistCfMode _distCfMode, const std::vector< std::size_t > &_distRelFuncIdx) override
double(ParamFuncsSpline0Dist::*)() const ComputeSFuncPtr
std::vector< std::size_t > distLinkedFuncIdx_
Indexes of parametric functions used for computing the traveled distance.
virtual double computeFuncDiff2(const std::size_t &_funcIdx) const override
Computes 2nd derivative of parametric function with index _funcIdx at parametric arc set by setEvalAr...
FuncCacheData(const FuncCtrlPt &_ctrlPt)
double computeFuncDeltaInt1(const std::size_t &_funcIdx, const double &_arcEnd) const
Computes the integral of the parametric function _ on interval [funcEvalArcCacheIdxOld_[func2Arc_[_fu...
virtual void initImpl() override
Called at end of init. To be used by extended classes.
double computeS() const override
std::vector< double > distEvalCache_
Cached values of traveled distance computation.
std::array< double, nrModesMax_ > cache
std::size_t distLinkedArcIdx_
Index of the parametrized function that relates to distance computation.
ComputeDs2DtPtr computeDs2DtPtr_
double computeT(const double &_s, const EvalArcGuarantee &_evalArcGuarantee=EvalArcGuarantee::NONE) override
ComputeSFuncPtr computeSFuncPtr_
double computeS_AV() const
Computes distance on a piecewise linear function describing the center linear acceleration.
double computeT_V(const double &_ds) const
Computes arc parametrization on a piecewise linear function describing the center linear velocity at ...
ParamFuncsSpline0Dist & operator=(const ParamFuncsSpline0Dist &)
EvalArcGuarantee
Flags if any guarantees about evaluation arc relative to last evaluation arc are present.
virtual ~ParamFuncsSpline0Dist()=default
virtual double computeFuncInt1(const std::size_t &_funcIdx) const override
Computes integral of parametric function with index _funcIdx on interval [funcsArcBegin_, funcsArcEnd_].
double(ParamFuncsSpline0Dist::*)(const double &) const ComputeDs2DtPtr
virtual void precompute() override
Precomputes cached data. To be called after ANY control point modifications.
Structure referencing a control point and storing cached relevant function evaluation data (derivativ...
std::vector< std::vector< FuncCacheData > > funcEvalCache_
Cached values of the used function evaluation modes.
void setEvalArc(const double &_funcsArcEval, const EvalArcGuarantee &_evalArcGuarantee=EvalArcGuarantee::NONE) override
Sets parametric function evaluation arc.
double computeFuncDeltaInt2(const std::size_t &_funcIdx, const double &_arcEnd) const
Computes the double integral integral of the parametric function _ on interval [funcEvalArcCacheIdxOl...
static double computeDeltaT_V_AV(const double &_ds, const double &_v0, const double &_av)
Helper function that computes deltaT (from the evalArc_ position) operating on one function control p...
Extends manipulation of parametric functions collection with closed-form arc length (distance) comput...
std::vector< std::size_t > funcEvalArcCacheIdxUnder_
Contains the index of the <u>next</u> control point relative to the last evaluation point...
std::shared_ptr< ParamFuncsSpline0Dist > ParamFuncsSpline0DistPtr
void setEvalDist(const double &_funcsDistEval, const EvalArcGuarantee &_evalArcGuarantee=EvalArcGuarantee::NONE) override
Moves to evaluation arc at which the traveled distance _funcsDistEval is achieved.
ParamFuncsSpline0Dist()=default
virtual double computeFuncDiff1(const std::size_t &_funcIdx) const override
Computes 1st derivative of parametric function with index _funcIdx at parametric arc set by setEvalAr...
std::shared_ptr< ParamFuncsSpline0Dist const > ParamFuncsSpline0DistConstPtr
virtual double computeFuncVal(const std::size_t &_funcIdx) const override
Computes value of parametric function with index _funcIdx at parametric arc set by setEvalArc...
static double computeDeltaS_V_AV(const double &_dt, const double &_v0, const double &_av)
Helper function that computes deltaS (from the evalArc_ position) operating on one function control p...
void precomputeDist()
Precomputes distance invervals.
double computeS_V() const
Computes distance on a piecewise linear function describing the center linear velocity.
double computeTImpl(const double &_s, const EvalArcGuarantee &_evalArcGuarantee)
Internal implementation of computing the arc parametrization given a distance _s. ...
double computeT_AV(const double &_ds) const
Computes arc parametrization on a piecewise linear function describing the center linear acceleration...
std::vector< std::size_t > distRelFuncIdx_
TraveledDistCfMode
Required type of traveled distance computation relative to the parametric function.
void computeS2TLattice(const std::vector< double > &_sLattice, std::vector< double > &_tLattice) override
Computes arc parametrization lattice given a distance-parametrized lattice.