Commit aefa6394 by Steve T

### ndcurves is the final name

parent b1e1168a
 ... ... @@ -22,7 +22,7 @@ #include #include namespace nd_curves { namespace ndcurves { /// \class polynomial. /// \brief Represents a polynomial of an arbitrary order defined on the interval /// \f\$[t_{min}, t_{max}]\f\$. It follows the equation :
... ... @@ -295,7 +295,7 @@ struct polynomial : public curve_abc { * @return true is the two curves are approximately equals */ bool isApprox(const polynomial_t& other, const Numeric prec = Eigen::NumTraits::dummy_precision()) const { return nd_curves::isApprox(T_min_, other.min()) && nd_curves::isApprox(T_max_, other.max()) && return ndcurves::isApprox(T_min_, other.min()) && ndcurves::isApprox(T_max_, other.max()) && dim_ == other.dim() && degree_ == other.degree() && coefficients_.isApprox(other.coefficients_, prec); } ... ... @@ -471,7 +471,7 @@ struct polynomial : public curve_abc { } // remove last degrees is they are equal to 0 long final_degree = new_degree; while(nCoeffs.col(final_degree).norm() <= nd_curves::MARGIN && final_degree >0){ while(nCoeffs.col(final_degree).norm() <= ndcurves::MARGIN && final_degree >0){ --final_degree; } return polynomial_t(nCoeffs.leftCols(final_degree+1), min(), max()); ... ... @@ -495,7 +495,7 @@ struct polynomial : public curve_abc { } // remove last degrees is they are equal to 0 long final_degree = degree(); while(nCoeffs.col(final_degree).norm() <= nd_curves::MARGIN && final_degree >0){ while(nCoeffs.col(final_degree).norm() <= ndcurves::MARGIN && final_degree >0){ --final_degree; } return polynomial_t(nCoeffs.leftCols(final_degree+1), min(), max()); ... ... @@ -511,7 +511,7 @@ struct polynomial : public curve_abc { private: void assert_operator_compatible(const polynomial_t& other) const{ if ((fabs(min() - other.min()) > nd_curves::MARGIN) || (fabs(max() - other.max()) > nd_curves::MARGIN) || dim() != other.dim()){ if ((fabs(min() - other.min()) > ndcurves::MARGIN) || (fabs(max() - other.max()) > ndcurves::MARGIN) || dim() != other.dim()){ throw std::invalid_argument("Can't perform base operation (+ - ) on two polynomials with different time ranges or different dimensions"); } } ... ... @@ -608,8 +608,8 @@ polynomial operator*(const double k, const polynomial& p return res*=k; } } // namespace nd_curves } // namespace ndcurves DEFINE_CLASS_TEMPLATE_VERSION(SINGLE_ARG(typename Time, typename Numeric, bool Safe, typename Point, typename T_Point), SINGLE_ARG(nd_curves::polynomial)) SINGLE_ARG(ndcurves::polynomial)) #endif //_STRUCT_POLYNOMIAL
 #include "nd_curves/fwd.h" #include "nd_curves/bezier_curve.h" #include "nd_curves/polynomial.h" #include "nd_curves/linear_variable.h" #include "nd_curves/quadratic_variable.h" #include "ndcurves/fwd.h" #include "ndcurves/bezier_curve.h" #include "ndcurves/polynomial.h" #include "ndcurves/linear_variable.h" #include "ndcurves/quadratic_variable.h" #include #ifndef _DEFINITION_PYTHON_BINDINGS #define _DEFINITION_PYTHON_BINDINGS namespace nd_curves { namespace ndcurves { /*** TEMPLATE SPECIALIZATION FOR PYTHON ****/ typedef double real; typedef std::vector t_time_t; ... ... @@ -19,8 +19,8 @@ typedef Eigen::Matrix ret_point typedef std::pair pair_pointX_tangent_t; typedef Eigen::MatrixXd pointX_list_t; typedef std::vector > t_pair_pointX_tangent_t; typedef nd_curves::curve_constraints curve_constraints_t; typedef nd_curves::curve_constraints curve_constraints3_t; typedef ndcurves::curve_constraints curve_constraints_t; typedef ndcurves::curve_constraints curve_constraints3_t; typedef std::pair waypoint_t; typedef std::vector t_waypoint_t; typedef Eigen::Matrix point_listX_t; ... ... @@ -28,7 +28,7 @@ typedef Eigen::Matrix point_list3_t; typedef Eigen::Matrix point_list6_t; typedef polynomial_t::coeff_t coeff_t; typedef nd_curves::Bern bernstein_t; typedef ndcurves::Bern bernstein_t; template T_Point vectorFromEigenArray(const PointList& array) { ... ... @@ -57,5 +57,5 @@ PointList vectorToEigenArray(const T_point& vect) { } return res; } } // namespace nd_curves } // namespace ndcurves #endif //_DEFINITION_PYTHON_BINDINGS
 ... ... @@ -9,8 +9,8 @@ #ifndef _CLASS_QUADRATIC_VARIABLE #define _CLASS_QUADRATIC_VARIABLE #include "nd_curves/curve_abc.h" #include "nd_curves/linear_variable.h" #include "ndcurves/curve_abc.h" #include "ndcurves/linear_variable.h" #include "MathDefs.h" ... ... @@ -19,7 +19,7 @@ #include #include namespace nd_curves { namespace ndcurves { template struct quadratic_variable { ... ... @@ -189,5 +189,5 @@ quadratic_variable operator/(const quadratic_variable& w, const double k) return res /= k; } } // namespace nd_curves } // namespace ndcurves #endif //_CLASS_QUADRATIC_VARIABLE
 ... ... @@ -8,7 +8,7 @@ #include #include namespace nd_curves { namespace ndcurves { /// \class SE3Curve. /// \brief Composition of a curve of any type of dimension 3 and a curve representing an rotation ... ... @@ -158,7 +158,7 @@ struct SE3Curve : public curve_abc::dummy_precision()) const { return nd_curves::isApprox(T_min_, other.min()) && nd_curves::isApprox(T_max_, other.max()) && return ndcurves::isApprox(T_min_, other.min()) && ndcurves::isApprox(T_max_, other.max()) && (translation_curve_ == other.translation_curve_ || translation_curve_->isApprox(other.translation_curve_.get(), prec)) && (rotation_curve_ == other.rotation_curve_ || rotation_curve_->isApprox(other.rotation_curve_.get(), prec)); ... ... @@ -256,9 +256,9 @@ struct SE3Curve : public curve_abc)) SINGLE_ARG(ndcurves::SE3Curve)) #endif // SE3_CURVE_H
 ... ... @@ -34,7 +34,7 @@ const unsigned int CURVES_API_VERSION = 1; } \ } namespace nd_curves { namespace ndcurves { namespace serialization { struct Serializable { private: ... ... @@ -135,6 +135,6 @@ struct Serializable { } // namespace serialization } // namespace nd_curves } // namespace ndcurves #endif // ifndef __multicontact_api_serialization_archive_hpp__
 ... ... @@ -7,22 +7,22 @@ /** * This file must be included by all classes containing * pointer of abstract curves as member and serializing them. * nd_curves::serialization::register_types(ar) must be called before serializing them. * ndcurves::serialization::register_types(ar) must be called before serializing them. */ #include #include #include "registeration.hpp" #include "nd_curves/curve_abc.h" #include "nd_curves/so3_linear.h" #include "nd_curves/se3_curve.h" #include "nd_curves/sinusoidal.h" #include "nd_curves/polynomial.h" #include "nd_curves/bezier_curve.h" #include "nd_curves/constant_curve.h" #include "nd_curves/piecewise_curve.h" #include "nd_curves/exact_cubic.h" #include "nd_curves/cubic_hermite_spline.h" #include "ndcurves/curve_abc.h" #include "ndcurves/so3_linear.h" #include "ndcurves/se3_curve.h" #include "ndcurves/sinusoidal.h" #include "ndcurves/polynomial.h" #include "ndcurves/bezier_curve.h" #include "ndcurves/constant_curve.h" #include "ndcurves/piecewise_curve.h" #include "ndcurves/exact_cubic.h" #include "ndcurves/cubic_hermite_spline.h" #endif // ifndef CURVES_SERIALIZAION
 ... ... @@ -18,7 +18,7 @@ #include #include #include "nd_curves/fwd.h" #include "ndcurves/fwd.h" /** *This file define a method register_types that ... ... @@ -26,7 +26,7 @@ * This is used to serialize pointer of the abstract class curve_abc */ namespace nd_curves { namespace ndcurves { namespace serialization { template ... ... @@ -53,6 +53,6 @@ void register_types(Archive& ar, const unsigned int version) { } } // namespace serialization } // namespace nd_curves } // namespace ndcurves #endif // CURVES_REGISTERATION_H
 ... ... @@ -12,7 +12,7 @@ #include "curve_abc.h" #include namespace nd_curves { namespace ndcurves { /// \class sinusoidal. /// \brief Represents a sinusoidal curve, evaluating the following equation: /// p0 + amplitude * (sin(2pi/T + phi) ... ... @@ -147,9 +147,9 @@ struct sinusoidal : public curve_abc { */ virtual bool isApprox(const sinusoidal_t& other, const Numeric prec = Eigen::NumTraits::dummy_precision()) const { return nd_curves::isApprox(T_min_, other.min()) && nd_curves::isApprox(T_max_, other.max()) && return ndcurves::isApprox(T_min_, other.min()) && ndcurves::isApprox(T_max_, other.max()) && dim_ == other.dim() && p0_.isApprox(other.p0_, prec) && amplitude_.isApprox(other.amplitude_, prec) && nd_curves::isApprox(T_, other.T_) && nd_curves::isApprox(phi_, other.phi_); ndcurves::isApprox(T_, other.T_) && ndcurves::isApprox(phi_, other.phi_); } virtual bool isApprox(const curve_abc_t* other, ... ... @@ -211,9 +211,9 @@ struct sinusoidal : public curve_abc { inline const num_t two_pi_f(const time_t& t) const { return (2 * M_PI / T_) * t; } }; // struct sinusoidal } // namespace nd_curves } // namespace ndcurves DEFINE_CLASS_TEMPLATE_VERSION(SINGLE_ARG(typename Time, typename Numeric, bool Safe, typename Point), SINGLE_ARG(nd_curves::sinusoidal)) SINGLE_ARG(ndcurves::sinusoidal)) #endif // _CLASS_SINUSOIDALCURVE
 ... ... @@ -11,7 +11,7 @@ #include #include namespace nd_curves { namespace ndcurves { /// \class SO3Linear. /// \brief Represents a linear interpolation in SO3, using the slerp method provided by Eigen::Quaternion ... ... @@ -128,7 +128,7 @@ struct SO3Linear : public curve_abc { * @return true is the two curves are approximately equals */ bool isApprox(const SO3Linear_t& other, const Numeric prec = Eigen::NumTraits::dummy_precision()) const { return nd_curves::isApprox(T_min_, other.min()) && nd_curves::isApprox(T_max_, other.max()) && return ndcurves::isApprox(T_min_, other.min()) && ndcurves::isApprox(T_max_, other.max()) && dim_ == other.dim() && init_rot_.toRotationMatrix().isApprox(other.init_rot_.toRotationMatrix(), prec) && end_rot_.toRotationMatrix().isApprox(other.end_rot_.toRotationMatrix(), prec); } ... ... @@ -300,9 +300,9 @@ struct SO3Linear : public curve_abc { }; // struct SO3Linear } // namespace nd_curves } // namespace ndcurves DEFINE_CLASS_TEMPLATE_VERSION(SINGLE_ARG(typename Time, typename Numeric, bool Safe), SINGLE_ARG(nd_curves::SO3Linear)) SINGLE_ARG(ndcurves::SO3Linear)) #endif // _STRUCT_SO3_LINEAR_H
 ... ... @@ -2,4 +2,4 @@ # Copyright (c) 2019 CNRS # Author : Steve Tonneau from .nd_curves import * # noqa from .ndcurves import * # noqa
 ... ... @@ -6,7 +6,7 @@ #include namespace nd_curves { namespace ndcurves { namespace bp = boost::python; template struct SerializableVisitor : public boost::python::def_visitor > { ... ... @@ -25,6 +25,6 @@ struct SerializableVisitor : public boost::python::def_visitor
 ... ... @@ -6,7 +6,7 @@ #include "python_variables.h" #include "archive_python_binding.h" #include "optimization_python.h" #include #include #include #include ... ... @@ -17,7 +17,7 @@ #include #include namespace nd_curves { namespace ndcurves { using namespace boost::python; /* base wrap of curve_abc and others parent abstract class: must implement all pure virtual methods */ ... ... @@ -509,7 +509,7 @@ sinusoidal_t* wrapSinusoidalConstructorStationary(const real time_traj, /* End wrap sinusoidal */ // TO DO : Replace all load and save function for serialization in class by using // SerializableVisitor in archive_python_binding. BOOST_PYTHON_MODULE(nd_curves) { BOOST_PYTHON_MODULE(ndcurves) { /** BEGIN eigenpy init**/ eigenpy::enableEigenPy(); ENABLE_SPECIFIC_MATRIX_TYPE(pointX_t); ... ... @@ -1306,4 +1306,4 @@ BOOST_PYTHON_MODULE(nd_curves) { #endif } // End BOOST_PYTHON_MODULE } // namespace nd_curves } // namespace ndcurves
 ... ... @@ -4,7 +4,7 @@ #include "namespace.h" namespace nd_curves { namespace ndcurves { namespace python { bp::object getOrCreatePythonNamespace(const std::string& submodule_name) { ... ... @@ -18,4 +18,4 @@ bp::object getOrCreatePythonNamespace(const std::string& submodule_name) { return submodule; } } // namespace python } // namespace nd_curves } // namespace ndcurves
 ... ... @@ -7,7 +7,7 @@ #include namespace nd_curves { namespace ndcurves { namespace python { namespace bp = boost::python; ... ... @@ -20,6 +20,6 @@ namespace bp = boost::python; /// bp::object getOrCreatePythonNamespace(const std::string& submodule_name); } // namespace python } // namespace nd_curves } // namespace ndcurves #endif // ifndef __python_namespace_h__
 ... ... @@ -2,4 +2,4 @@ # Copyright (c) 2019 CNRS # Author : Steve Tonneau from .nd_curves.optimization import * # noqa from .ndcurves.optimization import * # noqa
 #include "python_variables.h" #include "archive_python_binding.h" #include "namespace.h" #include "nd_curves/optimization/definitions.h" #include "nd_curves/optimization/quadratic_problem.h" #include "ndcurves/optimization/definitions.h" #include "ndcurves/optimization/quadratic_problem.h" #include #include #include namespace nd_curves { namespace ndcurves { namespace optimization { namespace python { static const bool safe = true; ... ... @@ -92,7 +92,7 @@ problem_definition_t* wrapProblemDefinitionConstructor(const curve_constraints_t void exposeOptimization() { // using the optimization scope bp::scope current_scope = nd_curves::python::getOrCreatePythonNamespace("optimization"); bp::scope current_scope = ndcurves::python::getOrCreatePythonNamespace("optimization"); /** BEGIN enums**/ bp::enum_("constraint_flag") .value("INIT_POS", INIT_POS) ... ... @@ -148,4 +148,4 @@ void exposeOptimization() { } // namespace python } // namespace optimization } // namespace nd_curves } // namespace ndcurves
 #include "python_variables.h" #include "namespace.h" #include "nd_curves/optimization/definitions.h" #include "nd_curves/optimization/quadratic_problem.h" #include "ndcurves/optimization/definitions.h" #include "ndcurves/optimization/quadratic_problem.h" #include #ifndef _OPTIMIZATION_PYTHON #define _OPTIMIZATION_PYTHON namespace nd_curves { namespace ndcurves { namespace optimization { namespace python { void exposeOptimization(); } // namespace python } // namespace optimization } // namespace nd_curves } // namespace ndcurves #endif //_OPTIMIZATION_PYTHON
 ... ... @@ -3,7 +3,7 @@ import matplotlib.pyplot as plt import numpy as np from numpy import array from .nd_curves import bezier from .ndcurves import bezier eigenpy.switchToNumpyArray() ... ...
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!