Abstract trajectory. More...
#include <roboptim/trajectory/trajectory.hh>
Public Types | |
typedef parent_t::interval_t | interval_t |
Import interval type. | |
Public Member Functions | |
ROBOPTIM_DIFFERENTIABLE_FUNCTION_FWD_TYPEDEFS_ (NTimesDerivableFunction< DerivabilityOrder >) | |
Parent type and imports. | |
virtual | ~Trajectory () |
result_t | operator() (StableTimePoint argument) const |
void | operator() (result_ref result, StableTimePoint argument) const |
gradient_t | derivative (StableTimePoint argument, size_type order=1) const |
void | derivative (gradient_ref derivative, StableTimePoint argument, size_type order=1) const |
virtual jacobian_t | variationConfigWrtParam (StableTimePoint tp) const =0 |
virtual jacobian_t | variationDerivWrtParam (StableTimePoint tp, size_type order) const =0 |
bool | isValidTime (value_type t) const |
virtual void | normalizeAngles (size_type index) |
Normalize angles in parameters array. | |
virtual Trajectory < DerivabilityOrder > * | clone () const =0 |
virtual Trajectory < DerivabilityOrder > * | resize (interval_t timeRange) const =0 |
Clone and resize a trajectory. | |
virtual std::ostream & | print (std::ostream &) const |
Accessing parameters, and state. | |
const vector_t & | parameters () const |
virtual void | setParameters (const vector_t &) |
Set parameters. | |
interval_t | timeRange () const |
value_type | length () const |
virtual vector_t | state (double t, size_type order) const |
Get state along trajectory. | |
virtual vector_t | state (StableTimePoint t, size_type order) const |
Accessing parameters and gradients | |
virtual jacobian_t | variationConfigWrtParam (double t) const =0 |
Get the variation of a configuration with respect to parameter vector. | |
virtual jacobian_t | variationDerivWrtParam (double t, size_type order) const =0 |
Get the variation of a derivative with respect to parameter vector. | |
jacobian_t | variationStateWrtParam (double t, size_type order) const |
Get the variation of the state with respect to parameter vector. | |
jacobian_t | variationStateWrtParam (StableTimePoint stp, size_type order) const |
Singular points | |
size_type | singularPoints () const |
Get number of singular points. | |
virtual value_type | singularPointAtRank (size_type rank) const =0 |
Get singular point at given rank. | |
virtual vector_t | derivBeforeSingularPoint (size_type rank, size_type order) const =0 |
Get left limit value of derivative at given singular point. | |
virtual vector_t | derivAfterSingularPoint (size_type rank, size_type order) const =0 |
Get right limit value of derivative at given singular point. | |
Tolerance for inclusion of parameter in interval of definition. | |
Set tolerance for inclusion of parameter in interval of definition. | |
void | tolerance (const double &tolerance) |
double | tolerance () const |
Get tolerance for inclusion of parameter in interval of definition. | |
Protected Member Functions | |
void | impl_compute (result_ref, StableTimePoint) const |
virtual void | impl_derivative (gradient_ref g, StableTimePoint, size_type order) const =0 |
Trajectory (interval_t, size_type, const vector_t &, std::string name=std::string()) | |
virtual void | normalizeAngles (size_type index, size_type offset) |
Internal version of normalizeAngles allowing an optional offset. | |
Protected Attributes | |
interval_t | timeRange_ |
vector_t | parameters_ |
size_type | singularPoints_ |
Abstract trajectory.
A trajectory is a piecewise smooth mapping from
DerivabilityOrder | derivability order |
typedef parent_t::interval_t roboptim::trajectory::Trajectory< DerivabilityOrder >::interval_t |
Import interval type.
Reimplemented in roboptim::trajectory::FreeTimeTrajectory< T >, roboptim::trajectory::BSpline< N >, and roboptim::trajectory::ConstrainedBSpline< N >.
roboptim::trajectory::Trajectory< dorder >::~Trajectory | ( | ) | [virtual] |
roboptim::trajectory::Trajectory< dorder >::Trajectory | ( | interval_t | tr, |
size_type | outputSize, | ||
const vector_t & | p, | ||
std::string | name = std::string () |
||
) | [protected] |
virtual Trajectory<DerivabilityOrder>* roboptim::trajectory::Trajectory< DerivabilityOrder >::clone | ( | ) | const [pure virtual] |
virtual vector_t roboptim::trajectory::Trajectory< DerivabilityOrder >::derivAfterSingularPoint | ( | size_type | rank, |
size_type | order | ||
) | const [pure virtual] |
Get right limit value of derivative at given singular point.
rank | rank of the singular points. |
order | order of derivation. |
derivative | Limit of the derivative at singular point for decreasing parameter values. |
Implemented in roboptim::trajectory::BSpline< N >, roboptim::trajectory::CubicBSpline, roboptim::trajectory::FreeTimeTrajectory< T >, and roboptim::trajectory::VectorInterpolation.
gradient_t roboptim::trajectory::Trajectory< DerivabilityOrder >::derivative | ( | StableTimePoint | argument, |
size_type | order = 1 |
||
) | const [inline] |
void roboptim::trajectory::Trajectory< DerivabilityOrder >::derivative | ( | gradient_ref | derivative, |
StableTimePoint | argument, | ||
size_type | order = 1 |
||
) | const [inline] |
virtual vector_t roboptim::trajectory::Trajectory< DerivabilityOrder >::derivBeforeSingularPoint | ( | size_type | rank, |
size_type | order | ||
) | const [pure virtual] |
Get left limit value of derivative at given singular point.
rank | rank of the singular points. |
order | order of derivation. |
Implemented in roboptim::trajectory::BSpline< N >, roboptim::trajectory::CubicBSpline, roboptim::trajectory::FreeTimeTrajectory< T >, and roboptim::trajectory::VectorInterpolation.
void roboptim::trajectory::Trajectory< dorder >::impl_compute | ( | result_ref | res, |
StableTimePoint | stp | ||
) | const [protected] |
ROBOPTIM_DO_NOT_CHECK_ALLOCATION
References roboptim::trajectory::StableTimePoint::getTime().
Referenced by roboptim::trajectory::Trajectory< T::derivabilityOrder >::operator()().
virtual void roboptim::trajectory::Trajectory< DerivabilityOrder >::impl_derivative | ( | gradient_ref | g, |
StableTimePoint | , | ||
size_type | order | ||
) | const [protected, pure virtual] |
bool roboptim::trajectory::Trajectory< dorder >::isValidTime | ( | value_type | t | ) | const |
Trajectory< dorder >::value_type roboptim::trajectory::Trajectory< dorder >::length | ( | ) | const |
void roboptim::trajectory::Trajectory< dorder >::normalizeAngles | ( | size_type | index | ) | [virtual] |
Normalize angles in parameters array.
Make sure angles are continuous.
index | Angles index in parameter array. |
Reimplemented in roboptim::trajectory::FreeTimeTrajectory< T >.
void roboptim::trajectory::Trajectory< dorder >::normalizeAngles | ( | size_type | index, |
size_type | offset | ||
) | [protected, virtual] |
Internal version of normalizeAngles allowing an optional offset.
Used to factorize code between trajectories and free time trajectories.
index | Angles index in parameter array. |
offset | Index of the first control point in the parameter vector. |
result_t roboptim::trajectory::Trajectory< DerivabilityOrder >::operator() | ( | StableTimePoint | argument | ) | const [inline] |
void roboptim::trajectory::Trajectory< DerivabilityOrder >::operator() | ( | result_ref | result, |
StableTimePoint | argument | ||
) | const [inline] |
const Trajectory< dorder >::vector_t & roboptim::trajectory::Trajectory< dorder >::parameters | ( | ) | const |
std::ostream & roboptim::trajectory::Trajectory< dorder >::print | ( | std::ostream & | o | ) | const [virtual] |
virtual Trajectory<DerivabilityOrder>* roboptim::trajectory::Trajectory< DerivabilityOrder >::resize | ( | interval_t | timeRange | ) | const [pure virtual] |
Clone and resize a trajectory.
Implemented in roboptim::trajectory::BSpline< N >, roboptim::trajectory::FreeTimeTrajectory< T >, roboptim::trajectory::VectorInterpolation, roboptim::trajectory::ConstrainedBSpline< N >, and roboptim::trajectory::CubicBSpline.
roboptim::trajectory::Trajectory< DerivabilityOrder >::ROBOPTIM_DIFFERENTIABLE_FUNCTION_FWD_TYPEDEFS_ | ( | NTimesDerivableFunction< DerivabilityOrder > | ) |
Parent type and imports.
void roboptim::trajectory::Trajectory< dorder >::setParameters | ( | const vector_t & | p | ) | [virtual] |
Set parameters.
vector_t | parameters. |
std::runtime_error |
Reimplemented in roboptim::trajectory::BSpline< N >, roboptim::trajectory::ConstrainedBSpline< N >, roboptim::trajectory::CubicBSpline, roboptim::trajectory::FreeTimeTrajectory< T >, and roboptim::trajectory::VectorInterpolation.
virtual value_type roboptim::trajectory::Trajectory< DerivabilityOrder >::singularPointAtRank | ( | size_type | rank | ) | const [pure virtual] |
Get singular point at given rank.
Implemented in roboptim::trajectory::BSpline< N >, roboptim::trajectory::CubicBSpline, roboptim::trajectory::FreeTimeTrajectory< T >, and roboptim::trajectory::VectorInterpolation.
Trajectory< dorder >::size_type roboptim::trajectory::Trajectory< dorder >::singularPoints | ( | ) | const |
Get number of singular points.
Trajectory< dorder >::vector_t roboptim::trajectory::Trajectory< dorder >::state | ( | double | t, |
size_type | order | ||
) | const [virtual] |
Get state along trajectory.
t | value in the definition interval. |
order | the higher order of the required derivative |
The configuration and derivatives are concatenated in one vector.
Trajectory< dorder >::vector_t roboptim::trajectory::Trajectory< dorder >::state | ( | StableTimePoint | t, |
size_type | order | ||
) | const [virtual] |
Trajectory< dorder >::interval_t roboptim::trajectory::Trajectory< dorder >::timeRange | ( | ) | const |
Referenced by roboptim::trajectory::CubicBSpline::operator+(), roboptim::trajectory::CubicBSpline::operator+=(), roboptim::trajectory::visualization::gnuplot::plot_limitSpeed(), roboptim::trajectory::visualization::gnuplot::plot_xy(), roboptim::trajectory::FreeTimeTrajectory< T >::resize(), and roboptim::trajectory::detail::unscaleInterval().
void roboptim::trajectory::Trajectory< dorder >::tolerance | ( | const double & | tolerance | ) |
double roboptim::trajectory::Trajectory< dorder >::tolerance | ( | ) | const |
Get tolerance for inclusion of parameter in interval of definition.
virtual jacobian_t roboptim::trajectory::Trajectory< DerivabilityOrder >::variationConfigWrtParam | ( | double | t | ) | const [pure virtual] |
Get the variation of a configuration with respect to parameter vector.
t | value in the definition interval. |
Implemented in roboptim::trajectory::CubicBSpline, roboptim::trajectory::FreeTimeTrajectory< T >, and roboptim::trajectory::VectorInterpolation.
virtual jacobian_t roboptim::trajectory::Trajectory< DerivabilityOrder >::variationConfigWrtParam | ( | StableTimePoint | tp | ) | const [pure virtual] |
virtual jacobian_t roboptim::trajectory::Trajectory< DerivabilityOrder >::variationDerivWrtParam | ( | double | t, |
size_type | order | ||
) | const [pure virtual] |
Get the variation of a derivative with respect to parameter vector.
t | value in the definition interval. |
order | order of the derivative. |
Implemented in roboptim::trajectory::ConstrainedBSpline< N >, roboptim::trajectory::CubicBSpline, roboptim::trajectory::FreeTimeTrajectory< T >, and roboptim::trajectory::VectorInterpolation.
virtual jacobian_t roboptim::trajectory::Trajectory< DerivabilityOrder >::variationDerivWrtParam | ( | StableTimePoint | tp, |
size_type | order | ||
) | const [pure virtual] |
Trajectory< dorder >::jacobian_t roboptim::trajectory::Trajectory< dorder >::variationStateWrtParam | ( | double | t, |
size_type | order | ||
) | const |
Get the variation of the state with respect to parameter vector.
t | value in the definition interval. |
order | order of the derivative. |
Trajectory< dorder >::jacobian_t roboptim::trajectory::Trajectory< dorder >::variationStateWrtParam | ( | StableTimePoint | stp, |
size_type | order | ||
) | const |
vector_t roboptim::trajectory::Trajectory< DerivabilityOrder >::parameters_ [protected] |
size_type roboptim::trajectory::Trajectory< DerivabilityOrder >::singularPoints_ [protected] |
interval_t roboptim::trajectory::Trajectory< DerivabilityOrder >::timeRange_ [protected] |