ExactCubic.h 2.09 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
/**
* \file ExactCubic.h
* \brief class allowing to create an Exact cubic spline.
* \author Steve T.
* \version 0.1
* \date 06/17/2013
*
* This file contains definitions for the ExactCubic class.
* Given a set of waypoints (x_i*) and timestep (t_i), it provides the unique set of
* cubic splines fulfulling those 4 restrictions :
* - x_i(t_i) = x_i* ; this means that the curve passes trough each waypoint
* - x_i(t_i+1) = x_i+1* ;
* - its derivative is continous at t_i+1
* - its acceleration is continous at t_i+1
* more details in paper "Task-Space Trajectories via Cubic Spline Optimization"
* By J. Zico Kolter and Andrew Y.ng (ICRA 2009)
*/


#ifndef _CLASS_EXACTCUBIC
#define _CLASS_EXACTCUBIC

23
24
#include "Curve_ABC.h"

25
26
27
28
#include "Exports.h"
#include "MathDefs.h"

#include <memory>
29
#include <vector>
30
31
32
33
34
35
36
37

namespace spline
{
	struct CubicPImpl; // private implementation
	/// \class ExactCubic
	/// \brief Represents a set of cubic splines defining a continuous function 
	/// crossing each of the waypoint given in its initialization
	///
38
	struct ExactCubic : public Curve_ABC
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
	{
/* Constructors - destructors */
	public:
		///\brief Constructor
		///\param waypoints : a list comprising at least 2 waypoints in ascending time order
		SPLINE_API ExactCubic(const T_Waypoint& /*waypoints*/);

		///\brief Destructor
		SPLINE_API ~ExactCubic();

	private:
		ExactCubic(const ExactCubic&);
		ExactCubic& operator=(const ExactCubic&);
/* Constructors - destructors */

/*Operations*/
	public:
	///  \brief Evaluation of the cubic spline at time t.
	///  \param t : the time when to evaluate the spine
	///  \param result : a reference to the Point set to the x(t)
59
60
	///  \return : true if evaluation is successful, false if t is out of range
	SPLINE_API virtual bool Evaluate(const Real /*t*/, Vector3& /*result*/) const;
61
62
63
64
/*Operations*/

/*Helpers*/
	public:
65
66
	SPLINE_API Real virtual MinBound() const;
	SPLINE_API Real virtual MaxBound() const;
67
68
69
70
71
72
73
74
/*Helpers*/

/*Attributes*/
	private:
		std::auto_ptr<CubicPImpl> pImpl_;
/*Attributes*/
	};
}
75
76
#endif //_CLASS_EXACTCUBIC