38 uint n_polys = poly_durations.size();
52 assert(t_global >= 0.0);
56 for (
double d: durations) {
59 if (t >= t_global-eps)
73 double t_local = t_global;
74 for (
int i=0; i<id; i++)
75 t_local -= durations.at(i);
77 return std::make_pair(
id, t_local);
83 int id;
double t_local;
113 poly_durations.push_back(p.GetDuration());
115 return poly_durations;
122 return std::accumulate(v.begin(), v.end(), 0.0);
std::pair< int, double > GetLocalTime(double t_global, const VecTimes &d) const
How much time of the current segment has passed at t_global.
Stores at state comprised of values and higher-order derivatives.
std::vector< double > VecTimes
VecPoly cubic_polys_
the sequence of polynomials making up the spline.
double GetTotalTime() const
void UpdatePolynomialCoeff()
Updates the cubic-Hermite polynomial coefficients using the currently set nodes values and durations...
VecTimes GetPolyDurations() const
static int GetSegmentID(double t_global, const VecTimes &durations)
const State GetPoint(double t) const
int GetPolynomialCount() const
Represents a Cubic-Hermite-Polynomial.
Spline(const VecTimes &poly_durations, int n_dim)