Skip to content

Commit

Permalink
doc: Improve PiecewisePolyPath constructor docstring
Browse files Browse the repository at this point in the history
  • Loading branch information
hungpham2511 committed Jul 17, 2022
1 parent b8ffb2b commit 34397d1
Showing 1 changed file with 33 additions and 1 deletion.
34 changes: 33 additions & 1 deletion cpp/src/toppra/geometric_path/piecewise_poly_path.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,44 @@ class PiecewisePolyPath : public GeometricPath {
void deserialize(std::istream &I) override;

/**
* \brief Construct a new Hermite polynomial.
* @brief Construct a piecewise Cubic Hermite polynomial.
*
* See https://en.wikipedia.org/wiki/Cubic_Hermite_spline for a good
* description of this interplation scheme.
*
* This function is implemented based on scipy.interpolate.CubicHermiteSpline.
*
* Note that path generates by this function is not guaranteed to have
* continuous acceleration, or the path second-order derivative.
*
* @param positions Robot joints corresponding to the given times. Must have
* the same size as times.
* @param velocities Robot joint velocities.
* @param times Path positions or times. This is the independent variable.
* @return PiecewisePolyPath
*/
static PiecewisePolyPath constructHermite(const Vectors &positions,
const Vectors &velocities,
const std::vector<value_type> times);

/**
* @brief Construct a cubic spline.
*
* Interpolate the given joint positions with a spline that is twice
* continuously differentiable. This means the position, velocity and
* acceleration are guaranteed to be continous but not jerk.
*
* This method is modelled after scipy.interpolate.CubicSpline.
*
* @param positions Robot joints corresponding to the given times.
* @param times Path positions or times. This is the independent variable.
* @param bc_type Boundary condition.
* @return PiecewisePolyPath
*/
static PiecewisePolyPath CubicSpline(const Vectors &positions, const Vector &times, const std::array<BoundaryCond, 2> &bc_type){
return PiecewisePolyPath(positions, times, bc_type);
}

protected:
void initAsHermite(const Vectors &positions, const Vectors &velocities,
const std::vector<value_type> times);
Expand Down

0 comments on commit 34397d1

Please sign in to comment.