Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Guilhem Saurel
ndcurves
Commits
29e6b634
Commit
29e6b634
authored
Dec 17, 2019
by
Pierre Fernbach
Browse files
Add method compute_derivate_ptr in curve_abc and it's implementation in all derived classes
parent
6539f435
Changes
8
Hide whitespace changes
Inline
Side-by-side
include/curves/bezier_curve.h
View file @
29e6b634
...
...
@@ -158,7 +158,13 @@ struct bezier_curve : public curve_abc<Time, Numeric, Safe, Point> {
}
bezier_curve_t
deriv
(
derived_wp
.
begin
(),
derived_wp
.
end
(),
T_min_
,
T_max_
,
mult_T_
*
(
1.
/
(
T_max_
-
T_min_
)));
return
deriv
.
compute_derivate
(
order
-
1
);
}
/// \brief Compute the derived curve at order N.
/// \param order : order of derivative.
/// \return A pointer to \f$\frac{d^Nx(t)}{dt^N}\f$ derivative order N of the curve.
bezier_curve_t
*
compute_derivate_ptr
(
const
std
::
size_t
order
)
const
{
return
new
bezier_curve_t
(
compute_derivate
(
order
));
}
/// \brief Compute the primitive of the curve at order N.
...
...
include/curves/cubic_hermite_spline.h
View file @
29e6b634
...
...
@@ -117,6 +117,14 @@ struct cubic_hermite_spline : public curve_abc<Time, Numeric, Safe, Point> {
throw
std
::
logic_error
(
"Compute derivate for cubic hermite spline is not implemented yet."
);
}
/// \brief Compute the derived curve at order N.
/// \param order : order of derivative.
/// \return A pointer to \f$\frac{d^Nx(t)}{dt^N}\f$ derivative order N of the curve.
cubic_hermite_spline_t
*
compute_derivate_ptr
(
const
std
::
size_t
order
)
const
{
return
new
cubic_hermite_spline_t
(
compute_derivate
(
order
));
}
/// \brief Set time of each control point of cubic hermite spline.
/// Set duration of each spline, Exemple : \f$( 0., 0.5, 0.9, ..., 4.5 )\f$ with
...
...
include/curves/curve_abc.h
View file @
29e6b634
...
...
@@ -50,8 +50,8 @@ struct curve_abc : std::unary_function<Time, Point>, public serialization::Seria
/// \brief Compute the derived curve at order N.
/// \param order : order of derivative.
/// \return \f$\frac{d^Nx(t)}{dt^N}\f$ derivative order N of the curve.
virtual
curve_t
*
compute_derivate
(
const
std
::
size_t
order
)
const
=
0
;
/// \return
A pointer to
\f$\frac{d^Nx(t)}{dt^N}\f$ derivative order N of the curve.
virtual
curve_t
*
compute_derivate
_ptr
(
const
std
::
size_t
order
)
const
=
0
;
/// \brief Evaluate the derivative of order N of curve at time t.
/// \param t : time when to evaluate the spline.
...
...
include/curves/helpers/effector_spline_rotation.h
View file @
29e6b634
...
...
@@ -76,10 +76,14 @@ class rotation_spline : public curve_abc_quat_t {
throw
std
::
runtime_error
(
"TODO quaternion spline does not implement derivate"
);
}
curve_abc_quat_t
*
compute_derivate
(
const
std
::
size_t
/*order*/
)
const
{
/// \brief Compute the derived curve at order N.
/// \param order : order of derivative.
/// \return A pointer to \f$\frac{d^Nx(t)}{dt^N}\f$ derivative order N of the curve.
curve_abc_quat_t
*
compute_derivate_ptr
(
const
std
::
size_t
/*order*/
)
const
{
throw
std
::
logic_error
(
"Compute derivate for quaternion spline is not implemented yet."
);
}
/// \brief Initialize time reparametrization for spline.
exact_cubic_constraint_one_dim
computeWayPoints
()
const
{
t_waypoint_one_dim_t
waypoints
;
...
...
include/curves/piecewise_curve.h
View file @
29e6b634
...
...
@@ -98,10 +98,10 @@ struct piecewise_curve : public curve_abc<Time, Numeric, Safe, Point,Point_deriv
* @param order order of derivative
* @return
*/
piecewise_curve_t
*
compute_derivate
(
const
std
::
size_t
order
)
const
{
piecewise_curve_t
*
compute_derivate
_ptr
(
const
std
::
size_t
order
)
const
{
piecewise_curve_t
*
res
(
new
piecewise_curve_t
());
for
(
typename
t_curve_ptr_t
::
const_iterator
itc
=
curves_
.
begin
();
itc
<
curves_
.
end
();
++
itc
)
{
curve_ptr_t
ptr
((
*
itc
)
->
compute_derivate
(
order
));
curve_ptr_t
ptr
((
*
itc
)
->
compute_derivate
_ptr
(
order
));
res
->
add_curve_ptr
(
ptr
);
}
return
res
;
...
...
include/curves/polynomial.h
View file @
29e6b634
...
...
@@ -284,6 +284,13 @@ struct polynomial : public curve_abc<Time, Numeric, Safe, Point> {
}
/// \brief Compute the derived curve at order N.
/// \param order : order of derivative.
/// \return A pointer to \f$\frac{d^Nx(t)}{dt^N}\f$ derivative order N of the curve.
polynomial_t
*
compute_derivate_ptr
(
const
std
::
size_t
order
)
const
{
return
new
polynomial_t
(
compute_derivate
(
order
));
}
Eigen
::
MatrixXd
coeff
()
const
{
return
coefficients_
;
}
point_t
coeffAtDegree
(
const
std
::
size_t
degree
)
const
{
...
...
include/curves/se3_curve.h
View file @
29e6b634
...
...
@@ -168,6 +168,13 @@ struct SE3Curve : public curve_abc<Time, Numeric, Safe, Eigen::Transform<Numeric
throw
std
::
logic_error
(
"Compute derivate for SE3 is not implemented yet."
);
}
/// \brief Compute the derived curve at order N.
/// \param order : order of derivative.
/// \return A pointer to \f$\frac{d^Nx(t)}{dt^N}\f$ derivative order N of the curve.
SE3Curve_t
*
compute_derivate_ptr
(
const
std
::
size_t
order
)
const
{
return
new
SE3Curve_t
(
compute_derivate
(
order
));
}
/*Helpers*/
/// \brief Get dimension of curve.
/// \return dimension of curve.
...
...
include/curves/so3_linear.h
View file @
29e6b634
...
...
@@ -129,6 +129,14 @@ struct SO3Linear : public curve_abc<Time, Numeric, Safe, Eigen::Matrix<Numeric,
throw
std
::
logic_error
(
"Compute derivate for SO3Linear is not implemented yet."
);
}
/// \brief Compute the derived curve at order N.
/// \param order : order of derivative.
/// \return A pointer to \f$\frac{d^Nx(t)}{dt^N}\f$ derivative order N of the curve.
SO3Linear_t
*
compute_derivate_ptr
(
const
std
::
size_t
order
)
const
{
return
new
SO3Linear_t
(
compute_derivate
(
order
));
}
/*Helpers*/
/// \brief Get dimension of curve.
/// \return dimension of curve.
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment