Commit d1cfe58c authored by Joseph Mirabel's avatar Joseph Mirabel Committed by Joseph Mirabel
Browse files

Add SplineGradientBasedAbstract::updateParameters

parent b74e2204
......@@ -58,6 +58,11 @@ namespace hpp {
/// robot number dof.
void updateSplines (Splines_t& spline, const vector_t& param) const;
/// Gets the parameters each spline.
/// \todo make this function static (currently, it only needs the
/// robot number dof.
void updateParameters (vector_t& param, const Splines_t& spline) const;
/// Returns res = (1 - alpha) * a + alpha * b
static void interpolate (const Splines_t& a, const Splines_t& b,
const value_type& alpha, Splines_t& res);
......
......@@ -422,6 +422,18 @@ namespace hpp {
}
}
template <int _PB, int _SO>
void SplineGradientBasedAbstract<_PB, _SO>::updateParameters
(vector_t& param, const Splines_t& splines) const
{
param.resize(robot_->numberDof() * Spline::NbCoeffs * splines.size());
size_type row = 0, size = robot_->numberDof() * Spline::NbCoeffs;
for (std::size_t i = 2; i < splines.size(); ++i) {
param.segment(row, size) = splines[i]->rowParameters();
row += size;
}
}
template <int _PB, int _SO>
void SplineGradientBasedAbstract<_PB, _SO>::interpolate
(const Splines_t& a, const Splines_t& b, const value_type& alpha, Splines_t& res)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment