diff --git a/CMakeLists.txt b/CMakeLists.txt index c90b8af32fbfb6629f6439b2945b8ebb1c0d3f5d..799935d1ece8ccc340b7e0583cd7e5874e7fd786 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -33,7 +33,7 @@ IF(BUILD_PYTHON_INTERFACE) ENDIF(BUILD_PYTHON_INTERFACE) -ADD_SUBDIRECTORY(include/hpp/spline) +ADD_SUBDIRECTORY(include/hpp/curve) ADD_SUBDIRECTORY(tests) SETUP_HPP_PROJECT_FINALIZE() diff --git a/include/hpp/spline/CMakeLists.txt b/include/hpp/curve/CMakeLists.txt similarity index 90% rename from include/hpp/spline/CMakeLists.txt rename to include/hpp/curve/CMakeLists.txt index b417e3d2cbfec4e0f3955998bd44a9d3fb09e0dc..cfb0e7e352dc293143b0eb25a61107d0541b4bda 100644 --- a/include/hpp/spline/CMakeLists.txt +++ b/include/hpp/curve/CMakeLists.txt @@ -14,7 +14,7 @@ SET(${PROJECT_NAME}_HEADERS INSTALL(FILES ${${PROJECT_NAME}_HEADERS} - DESTINATION include/hpp/spline + DESTINATION include/hpp/curve ) ADD_SUBDIRECTORY(helpers) diff --git a/include/hpp/spline/MathDefs.h b/include/hpp/curve/MathDefs.h similarity index 93% rename from include/hpp/spline/MathDefs.h rename to include/hpp/curve/MathDefs.h index 4ded6adf6c0c0b3e71602f8e97ee68ee9d182144..94e8fa9f84a1c8777cb5f2118c976034d0a0d32e 100644 --- a/include/hpp/spline/MathDefs.h +++ b/include/hpp/curve/MathDefs.h @@ -20,8 +20,7 @@ #include <vector> #include <utility> - -namespace spline{ +namespace curve{ //REF: boulic et al An inverse kinematics architecture enforcing an arbitrary number of strict priority levels template<typename _Matrix_Type_> @@ -41,6 +40,6 @@ void PseudoInverse(_Matrix_Type_& pinvmat) pinvmat = (svd.matrixV()*m_sigma_inv*svd.matrixU().transpose()); } -} // namespace spline +} // namespace curve #endif //_SPLINEMATH diff --git a/include/hpp/spline/bernstein.h b/include/hpp/curve/bernstein.h similarity index 92% rename from include/hpp/spline/bernstein.h rename to include/hpp/curve/bernstein.h index ac93c24855635a0e82716da78a66f548755358a6..c96dd457ceade6eb871d6c7d50db340396d4ee2d 100644 --- a/include/hpp/spline/bernstein.h +++ b/include/hpp/curve/bernstein.h @@ -18,7 +18,7 @@ #include <vector> #include <stdexcept> -namespace spline +namespace curve { /// /// \brief Computes factorial of a number @@ -74,6 +74,6 @@ std::vector<Bern<Numeric> > makeBernstein(const unsigned int n) res.push_back(Bern<Numeric>(n, i)); return res; } -} // namespace spline +} // namespace curve #endif //_CLASS_BERNSTEIN diff --git a/include/hpp/spline/bezier_curve.h b/include/hpp/curve/bezier_curve.h similarity index 94% rename from include/hpp/spline/bezier_curve.h rename to include/hpp/curve/bezier_curve.h index c1e0e4b9460029c16cff57f5ecf3b1901d773ba2..b50e682587a3cf961bb3d3546df13c15900e4c92 100644 --- a/include/hpp/spline/bezier_curve.h +++ b/include/hpp/curve/bezier_curve.h @@ -21,7 +21,7 @@ #include <iostream> -namespace spline +namespace curve { /// \class BezierCurve /// \brief Represents a Bezier curve of arbitrary dimension and order. @@ -51,7 +51,7 @@ struct bezier_curve : public curve_abc<Time, Numeric, Dim, Safe, Point> , mult_T_(1.) , size_(std::distance(PointsBegin, PointsEnd)) , degree_(size_-1) - , bernstein_(spline::makeBernstein<num_t>((unsigned int)degree_)) + , bernstein_(curve::makeBernstein<num_t>((unsigned int)degree_)) { assert(bernstein_.size() == size_); In it(PointsBegin); @@ -70,7 +70,7 @@ struct bezier_curve : public curve_abc<Time, Numeric, Dim, Safe, Point> , mult_T_(1.) , size_(std::distance(PointsBegin, PointsEnd)) , degree_(size_-1) - , bernstein_(spline::makeBernstein<num_t>((unsigned int)degree_)) + , bernstein_(curve::makeBernstein<num_t>((unsigned int)degree_)) { assert(bernstein_.size() == size_); In it(PointsBegin); @@ -91,7 +91,7 @@ struct bezier_curve : public curve_abc<Time, Numeric, Dim, Safe, Point> , mult_T_(mult_T) , size_(std::distance(PointsBegin, PointsEnd)) , degree_(size_-1) - , bernstein_(spline::makeBernstein<num_t>((unsigned int)degree_)) + , bernstein_(curve::makeBernstein<num_t>((unsigned int)degree_)) { assert(bernstein_.size() == size_); In it(PointsBegin); @@ -113,7 +113,7 @@ struct bezier_curve : public curve_abc<Time, Numeric, Dim, Safe, Point> , mult_T_(1.) , size_(std::distance(PointsBegin, PointsEnd)+4) , degree_(size_-1) - , bernstein_(spline::makeBernstein<num_t>((unsigned int)degree_)) + , bernstein_(curve::makeBernstein<num_t>((unsigned int)degree_)) { if(Safe && (size_<1 || T_ <= 0.)) throw std::out_of_range("can't create bezier min bound is higher than max bound"); diff --git a/include/hpp/spline/bezier_polynom_conversion.h b/include/hpp/curve/bezier_polynom_conversion.h similarity index 95% rename from include/hpp/spline/bezier_polynom_conversion.h rename to include/hpp/curve/bezier_polynom_conversion.h index 2a4b5acc6991b98caac5ff5a2a8b317087408ac5..47691088e783936ac48b171b804689766db70516 100644 --- a/include/hpp/spline/bezier_polynom_conversion.h +++ b/include/hpp/curve/bezier_polynom_conversion.h @@ -21,7 +21,7 @@ #include <iostream> -namespace spline +namespace curve { /// \brief Provides methods for converting a curve from a bernstein representation /// to a polynom representation diff --git a/include/hpp/spline/cubic_spline.h b/include/hpp/curve/cubic_spline.h similarity index 95% rename from include/hpp/spline/cubic_spline.h rename to include/hpp/curve/cubic_spline.h index 016c54d7a7b16c561abd45bb93b7639dc668b1d1..ba4ce112e416fe77a4aae110ee5ff22df13bc5ba 100644 --- a/include/hpp/spline/cubic_spline.h +++ b/include/hpp/curve/cubic_spline.h @@ -20,7 +20,7 @@ #include <stdexcept> -namespace spline +namespace curve { /// \brief Creates coefficient vector of a cubic spline defined on the interval /// [tBegin, tEnd]. It follows the equation diff --git a/include/hpp/spline/curve_abc.h b/include/hpp/curve/curve_abc.h similarity index 95% rename from include/hpp/spline/curve_abc.h rename to include/hpp/curve/curve_abc.h index 7a8dccaf183075de4cde6032f475a26bad64342e..16575a94f7804507edf6a509fab525a101068847 100644 --- a/include/hpp/spline/curve_abc.h +++ b/include/hpp/curve/curve_abc.h @@ -16,7 +16,7 @@ #include <functional> -namespace spline +namespace curve { /// \struct curve_abc /// \brief Represents a curve of dimension Dim diff --git a/include/hpp/spline/curve_constraint.h b/include/hpp/curve/curve_constraint.h similarity index 97% rename from include/hpp/spline/curve_constraint.h rename to include/hpp/curve/curve_constraint.h index af79b73129cb6a5dacc5d8b0eca27837925c7905..6207aca040a72bd35de652ebdedf51cc3edd43c4 100644 --- a/include/hpp/spline/curve_constraint.h +++ b/include/hpp/curve/curve_constraint.h @@ -17,7 +17,7 @@ #include <functional> #include <vector> -namespace spline +namespace curve { template <typename Point> struct curve_constraints diff --git a/include/hpp/spline/exact_cubic.h b/include/hpp/curve/exact_cubic.h similarity index 97% rename from include/hpp/spline/exact_cubic.h rename to include/hpp/curve/exact_cubic.h index 550709c37371ac0b4ebb48eb39aa47ead8b8febe..6e30d296af24cd30abafb87f10d9b48ec9ac344e 100644 --- a/include/hpp/spline/exact_cubic.h +++ b/include/hpp/curve/exact_cubic.h @@ -29,7 +29,7 @@ #include <functional> #include <vector> -namespace spline +namespace curve { /// \class ExactCubic /// \brief Represents a set of cubic splines defining a continuous function diff --git a/include/hpp/spline/helpers/CMakeLists.txt b/include/hpp/curve/helpers/CMakeLists.txt similarity index 77% rename from include/hpp/spline/helpers/CMakeLists.txt rename to include/hpp/curve/helpers/CMakeLists.txt index 737295b2636e4d6f74d54ec1f660ffefb75286a4..bdcafa764979fefc31fc22dd3a952504adee3205 100644 --- a/include/hpp/spline/helpers/CMakeLists.txt +++ b/include/hpp/curve/helpers/CMakeLists.txt @@ -5,5 +5,5 @@ SET(${PROJECT_NAME}_HELPERS_HEADERS INSTALL(FILES ${${PROJECT_NAME}_HELPERS_HEADERS} - DESTINATION include/hpp/spline/helpers + DESTINATION include/hpp/curve/helpers ) diff --git a/include/hpp/spline/helpers/effector_spline.h b/include/hpp/curve/helpers/effector_spline.h similarity index 98% rename from include/hpp/spline/helpers/effector_spline.h rename to include/hpp/curve/helpers/effector_spline.h index 0f286d3bc5b86f62da8d4a266ad2fe8a0812bc51..5d1ef2096332f9cac702204f318aec2885405474 100644 --- a/include/hpp/spline/helpers/effector_spline.h +++ b/include/hpp/curve/helpers/effector_spline.h @@ -20,9 +20,9 @@ #ifndef _CLASS_EFFECTORSPLINE #define _CLASS_EFFECTORSPLINE -#include "hpp/spline/spline_deriv_constraint.h" +#include "hpp/curve/spline_deriv_constraint.h" -namespace spline +namespace curve { namespace helpers { diff --git a/include/hpp/spline/helpers/effector_spline_rotation.h b/include/hpp/curve/helpers/effector_spline_rotation.h similarity index 98% rename from include/hpp/spline/helpers/effector_spline_rotation.h rename to include/hpp/curve/helpers/effector_spline_rotation.h index 508716228558c283c70c7f515a2bf40126531d2c..c08939e593e09e12d280d6f490b6667cab3ed6c2 100644 --- a/include/hpp/spline/helpers/effector_spline_rotation.h +++ b/include/hpp/curve/helpers/effector_spline_rotation.h @@ -20,11 +20,11 @@ #ifndef _CLASS_EFFECTOR_SPLINE_ROTATION #define _CLASS_EFFECTOR_SPLINE_ROTATION -#include "hpp/spline/helpers/effector_spline.h" -#include "hpp/spline/curve_abc.h" +#include "hpp/curve/helpers/effector_spline.h" +#include "hpp/curve/curve_abc.h" #include <Eigen/Geometry> -namespace spline +namespace curve { namespace helpers { @@ -252,5 +252,5 @@ class effector_spline_rotation }; } // namespace helpers -} // namespace spline +} // namespace curve #endif //_CLASS_EFFECTOR_SPLINE_ROTATION diff --git a/include/hpp/spline/optimization/OptimizeSpline.h b/include/hpp/curve/optimization/OptimizeSpline.h similarity index 99% rename from include/hpp/spline/optimization/OptimizeSpline.h rename to include/hpp/curve/optimization/OptimizeSpline.h index a5425b10bc92c6497814c89228fcf58eac38f019..a7d9e161993cbaa69f1e769474bea4d757d26eb3 100644 --- a/include/hpp/spline/optimization/OptimizeSpline.h +++ b/include/hpp/curve/optimization/OptimizeSpline.h @@ -12,15 +12,15 @@ #ifndef _CLASS_SPLINEOPTIMIZER #define _CLASS_SPLINEOPTIMIZER -#include "spline/MathDefs.h" -#include "spline/exact_cubic.h" +#include "curve/MathDefs.h" +#include "curve/exact_cubic.h" #include "mosek/mosek.h" #include <Eigen/SparseCore> #include <utility> -namespace spline +namespace curve { /// \class SplineOptimizer /// \brief Mosek connection to produce optimized splines @@ -516,5 +516,5 @@ inline exact_cubic<Time, Numeric, Dim, Safe, Point>* return res; } -} // namespace spline +} // namespace curve #endif //_CLASS_SPLINEOPTIMIZER diff --git a/include/hpp/spline/polynom.h b/include/hpp/curve/polynom.h similarity index 96% rename from include/hpp/spline/polynom.h rename to include/hpp/curve/polynom.h index 32c8aad06b92769015b660ed1e85402423561d1e..635b4901900b4abab46c2026f244a19a3d468f95 100644 --- a/include/hpp/spline/polynom.h +++ b/include/hpp/curve/polynom.h @@ -23,7 +23,7 @@ #include <functional> #include <stdexcept> -namespace spline +namespace curve { /// \class polynom /// \brief Represents a polynomf arbitrary order defined on the interval diff --git a/include/hpp/spline/quintic_spline.h b/include/hpp/curve/quintic_spline.h similarity index 95% rename from include/hpp/spline/quintic_spline.h rename to include/hpp/curve/quintic_spline.h index ae14e4d4d62f5a2467ec9160cbfb307532265b69..a6604fcbb4348a05e2f58f9e7cf88b019d1825b7 100644 --- a/include/hpp/spline/quintic_spline.h +++ b/include/hpp/curve/quintic_spline.h @@ -20,7 +20,7 @@ #include <stdexcept> -namespace spline +namespace curve { /// \brief Creates coefficient vector of a quintic spline defined on the interval /// [tBegin, tEnd]. It follows the equation diff --git a/include/hpp/spline/spline_deriv_constraint.h b/include/hpp/curve/spline_deriv_constraint.h similarity index 97% rename from include/hpp/spline/spline_deriv_constraint.h rename to include/hpp/curve/spline_deriv_constraint.h index 398b6973df439c672c611be3f014e424684f2812..f80de288a1ade0cc7c9f6ea873e0a14fd77b47af 100644 --- a/include/hpp/spline/spline_deriv_constraint.h +++ b/include/hpp/curve/spline_deriv_constraint.h @@ -28,7 +28,7 @@ #include <functional> #include <vector> -namespace spline +namespace curve { /// \class spline_deriv_constraint. /// \brief Represents a set of cubic splines defining a continuous function