Commit a434b747 authored by JasonChmn's avatar JasonChmn
Browse files

Edit namespace, folder, file names from curve to curves

parent 5d290de4
...@@ -37,7 +37,7 @@ ENDIF(BUILD_PYTHON_INTERFACE) ...@@ -37,7 +37,7 @@ ENDIF(BUILD_PYTHON_INTERFACE)
SEARCH_FOR_BOOST() SEARCH_FOR_BOOST()
INCLUDE_DIRECTORIES(SYSTEM ${Boost_INCLUDE_DIRS}) INCLUDE_DIRECTORIES(SYSTEM ${Boost_INCLUDE_DIRS})
ADD_SUBDIRECTORY(include/curve) ADD_SUBDIRECTORY(include/curves)
ADD_SUBDIRECTORY(tests) ADD_SUBDIRECTORY(tests)
SETUP_HPP_PROJECT_FINALIZE() SETUP_HPP_PROJECT_FINALIZE()
Subproject commit 61e5574a0615706aab06986f6aecf665ddc31141 Subproject commit cea261e3da7d383844530070356bca76d20197a8
...@@ -15,7 +15,7 @@ SET(${PROJECT_NAME}_HEADERS ...@@ -15,7 +15,7 @@ SET(${PROJECT_NAME}_HEADERS
INSTALL(FILES INSTALL(FILES
${${PROJECT_NAME}_HEADERS} ${${PROJECT_NAME}_HEADERS}
DESTINATION include/curve DESTINATION include/curves
) )
ADD_SUBDIRECTORY(helpers) ADD_SUBDIRECTORY(helpers)
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
#include <vector> #include <vector>
#include <utility> #include <utility>
namespace curve{ namespace curves{
//REF: boulic et al An inverse kinematics architecture enforcing an arbitrary number of strict priority levels //REF: boulic et al An inverse kinematics architecture enforcing an arbitrary number of strict priority levels
template<typename _Matrix_Type_> template<typename _Matrix_Type_>
...@@ -40,5 +40,5 @@ void PseudoInverse(_Matrix_Type_& pinvmat) ...@@ -40,5 +40,5 @@ void PseudoInverse(_Matrix_Type_& pinvmat)
pinvmat = (svd.matrixV()*m_sigma_inv*svd.matrixU().transpose()); pinvmat = (svd.matrixV()*m_sigma_inv*svd.matrixU().transpose());
} }
} // namespace curve } // namespace curves
#endif //_SPLINEMATH #endif //_SPLINEMATH
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
#include <vector> #include <vector>
#include <stdexcept> #include <stdexcept>
namespace curve namespace curves
{ {
/// ///
/// \brief Computes factorial of a number. /// \brief Computes factorial of a number.
...@@ -74,6 +74,6 @@ std::vector<Bern<Numeric> > makeBernstein(const unsigned int n) ...@@ -74,6 +74,6 @@ std::vector<Bern<Numeric> > makeBernstein(const unsigned int n)
res.push_back(Bern<Numeric>(n, i)); res.push_back(Bern<Numeric>(n, i));
return res; return res;
} }
} // namespace curve } // namespace curves
#endif //_CLASS_BERNSTEIN #endif //_CLASS_BERNSTEIN
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
#include <iostream> #include <iostream>
namespace curve namespace curves
{ {
/// \class BezierCurve. /// \class BezierCurve.
/// \brief Represents a Bezier curve of arbitrary dimension and order. /// \brief Represents a Bezier curve of arbitrary dimension and order.
...@@ -54,7 +54,7 @@ struct bezier_curve : public curve_abc<Time, Numeric, Dim, Safe, Point> ...@@ -54,7 +54,7 @@ struct bezier_curve : public curve_abc<Time, Numeric, Dim, Safe, Point>
, mult_T_(1.) , mult_T_(1.)
, size_(std::distance(PointsBegin, PointsEnd)) , size_(std::distance(PointsBegin, PointsEnd))
, degree_(size_-1) , degree_(size_-1)
, bernstein_(curve::makeBernstein<num_t>((unsigned int)degree_)) , bernstein_(curves::makeBernstein<num_t>((unsigned int)degree_))
{ {
assert(bernstein_.size() == size_); assert(bernstein_.size() == size_);
In it(PointsBegin); In it(PointsBegin);
...@@ -76,7 +76,7 @@ struct bezier_curve : public curve_abc<Time, Numeric, Dim, Safe, Point> ...@@ -76,7 +76,7 @@ struct bezier_curve : public curve_abc<Time, Numeric, Dim, Safe, Point>
, mult_T_(1.) , mult_T_(1.)
, size_(std::distance(PointsBegin, PointsEnd)) , size_(std::distance(PointsBegin, PointsEnd))
, degree_(size_-1) , degree_(size_-1)
, bernstein_(curve::makeBernstein<num_t>((unsigned int)degree_)) , bernstein_(curves::makeBernstein<num_t>((unsigned int)degree_))
{ {
assert(bernstein_.size() == size_); assert(bernstein_.size() == size_);
In it(PointsBegin); In it(PointsBegin);
...@@ -101,7 +101,7 @@ struct bezier_curve : public curve_abc<Time, Numeric, Dim, Safe, Point> ...@@ -101,7 +101,7 @@ struct bezier_curve : public curve_abc<Time, Numeric, Dim, Safe, Point>
, mult_T_(mult_T) , mult_T_(mult_T)
, size_(std::distance(PointsBegin, PointsEnd)) , size_(std::distance(PointsBegin, PointsEnd))
, degree_(size_-1) , degree_(size_-1)
, bernstein_(curve::makeBernstein<num_t>((unsigned int)degree_)) , bernstein_(curves::makeBernstein<num_t>((unsigned int)degree_))
{ {
assert(bernstein_.size() == size_); assert(bernstein_.size() == size_);
In it(PointsBegin); In it(PointsBegin);
...@@ -124,7 +124,7 @@ struct bezier_curve : public curve_abc<Time, Numeric, Dim, Safe, Point> ...@@ -124,7 +124,7 @@ struct bezier_curve : public curve_abc<Time, Numeric, Dim, Safe, Point>
, mult_T_(1.) , mult_T_(1.)
, size_(std::distance(PointsBegin, PointsEnd)+4) , size_(std::distance(PointsBegin, PointsEnd)+4)
, degree_(size_-1) , degree_(size_-1)
, bernstein_(curve::makeBernstein<num_t>((unsigned int)degree_)) , bernstein_(curves::makeBernstein<num_t>((unsigned int)degree_))
{ {
if(Safe && (size_<1 || T_ <= 0.)) if(Safe && (size_<1 || T_ <= 0.))
throw std::out_of_range("can't create bezier min bound is higher than max bound"); throw std::out_of_range("can't create bezier min bound is higher than max bound");
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
#include <iostream> #include <iostream>
namespace curve namespace curves
{ {
/// \brief Provides methods for converting a curve from a bernstein representation /// \brief Provides methods for converting a curve from a bernstein representation
/// to a polynom representation. /// to a polynom representation.
...@@ -64,6 +64,6 @@ Bezier from_polynom(const Polynom& polynom) ...@@ -64,6 +64,6 @@ Bezier from_polynom(const Polynom& polynom)
typedef Bezier::cit_point_t cit_point_t; typedef Bezier::cit_point_t cit_point_t;
typedef Bezier::bezier_curve_t bezier_curve_t; typedef Bezier::bezier_curve_t bezier_curve_t;
}*/ }*/
} // namespace curve } // namespace curves
#endif //_BEZIER_POLY_CONVERSION #endif //_BEZIER_POLY_CONVERSION
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
#include <stdexcept> #include <stdexcept>
namespace curve namespace curves
{ {
/// \brief Creates coefficient vector of a cubic spline defined on the interval /// \brief Creates coefficient vector of a cubic spline defined on the interval
/// \f$[t_{min}, t_{max}]\f$. It follows the equation : /// \f$[t_{min}, t_{max}]\f$. It follows the equation :
...@@ -41,6 +41,6 @@ polynom<Time,Numeric,Dim,Safe,Point,T_Point> create_cubic(Point const& a, Point ...@@ -41,6 +41,6 @@ polynom<Time,Numeric,Dim,Safe,Point,T_Point> create_cubic(Point const& a, Point
T_Point coeffs = make_cubic_vector<Point, T_Point>(a,b,c,d); T_Point coeffs = make_cubic_vector<Point, T_Point>(a,b,c,d);
return polynom<Time,Numeric,Dim,Safe,Point,T_Point>(coeffs.begin(),coeffs.end(), t_min, t_max); return polynom<Time,Numeric,Dim,Safe,Point,T_Point>(coeffs.begin(),coeffs.end(), t_min, t_max);
} }
} // namespace curve } // namespace curves
#endif //_STRUCT_CUBICSPLINE #endif //_STRUCT_CUBICSPLINE
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
#include <functional> #include <functional>
namespace curve namespace curves
{ {
/// \struct curve_abc /// \struct curve_abc
/// \brief Represents a curve of dimension Dim /// \brief Represents a curve of dimension Dim
...@@ -63,6 +63,6 @@ struct curve_abc : std::unary_function<Time, Point> ...@@ -63,6 +63,6 @@ struct curve_abc : std::unary_function<Time, Point>
/*Helpers*/ /*Helpers*/
}; };
} // namespace curve } // namespace curves
#endif //_STRUCT_CURVE_ABC #endif //_STRUCT_CURVE_ABC
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
#include <functional> #include <functional>
#include <vector> #include <vector>
namespace curve namespace curves
{ {
template <typename Point> template <typename Point>
struct curve_constraints struct curve_constraints
...@@ -32,5 +32,5 @@ struct curve_constraints ...@@ -32,5 +32,5 @@ struct curve_constraints
point_t end_vel; point_t end_vel;
point_t end_acc; point_t end_acc;
}; };
} // namespace curve } // namespace curves
#endif //_CLASS_CUBICZEROVELACC #endif //_CLASS_CUBICZEROVELACC
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
#include <functional> #include <functional>
#include <vector> #include <vector>
namespace curve namespace curves
{ {
/// \class ExactCubic. /// \class ExactCubic.
/// \brief Represents a set of cubic splines defining a continuous function /// \brief Represents a set of cubic splines defining a continuous function
...@@ -201,6 +201,6 @@ struct exact_cubic : public curve_abc<Time, Numeric, Dim, Safe, Point> ...@@ -201,6 +201,6 @@ struct exact_cubic : public curve_abc<Time, Numeric, Dim, Safe, Point>
t_spline_t subSplines_; // const t_spline_t subSplines_; // const
/*Attributes*/ /*Attributes*/
}; };
} // namespace curve } // namespace curves
#endif //_CLASS_EXACTCUBIC #endif //_CLASS_EXACTCUBIC
...@@ -5,5 +5,5 @@ SET(${PROJECT_NAME}_HELPERS_HEADERS ...@@ -5,5 +5,5 @@ SET(${PROJECT_NAME}_HELPERS_HEADERS
INSTALL(FILES INSTALL(FILES
${${PROJECT_NAME}_HELPERS_HEADERS} ${${PROJECT_NAME}_HELPERS_HEADERS}
DESTINATION include/curve/helpers DESTINATION include/curves/helpers
) )
...@@ -20,9 +20,9 @@ ...@@ -20,9 +20,9 @@
#ifndef _CLASS_EFFECTORSPLINE #ifndef _CLASS_EFFECTORSPLINE
#define _CLASS_EFFECTORSPLINE #define _CLASS_EFFECTORSPLINE
#include "curve/spline_deriv_constraint.h" #include "curves/spline_deriv_constraint.h"
namespace curve namespace curves
{ {
namespace helpers namespace helpers
{ {
...@@ -118,5 +118,5 @@ exact_cubic_t* effector_spline( ...@@ -118,5 +118,5 @@ exact_cubic_t* effector_spline(
return new exact_cubic_t(splines); return new exact_cubic_t(splines);
} }
} // namespace helpers } // namespace helpers
} // namespace curve } // namespace curves
#endif //_CLASS_EFFECTORSPLINE #endif //_CLASS_EFFECTORSPLINE
...@@ -20,11 +20,11 @@ ...@@ -20,11 +20,11 @@
#ifndef _CLASS_EFFECTOR_SPLINE_ROTATION #ifndef _CLASS_EFFECTOR_SPLINE_ROTATION
#define _CLASS_EFFECTOR_SPLINE_ROTATION #define _CLASS_EFFECTOR_SPLINE_ROTATION
#include "curve/helpers/effector_spline.h" #include "curves/helpers/effector_spline.h"
#include "curve/curve_abc.h" #include "curves/curve_abc.h"
#include <Eigen/Geometry> #include <Eigen/Geometry>
namespace curve namespace curves
{ {
namespace helpers namespace helpers
{ {
...@@ -252,5 +252,5 @@ class effector_spline_rotation ...@@ -252,5 +252,5 @@ class effector_spline_rotation
}; };
} // namespace helpers } // namespace helpers
} // namespace curve } // namespace curves
#endif //_CLASS_EFFECTOR_SPLINE_ROTATION #endif //_CLASS_EFFECTOR_SPLINE_ROTATION
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
#include <Eigen/Core> #include <Eigen/Core>
#include <stdexcept> #include <stdexcept>
namespace curve namespace curves
{ {
template <int Dim, typename Numeric=double> template <int Dim, typename Numeric=double>
struct linear_variable{ struct linear_variable{
...@@ -196,6 +196,6 @@ variables<V> operator/(const variables<V>& w,const double k) ...@@ -196,6 +196,6 @@ variables<V> operator/(const variables<V>& w,const double k)
return res; return res;
} }
} // namespace curve } // namespace curves
#endif //_CLASS_LINEAR_VARIABLE #endif //_CLASS_LINEAR_VARIABLE
...@@ -12,15 +12,15 @@ ...@@ -12,15 +12,15 @@
#ifndef _CLASS_SPLINEOPTIMIZER #ifndef _CLASS_SPLINEOPTIMIZER
#define _CLASS_SPLINEOPTIMIZER #define _CLASS_SPLINEOPTIMIZER
#include "curve/MathDefs.h" #include "curves/MathDefs.h"
#include "curve/exact_cubic.h" #include "curves/exact_cubic.h"
#include "mosek/mosek.h" #include "mosek/mosek.h"
#include <Eigen/SparseCore> #include <Eigen/SparseCore>
#include <utility> #include <utility>
namespace curve namespace curves
{ {
/// \class SplineOptimizer /// \class SplineOptimizer
/// \brief Mosek connection to produce optimized splines /// \brief Mosek connection to produce optimized splines
...@@ -516,5 +516,5 @@ inline exact_cubic<Time, Numeric, Dim, Safe, Point>* ...@@ -516,5 +516,5 @@ inline exact_cubic<Time, Numeric, Dim, Safe, Point>*
return res; return res;
} }
} // namespace curve } // namespace curves
#endif //_CLASS_SPLINEOPTIMIZER #endif //_CLASS_SPLINEOPTIMIZER
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
#include <functional> #include <functional>
#include <stdexcept> #include <stdexcept>
namespace curve namespace curves
{ {
/// \class polynom /// \class polynom
/// \brief Represents a polynomf arbitrary order defined on the interval /// \brief Represents a polynomf arbitrary order defined on the interval
...@@ -199,6 +199,6 @@ struct polynom : public curve_abc<Time, Numeric, Dim, Safe, Point> ...@@ -199,6 +199,6 @@ struct polynom : public curve_abc<Time, Numeric, Dim, Safe, Point>
return res; return res;
} }
}; //class polynom }; //class polynom
} // namespace curve } // namespace curves
#endif //_STRUCT_POLYNOM #endif //_STRUCT_POLYNOM
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
#include <stdexcept> #include <stdexcept>
namespace curve namespace curves
{ {
/// \brief Creates coefficient vector of a quintic spline defined on the interval /// \brief Creates coefficient vector of a quintic spline defined on the interval
/// \f$[t_{min}, t_{max}]\f$. It follows the equation : /// \f$[t_{min}, t_{max}]\f$. It follows the equation :
...@@ -44,6 +44,6 @@ polynom<Time,Numeric,Dim,Safe,Point,T_Point> create_quintic(Point const& a, Poin ...@@ -44,6 +44,6 @@ polynom<Time,Numeric,Dim,Safe,Point,T_Point> create_quintic(Point const& a, Poin
T_Point coeffs = make_quintic_vector<Point, T_Point>(a,b,c,d,e,f); T_Point coeffs = make_quintic_vector<Point, T_Point>(a,b,c,d,e,f);
return polynom<Time,Numeric,Dim,Safe,Point,T_Point>(coeffs.begin(),coeffs.end(), t_min, t_max); return polynom<Time,Numeric,Dim,Safe,Point,T_Point>(coeffs.begin(),coeffs.end(), t_min, t_max);
} }
} // namespace curve } // namespace curves
#endif //_STRUCT_QUINTIC_SPLINE #endif //_STRUCT_QUINTIC_SPLINE
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
#include <functional> #include <functional>
#include <vector> #include <vector>
namespace curve namespace curves
{ {
/// \class spline_deriv_constraint. /// \class spline_deriv_constraint.
/// \brief Represents a set of cubic splines defining a continuous function /// \brief Represents a set of cubic splines defining a continuous function
...@@ -137,6 +137,6 @@ struct spline_deriv_constraint : public exact_cubic<Time, Numeric, Dim, Safe, Po ...@@ -137,6 +137,6 @@ struct spline_deriv_constraint : public exact_cubic<Time, Numeric, Dim, Safe, Po
private: private:
/* Constructors - destructors */ /* Constructors - destructors */
}; };
} // namespace curve } // namespace curves
#endif //_CLASS_CUBICZEROVELACC #endif //_CLASS_CUBICZEROVELACC
SET(${PY_NAME}_BINDINGS_SOURCES SET(${PY_NAME}_BINDINGS_SOURCES
curve_python.cpp curves_python.cpp
python_variables.cpp python_variables.cpp
python_variables.h python_variables.h
) )
...@@ -15,4 +15,4 @@ ENDIF(APPLE) ...@@ -15,4 +15,4 @@ ENDIF(APPLE)
INSTALL(TARGETS ${PY_NAME} DESTINATION ${PYTHON_SITELIB}) INSTALL(TARGETS ${PY_NAME} DESTINATION ${PYTHON_SITELIB})
ADD_PYTHON_UNIT_TEST("python-curve" "python/test/test.py" "python") ADD_PYTHON_UNIT_TEST("python-curves" "python/test/test.py" "python")
Markdown is supported
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