Commit 296d4ac4 authored by JasonChmn's avatar JasonChmn

change namespace in all folder of curves, make test 100% OK

parent 7d23ecc7
cmake_minimum_required(VERSION 2.6)
project(spline)
project(curve)
INCLUDE(cmake/base.cmake)
INCLUDE(cmake/test.cmake)
INCLUDE(cmake/python.cmake)
......
#include "hpp/spline/bezier_curve.h"
#include "hpp/spline/polynom.h"
#include "hpp/spline/exact_cubic.h"
#include "hpp/spline/spline_deriv_constraint.h"
#include "hpp/spline/curve_constraint.h"
#include "hpp/spline/bezier_polynom_conversion.h"
#include "hpp/spline/bernstein.h"
#include "hpp/curve/bezier_curve.h"
#include "hpp/curve/polynom.h"
#include "hpp/curve/exact_cubic.h"
#include "hpp/curve/spline_deriv_constraint.h"
#include "hpp/curve/curve_constraint.h"
#include "hpp/curve/bezier_polynom_conversion.h"
#include "hpp/curve/bernstein.h"
#include <vector>
......@@ -30,20 +30,20 @@ typedef std::vector<Waypoint> T_Waypoint;
typedef std::pair<real, point6_t> Waypoint6;
typedef std::vector<Waypoint6> T_Waypoint6;
typedef spline::bezier_curve <real, real, 3, true, point_t> bezier_t;
typedef spline::bezier_curve <real, real, 6, true, point6_t> bezier6_t;
typedef spline::polynom <real, real, 3, true, point_t, t_point_t> polynom_t;
typedef spline::exact_cubic <real, real, 3, true, point_t, t_point_t> exact_cubic_t;
typedef curve::bezier_curve <real, real, 3, true, point_t> bezier_t;
typedef curve::bezier_curve <real, real, 6, true, point6_t> bezier6_t;
typedef curve::polynom <real, real, 3, true, point_t, t_point_t> polynom_t;
typedef curve::exact_cubic <real, real, 3, true, point_t, t_point_t> exact_cubic_t;
typedef polynom_t::coeff_t coeff_t;
typedef std::pair<real, point_t> waypoint_t;
typedef std::vector<waypoint_t, Eigen::aligned_allocator<point_t> > t_waypoint_t;
typedef spline::Bern<double> bernstein_t;
typedef curve::Bern<double> bernstein_t;
typedef spline::spline_deriv_constraint <real, real, 3, true, point_t, t_point_t> spline_deriv_constraint_t;
typedef spline::curve_constraints<point_t> curve_constraints_t;
typedef spline::curve_constraints<point6_t> curve_constraints6_t;
typedef curve::spline_deriv_constraint <real, real, 3, true, point_t, t_point_t> spline_deriv_constraint_t;
typedef curve::curve_constraints<point_t> curve_constraints_t;
typedef curve::curve_constraints<point6_t> curve_constraints6_t;
/*** TEMPLATE SPECIALIZATION FOR PYTHON ****/
EIGENPY_DEFINE_STRUCT_ALLOCATOR_SPECIALIZATION(bernstein_t)
......@@ -54,7 +54,7 @@ EIGENPY_DEFINE_STRUCT_ALLOCATOR_SPECIALIZATION(exact_cubic_t)
EIGENPY_DEFINE_STRUCT_ALLOCATOR_SPECIALIZATION(curve_constraints_t)
EIGENPY_DEFINE_STRUCT_ALLOCATOR_SPECIALIZATION(spline_deriv_constraint_t)
namespace spline
namespace curve
{
using namespace boost::python;
template <typename PointList, typename T_Point>
......
#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 "hpp/curve/exact_cubic.h"
#include "hpp/curve/bezier_curve.h"
#include "hpp/curve/polynom.h"
#include "hpp/curve/spline_deriv_constraint.h"
#include "hpp/curve/helpers/effector_spline.h"
#include "hpp/curve/helpers/effector_spline_rotation.h"
#include "hpp/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