diff --git a/include/curves/bernstein.h b/include/curves/bernstein.h index 800ac3447c861899370eca24181d370e7ae03482..86eb3ab6932dbd82e91bfedc8a9c89ebf1de8d48 100644 --- a/include/curves/bernstein.h +++ b/include/curves/bernstein.h @@ -20,7 +20,6 @@ namespace curves { -/// /// \brief Computes factorial of a number. /// inline unsigned int fact(const unsigned int n) @@ -31,7 +30,6 @@ inline unsigned int fact(const unsigned int n) return res; } -/// /// \brief Computes a binomal coefficient. /// inline unsigned int bin(const unsigned int n, const unsigned int k) @@ -62,8 +60,6 @@ Numeric i_; Numeric bin_m_i_; }; - -/// /// \brief Computes all Bernstein polynomes for a certain degree. /// template <typename Numeric> diff --git a/include/curves/bezier_curve.h b/include/curves/bezier_curve.h index d5d6bf124e435bf0d8d94ba10394793be2ffa11f..45f50d6c05b1b71507c27a924f5a4326a600d88d 100644 --- a/include/curves/bezier_curve.h +++ b/include/curves/bezier_curve.h @@ -93,7 +93,7 @@ struct bezier_curve : public curve_abc<Time, Numeric, Dim, Safe, Point> /// \param PointsBegin : an iterator pointing to the first element of a control point container. /// \param PointsEnd : an iterator pointing to the last element of a control point container. /// \param T : upper bound of time which is between \f$[0;T]\f$ (default \f$[0;1]\f$). - /// \param mult_T : + /// \param mult_T : ... (default value is 1.0). /// template<typename In> bezier_curve(In PointsBegin, In PointsEnd, const time_t T, const time_t mult_T) @@ -180,7 +180,7 @@ struct bezier_curve : public curve_abc<Time, Numeric, Dim, Safe, Point> /// Computes the primitive at order N of bezier curve of parametric equation \f$x(t)\f$. At order \f$N=1\f$, /// the primitve \f$X(t)\f$ of \f$x(t)\f$ is such as \f$\frac{dX(t)}{dt} = x(t)\f$. /// \param order : order of the primitive. - /// \return Primitive of x(t). + /// \return Primitive at order N of x(t). bezier_curve_t compute_primitive(const std::size_t order) const { if(order == 0) return *this; diff --git a/include/curves/bezier_polynom_conversion.h b/include/curves/bezier_polynom_conversion.h index 47b83c6ea8726a622babae428a1b1904ca105cc5..d70523c551ad9075737cf5f7f0a95011b1ce5965 100644 --- a/include/curves/bezier_polynom_conversion.h +++ b/include/curves/bezier_polynom_conversion.h @@ -51,7 +51,7 @@ Polynom from_bezier(const Bezier& curve) } ///\brief Converts a polynom to a Bezier curve. -///\param polynom: the polynom to convert. +///\param polynom : the polynom to convert. ///\return The equivalent Bezier curve. /*template<typename Bezier, typename Polynom> Bezier from_polynom(const Polynom& polynom) diff --git a/include/curves/curve_abc.h b/include/curves/curve_abc.h index 55d45a5dac0daabe2164b32c64eb011e37d72cc7..c0306e73f71f86eb4472a20a54365f0f1b02dad4 100644 --- a/include/curves/curve_abc.h +++ b/include/curves/curve_abc.h @@ -45,18 +45,20 @@ struct curve_abc : std::unary_function<Time, Point> virtual point_t operator()(const time_t t) const = 0; - /// \brief Evaluation of the derivative spline at time t. - /// \param t : time when to evaluate the spline. - /// \param order : order of the derivative. - /// \return Point corresponding on curve at time t. + /// \brief Evaluation of the derivative spline at time t. + /// \param t : time when to evaluate the spline. + /// \param order : order of the derivative. + /// \return Point corresponding on curve at time t. virtual point_t derivate(const time_t t, const std::size_t order) const = 0; /*Operations*/ /*Helpers*/ public: - /// \brief Returns the minimum time for wich curve is defined + /// \brief Returns the minimum time for wich curve is defined + /// \return Lower bound of time range. virtual time_t min() const = 0; - /// \brief Returns the maximum time for wich curve is defined + /// \brief Returns the maximum time for wich curve is defined + /// \return Upper bound of time range. virtual time_t max() const = 0; std::pair<time_t, time_t> timeRange() {return std::make_pair(min(), max());} diff --git a/include/curves/curve_constraint.h b/include/curves/curve_constraint.h index d3710c9fb40e396bce15fcc55989d7f2bb074623..eb88d1cd7026a9ea65aead04ddc442ecd932a911 100644 --- a/include/curves/curve_constraint.h +++ b/include/curves/curve_constraint.h @@ -26,11 +26,12 @@ struct curve_constraints curve_constraints(): init_vel(point_t::Zero()),init_acc(init_vel),end_vel(init_vel),end_acc(init_vel){} - ~curve_constraints(){} - point_t init_vel; - point_t init_acc; - point_t end_vel; - point_t end_acc; + ~curve_constraints(){} + + point_t init_vel; + point_t init_acc; + point_t end_vel; + point_t end_acc; }; } // namespace curves #endif //_CLASS_CUBICZEROVELACC diff --git a/include/curves/helpers/effector_spline.h b/include/curves/helpers/effector_spline.h index 9d9cd4216a63b14c83515aa334203cabbbcb68de..6e26d6b85248c30b8a9ea79e87dcb6fd342243eb 100644 --- a/include/curves/helpers/effector_spline.h +++ b/include/curves/helpers/effector_spline.h @@ -38,20 +38,19 @@ typedef spline_deriv_constraint_t::exact_cubic_t exact_cubic_t; typedef spline_deriv_constraint_t::t_spline_t t_spline_t; typedef spline_deriv_constraint_t::spline_t spline_t; +/// \brief Compute time such that the equation from source to offsetpoint is necessarily a line. Waypoint compute_offset(const Waypoint& source, const Point& normal, const Numeric offset, const Time time_offset) { - //compute time such that the equation from source to offsetpoint is necessarily a line Numeric norm = normal.norm(); assert(norm>0.); return std::make_pair(source.first + time_offset,(source.second + normal / norm* offset)); } - +/// \brief Compute spline from land way point to end point. +/// Constraints are null velocity and acceleration. spline_t make_end_spline(const Point& normal, const Point& from, const Numeric offset, const Time init_time, const Time time_offset) { - // compute spline from land way point to end point - // constraints are null velocity and acceleration Numeric norm = normal.norm(); assert(norm>0.); Point n = normal / norm; @@ -68,9 +67,9 @@ spline_t make_end_spline(const Point& normal, const Point& from, const Numeric o return spline_t(points.begin(), points.end(), init_time, init_time+time_offset); } +/// \brief Compute end velocity : along landing normal and respecting time. spline_constraints_t compute_required_offset_velocity_acceleration(const spline_t& end_spline, const Time /*time_offset*/) { - //computing end velocity: along landing normal and respecting time spline_constraints_t constraints; constraints.end_acc = end_spline.derivate(end_spline.min(),2); constraints.end_vel = end_spline.derivate(end_spline.min(),1); diff --git a/include/curves/helpers/effector_spline_rotation.h b/include/curves/helpers/effector_spline_rotation.h index 9d7ff42239394273ba0bd11ffa70678f79db0c10..44fccfe1659d3ea72003b2dfabfeb82cc71e5893 100644 --- a/include/curves/helpers/effector_spline_rotation.h +++ b/include/curves/helpers/effector_spline_rotation.h @@ -80,9 +80,9 @@ class rotation_spline: public curve_abc_quat_t throw std::runtime_error("TODO quaternion spline does not implement derivate"); } + /// \brief Initialize time reparametrization for spline. spline_deriv_constraint_one_dim computeWayPoints() const { - // initializing time reparametrization for spline t_waypoint_one_dim_t waypoints; waypoints.push_back(std::make_pair(0,point_one_dim_t::Zero())); waypoints.push_back(std::make_pair(1,point_one_dim_t::Ones()));