Commit fe6e7280 authored by JasonChmn's avatar JasonChmn
Browse files

Change namespace and edit names in spline to curve for more generalization

parent 88ba5811
#include "hpp/spline/bezier_curve.h"
#include "hpp/spline/linear_variable.h"
#include "curve/bezier_curve.h"
#include "curve/linear_variable.h"
#include <vector>
......@@ -7,7 +7,7 @@
#define _DEFINITION_PYTHON_BINDINGS
namespace spline
namespace curve
{
typedef double real;
......@@ -37,7 +37,7 @@ T_Point vectorFromEigenArray(const PointList& array)
return res;
}
} //namespace spline.
} //namespace curve.
#endif //_DEFINITION_PYTHON_BINDINGS
......@@ -4,7 +4,7 @@
#include <Eigen/Core>
namespace spline
namespace curve
{
std::vector<linear_variable_3_t> matrix3DFromEigenArray(const point_list_t& matrices, const point_list_t& vectors)
......@@ -101,4 +101,4 @@ LinearBezierVector* split(const bezier_linear_variable_t& self, const vectorX_t
}
}
// namespace spline
// namespace curve
#include "hpp/spline/bezier_curve.h"
#include "hpp/spline/linear_variable.h"
#include "curve/bezier_curve.h"
#include "curve/linear_variable.h"
#include "python_definitions.h"
......@@ -9,12 +9,12 @@
#define _VARIABLES_PYTHON_BINDINGS
namespace spline
namespace curve
{
static const int dim = 3;
typedef spline::linear_variable<dim, real> linear_variable_3_t;
typedef spline::variables<linear_variable_3_t> variables_3_t;
typedef spline::bezier_curve <real, real, dim, true, variables_3_t> bezier_linear_variable_t;
typedef curve::linear_variable<dim, real> linear_variable_3_t;
typedef curve::variables<linear_variable_3_t> variables_3_t;
typedef curve::bezier_curve <real, real, dim, true, variables_3_t> bezier_linear_variable_t;
/*linear variable control points*/
......@@ -48,7 +48,7 @@ struct LinearBezierVector
// does not include end time
LinearBezierVector* split(const bezier_linear_variable_t& self, const vectorX_t& times);
} //namespace spline.
} //namespace curve.
#endif //_VARIABLES_PYTHON_BINDINGS
from numpy import matrix
from numpy.linalg import norm
from hpp_spline import bezier, bezier6, curve_constraints, exact_cubic, from_bezier, polynom, spline_deriv_constraint
from curves import bezier, bezier6, curve_constraints, exact_cubic, from_bezier, polynom, spline_deriv_constraint
__EPS = 1e-6
......
from hpp_spline import *
from curves import *
from numpy import matrix, array, zeros, ones, diag, cross
from numpy.linalg import norm
......
from hpp_spline import *
from curves import *
from numpy import matrix, array, zeros, ones, diag, cross
from numpy.linalg import norm
......
from hpp_spline import *
from curves import *
from varBezier import varBezier
from numpy import matrix, array, zeros, ones, diag, cross
from numpy.linalg import norm
......
from hpp_spline import *
from curves import *
from numpy import matrix, array, zeros, ones, diag, cross
from numpy.linalg import norm
......
ADD_UNIT_TEST(
spline_tests Main.cpp
curve_tests Main.cpp
)
#include "hpp/spline/exact_cubic.h"
#include "hpp/spline/bezier_curve.h"
#include "hpp/spline/polynom.h"
#include "hpp/spline/spline_deriv_constraint.h"
#include "hpp/spline/helpers/effector_spline.h"
#include "hpp/spline/helpers/effector_spline_rotation.h"
#include "hpp/spline/bezier_polynom_conversion.h"
#include "curve/exact_cubic.h"
#include "curve/bezier_curve.h"
#include "curve/polynom.h"
#include "curve/spline_deriv_constraint.h"
#include "curve/helpers/effector_spline.h"
#include "curve/helpers/effector_spline_rotation.h"
#include "curve/bezier_polynom_conversion.h"
#include <string>
#include <iostream>
......@@ -13,7 +13,7 @@
using namespace std;
namespace spline
namespace curve
{
typedef Eigen::Vector3d point_t;
typedef std::vector<point_t,Eigen::aligned_allocator<point_t> > t_point_t;
......@@ -46,9 +46,9 @@ bool QuasiEqual(const double a, const double b, const float margin)
const double margin = 0.001;
} // namespace spline
} // namespace curve
using namespace spline;
using namespace curve;
ostream& operator<<(ostream& os, const point_t& pt)
{
......@@ -456,7 +456,7 @@ void BezierToPolynomConversionTest(bool& error)
/*Exact Cubic Function tests*/
void ExactCubicNoErrorTest(bool& error)
{
spline::T_Waypoint waypoints;
curve::T_Waypoint waypoints;
for(double i = 0; i <= 1; i = i + 0.2)
{
waypoints.push_back(std::make_pair(i,point_t(i,i,i)));
......@@ -502,7 +502,7 @@ void ExactCubicNoErrorTest(bool& error)
/*Exact Cubic Function tests*/
void ExactCubicTwoPointsTest(bool& error)
{
spline::T_Waypoint waypoints;
curve::T_Waypoint waypoints;
for(double i = 0; i < 2; ++i)
{
waypoints.push_back(std::make_pair(i,point_t(i,i,i)));
......@@ -519,7 +519,7 @@ void ExactCubicTwoPointsTest(bool& error)
void ExactCubicOneDimTest(bool& error)
{
spline::T_WaypointOne waypoints;
curve::T_WaypointOne waypoints;
point_one zero; zero(0,0) = 9;
point_one one; one(0,0) = 14;
point_one two; two(0,0) = 25;
......@@ -536,7 +536,7 @@ void ExactCubicOneDimTest(bool& error)
ComparePoints(one, res1, errmsg, error);
}
void CheckWayPointConstraint(const std::string& errmsg, const double step, const spline::T_Waypoint& /*wayPoints*/, const exact_cubic_t* curve, bool& error )
void CheckWayPointConstraint(const std::string& errmsg, const double step, const curve::T_Waypoint& /*wayPoints*/, const exact_cubic_t* curve, bool& error )
{
point_t res1;
for(double i = 0; i <= 1; i = i + step)
......@@ -555,7 +555,7 @@ void CheckDerivative(const std::string& errmsg, const double eval_point, const s
void ExactCubicPointsCrossedTest(bool& error)
{
spline::T_Waypoint waypoints;
curve::T_Waypoint waypoints;
for(double i = 0; i <= 1; i = i + 0.2)
{
waypoints.push_back(std::make_pair(i,point_t(i,i,i)));
......@@ -568,7 +568,7 @@ void ExactCubicPointsCrossedTest(bool& error)
void ExactCubicVelocityConstraintsTest(bool& error)
{
spline::T_Waypoint waypoints;
curve::T_Waypoint waypoints;
for(double i = 0; i <= 1; i = i + 0.2)
{
waypoints.push_back(std::make_pair(i,point_t(i,i,i)));
......@@ -617,7 +617,7 @@ void CheckPointOnline(const std::string& errmsg, const point_t& A, const point_t
void EffectorTrajectoryTest(bool& error)
{
// create arbitrary trajectory
spline::T_Waypoint waypoints;
curve::T_Waypoint waypoints;
for(double i = 0; i <= 10; i = i + 2)
{
waypoints.push_back(std::make_pair(i,point_t(i,i,i)));
......@@ -674,7 +674,7 @@ double GetXRotFromQuat(helpers::quat_ref_const_t q)
void EffectorSplineRotationNoRotationTest(bool& error)
{
// create arbitrary trajectory
spline::T_Waypoint waypoints;
curve::T_Waypoint waypoints;
for(double i = 0; i <= 10; i = i + 2)
{
waypoints.push_back(std::make_pair(i,point_t(i,i,i)));
......@@ -696,7 +696,7 @@ void EffectorSplineRotationNoRotationTest(bool& error)
void EffectorSplineRotationRotationTest(bool& error)
{
// create arbitrary trajectory
spline::T_Waypoint waypoints;
curve::T_Waypoint waypoints;
for(double i = 0; i <= 10; i = i + 2)
{
waypoints.push_back(std::make_pair(i,point_t(i,i,i)));
......@@ -719,7 +719,7 @@ void EffectorSplineRotationRotationTest(bool& error)
void EffectorSplineRotationWayPointRotationTest(bool& error)
{
// create arbitrary trajectory
spline::T_Waypoint waypoints;
curve::T_Waypoint waypoints;
for(double i = 0; i <= 10; i = i + 2)
{
waypoints.push_back(std::make_pair(i,point_t(i,i,i)));
......
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