9#ifndef _CLASS_CONSTANTCURVE
10#define _CLASS_CONSTANTCURVE
20 typename Point = Eigen::Matrix<Numeric, Eigen::Dynamic, 1>,
23 :
public curve_abc<Time, Numeric, Safe, Point, Point_derivate> {
47 const time_t T_max = std::numeric_limits<time_t>::max())
50 throw std::invalid_argument(
51 "can't create constant curve: min bound is higher than max bound");
73 throw std::invalid_argument(
74 "error in constant curve : time t to evaluate should be in range "
75 "[Tmin, Tmax] of the curve");
86 if (point_derivate_t::RowsAtCompileTime == Eigen::Dynamic) {
110 throw std::invalid_argument(
111 "error in constant curve : time t to derivate should be in range "
112 "[Tmin, Tmax] of the curve");
115 if (point_derivate_t::RowsAtCompileTime == Eigen::Dynamic) {
134 const Numeric
prec = Eigen::NumTraits<Numeric>::dummy_precision())
const {
142 const Numeric
prec = Eigen::NumTraits<Numeric>::dummy_precision())
const {
156 return !(*
this ==
other);
162 std::size_t
virtual dim()
const {
return dim_; }
171 virtual std::size_t
degree()
const {
return 0; }
183 template <
class Archive>
189 ar& boost::serialization::make_nvp(
"value",
value_);
190 ar& boost::serialization::make_nvp(
"T_min",
T_min_);
191 ar& boost::serialization::make_nvp(
"T_max",
T_max_);
192 ar& boost::serialization::make_nvp(
"dim",
dim_);
199 SINGLE_ARG(
typename Time,
typename Numeric,
bool Safe,
typename Point,
200 typename Point_derivate),
#define DEFINE_CLASS_TEMPLATE_VERSION(Template, Type)
Definition archive.hpp:27
#define SINGLE_ARG(...)
Definition archive.hpp:23
interface for a Curve of arbitrary dimension.
Eigen::Matrix< Numeric, Eigen::Dynamic, 1 > Point
Definition effector_spline.h:28
double Numeric
Definition effector_spline.h:26
double Time
Definition effector_spline.h:27
Definition bernstein.h:20
bool isApprox(const T a, const T b, const T eps=1e-6)
Definition curve_abc.h:25
Represents a constant_curve curve, always returning the same value and a null derivative.
Definition constant_curve.h:23
Point point_t
Definition constant_curve.h:24
constant_curve< Time, Numeric, Safe, Point, Point_derivate > constant_curve_t
Definition constant_curve.h:29
virtual std::size_t degree() const
Get the degree of the curve.
Definition constant_curve.h:171
void serialize(Archive &ar, const unsigned int version)
Definition constant_curve.h:184
Time time_t
Definition constant_curve.h:26
curve_derivate_t compute_derivate() const
Compute the derived curve at order N. Computes the derivative order N, of bezier curve of parametric...
Definition constant_curve.h:84
constant_curve(const Point &value, const time_t T_min=0., const time_t T_max=std::numeric_limits< time_t >::max())
Constructor..
Definition constant_curve.h:46
constant_curve< Time, Numeric, Safe, Point_derivate > curve_derivate_t
Definition constant_curve.h:30
std::size_t dim_
Definition constant_curve.h:177
constant_curve()
Empty constructor. Curve obtained this way can not perform other class functions.
Definition constant_curve.h:39
virtual bool operator==(const constant_curve_t &other) const
Definition constant_curve.h:151
virtual bool isApprox(const constant_curve_t &other, const Numeric prec=Eigen::NumTraits< Numeric >::dummy_precision()) const
isApprox check if other and *this are approximately equals given a precision threshold Only two curve...
Definition constant_curve.h:132
virtual num_t max() const
Get the maximum time for which the curve is defined.
Definition constant_curve.h:168
virtual std::size_t dim() const
Get dimension of curve.
Definition constant_curve.h:162
curve_abc< Time, Numeric, Safe, point_t, Point_derivate > curve_abc_t
Definition constant_curve.h:32
virtual ~constant_curve()
Destructor.
Definition constant_curve.h:64
Point value_
Definition constant_curve.h:175
Numeric num_t
Definition constant_curve.h:27
constant_curve(const constant_curve_t &other)
Copy constructor.
Definition constant_curve.h:57
virtual curve_derivate_t * compute_derivate_ptr(const std::size_t) const
Compute the derived curve at order N.
Definition constant_curve.h:99
virtual point_derivate_t derivate(const time_t t, const std::size_t) const
Evaluate the derivative of order N of curve at time t.
Definition constant_curve.h:108
virtual point_t operator()(const time_t t) const
Evaluation of the cubic spline at time t.
Definition constant_curve.h:71
virtual bool operator!=(const constant_curve_t &other) const
Definition constant_curve.h:155
friend class boost::serialization::access
Definition constant_curve.h:181
virtual bool isApprox(const curve_abc_t *other, const Numeric prec=Eigen::NumTraits< Numeric >::dummy_precision()) const
Definition constant_curve.h:140
virtual num_t min() const
Get the minimum time for which the curve is defined.
Definition constant_curve.h:165
time_t T_max_
Definition constant_curve.h:176
time_t T_min_
Definition constant_curve.h:176
Point_derivate point_derivate_t
Definition constant_curve.h:25
Represents a curve of dimension Dim. If value of parameter Safe is false, no verification is made on ...
Definition curve_abc.h:36