All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
roboptim::trajectory::FreeTimeTrajectory< T > Class Template Reference

Decorate a trajectory to make time scalable. More...

#include <roboptim/trajectory/fwd.hh>

Inheritance diagram for roboptim::trajectory::FreeTimeTrajectory< T >:
roboptim::trajectory::Trajectory< T::derivabilityOrder >

Public Types

typedef T fixedTimeTrajectory_t
 Fixed point trajectory type. More...
 
typedef FreeTimeTrajectory< T > self_t
 Self type. More...
 
typedef parent_t::interval_t interval_t
 Import interval type. More...
 
- Public Types inherited from roboptim::trajectory::Trajectory< T::derivabilityOrder >
typedef parent_t::interval_t interval_t
 Import interval type. More...
 

Public Member Functions

 ROBOPTIM_NTIMES_DERIVABLE_FUNCTION_FWD_TYPEDEFS_ (Trajectory< T::derivabilityOrder >)
 Parent type and imports. More...
 
 FreeTimeTrajectory (const fixedTimeTrajectory_t &traj, value_type s)
 Constructor with fixed definition interval trajectory. More...
 
 FreeTimeTrajectory (const self_t &traj)
 
virtual ~FreeTimeTrajectory ()
 
virtual jacobian_t variationConfigWrtParam (double t) const
 Get the variation of a configuration with respect to parameter vector. More...
 
virtual jacobian_t variationDerivWrtParam (double t, size_type order) const
 Get the variation of a derivative with respect to parameter vector. More...
 
virtual value_type singularPointAtRank (size_type rank) const
 Get singular point at given rank. More...
 
virtual vector_t derivBeforeSingularPoint (size_type rank, size_type order) const
 Get left limit value of derivative at given singular point. More...
 
virtual vector_t derivAfterSingularPoint (size_type rank, size_type order) const
 Get right limit value of derivative at given singular point. More...
 
virtual void setParameters (const_vector_ref)
 Set parameters. More...
 
value_type timeScale () const
 Get time scale factor. More...
 
size_type getTimeScalingIndex () const
 
virtual std::ostream & print (std::ostream &o) const
 Display the function on the specified output stream. More...
 
virtual void normalizeAngles (size_type index)
 Normalize angles in parameters array. More...
 
const fixedTimeTrajectory_tgetFixedTimeTrajectory () const
 
self_tresize (interval_t) const
 Clone and resize a trajectory. More...
 
fixedTimeTrajectory_tmakeFixedTimeTrajectory () const
 
double scaleTime (double t) const
 Scale input time argument. More...
 
double unscaleTime (double t) const
 
jacobian_t variationConfigWrtParam (StableTimePoint tp) const
 
jacobian_t variationDerivWrtParam (StableTimePoint tp, size_type order) const
 
- Public Member Functions inherited from roboptim::trajectory::Trajectory< T::derivabilityOrder >
 ROBOPTIM_NTIMES_DERIVABLE_FUNCTION_FWD_TYPEDEFS_ (NTimesDerivableFunction< DerivabilityOrder >)
 Parent type and imports. More...
 
virtual ~Trajectory ()
 
result_t operator() (StableTimePoint argument) const
 
void operator() (result_ref result, StableTimePoint argument) const
 
derivative_t derivative (StableTimePoint argument, size_type order=1) const
 
void derivative (derivative_ref derivative, StableTimePoint argument, size_type order=1) const
 
bool isValidTime (value_type t) const
 
virtual Trajectory
< DerivabilityOrder > * 
clone () const =0
 
const vector_t & parameters () const
 
interval_t timeRange () const
 
value_type length () const
 
virtual vector_t state (double t, size_type order) const
 Get state along trajectory. More...
 
virtual vector_t state (StableTimePoint t, size_type order) const
 
jacobian_t variationStateWrtParam (double t, size_type order) const
 Get the variation of the state with respect to parameter vector. More...
 
jacobian_t variationStateWrtParam (StableTimePoint stp, size_type order) const
 
size_type singularPoints () const
 Get number of singular points. More...
 
void tolerance (const double &tolerance)
 
double tolerance () const
 Get tolerance for inclusion of parameter in interval of definition. More...
 

Protected Member Functions

void impl_compute (result_ref, double) const
 
void impl_derivative (derivative_ref g, double x, size_type order) const
 
void impl_derivative (derivative_ref g, StableTimePoint, size_type order) const
 
- Protected Member Functions inherited from roboptim::trajectory::Trajectory< T::derivabilityOrder >
virtual void normalizeAngles (size_type index, size_type offset)
 Internal version of normalizeAngles allowing an optional offset. More...
 
void impl_compute (result_ref, StableTimePoint) const
 
 Trajectory (interval_t, size_type, const vector_t &, std::string name=std::string())
 

Additional Inherited Members

- Protected Attributes inherited from roboptim::trajectory::Trajectory< T::derivabilityOrder >
interval_t timeRange_
 
vector_t parameters_
 
size_type singularPoints_
 

Detailed Description

template<typename T>
class roboptim::trajectory::FreeTimeTrajectory< T >

Decorate a trajectory to make time scalable.

Build a trajectory from an input trajectory and a time scale factor.

Examples:
spline-time-optimization.cc.

Member Typedef Documentation

template<typename T >
typedef T roboptim::trajectory::FreeTimeTrajectory< T >::fixedTimeTrajectory_t

Fixed point trajectory type.

template<typename T >
typedef parent_t::interval_t roboptim::trajectory::FreeTimeTrajectory< T >::interval_t

Import interval type.

template<typename T >
typedef FreeTimeTrajectory<T> roboptim::trajectory::FreeTimeTrajectory< T >::self_t

Self type.

Constructor & Destructor Documentation

template<typename T >
roboptim::trajectory::FreeTimeTrajectory< T >::FreeTimeTrajectory ( const fixedTimeTrajectory_t traj,
value_type  s 
)

Constructor with fixed definition interval trajectory.

Parameters
trajtrajectory defining this one by reparameterization
stime scale
template<typename T >
roboptim::trajectory::FreeTimeTrajectory< T >::FreeTimeTrajectory ( const self_t traj)
template<typename T >
roboptim::trajectory::FreeTimeTrajectory< T >::~FreeTimeTrajectory ( )
virtual

Member Function Documentation

template<typename T >
FreeTimeTrajectory< T >::vector_t roboptim::trajectory::FreeTimeTrajectory< T >::derivAfterSingularPoint ( size_type  rank,
size_type  order 
) const
virtual

Get right limit value of derivative at given singular point.

Parameters
rankrank of the singular points.
orderorder of derivation.
Return values
derivativeLimit of the derivative at singular point for decreasing parameter values.

Implements roboptim::trajectory::Trajectory< T::derivabilityOrder >.

template<typename T >
FreeTimeTrajectory< T >::vector_t roboptim::trajectory::FreeTimeTrajectory< T >::derivBeforeSingularPoint ( size_type  rank,
size_type  order 
) const
virtual

Get left limit value of derivative at given singular point.

Parameters
rankrank of the singular points.
orderorder of derivation.
Returns
Limit of the derivative at singular point for increasing parameter values.

Implements roboptim::trajectory::Trajectory< T::derivabilityOrder >.

template<typename T >
const fixedTimeTrajectory_t& roboptim::trajectory::FreeTimeTrajectory< T >::getFixedTimeTrajectory ( ) const
inline
template<typename T >
size_type roboptim::trajectory::FreeTimeTrajectory< T >::getTimeScalingIndex ( ) const
inline
template<typename T >
void roboptim::trajectory::FreeTimeTrajectory< T >::impl_compute ( result_ref  res,
double  t 
) const
protected
template<typename T >
void roboptim::trajectory::FreeTimeTrajectory< T >::impl_derivative ( derivative_ref  g,
double  x,
size_type  order 
) const
protected
template<typename T >
void roboptim::trajectory::FreeTimeTrajectory< T >::impl_derivative ( derivative_ref  g,
StableTimePoint  stp,
size_type  order 
) const
protectedvirtual
template<typename T >
void roboptim::trajectory::FreeTimeTrajectory< T >::normalizeAngles ( size_type  index)
virtual

Normalize angles in parameters array.

Make sure angles are continuous.

Parameters
indexAngles index in parameter array.

Reimplemented from roboptim::trajectory::Trajectory< T::derivabilityOrder >.

template<typename T >
std::ostream & roboptim::trajectory::FreeTimeTrajectory< T >::print ( std::ostream &  o) const
virtual

Display the function on the specified output stream.

Parameters
ooutput stream used for display
Returns
output stream

Reimplemented from roboptim::trajectory::Trajectory< T::derivabilityOrder >.

template<typename T >
roboptim::trajectory::FreeTimeTrajectory< T >::ROBOPTIM_NTIMES_DERIVABLE_FUNCTION_FWD_TYPEDEFS_ ( Trajectory< T::derivabilityOrder >  )

Parent type and imports.

template<typename T >
double roboptim::trajectory::FreeTimeTrajectory< T >::scaleTime ( double  t) const

Scale input time argument.

Scale input argument with the same factor that the input trajectory:

\[t' = t_{min} + \lambda * (t - t_{min})\]

where \([t_{min}, t_{max}]\) is the input trajectory time range and

\[\lambda\]

the scale factor.

Parameters
tinput time
Returns
new scaled time

References roboptim::trajectory::detail::fixTime().

Referenced by roboptim::trajectory::FreeTimeTrajectory< T >::resize().

template<typename T >
void roboptim::trajectory::FreeTimeTrajectory< T >::setParameters ( const_vector_ref  )
virtual

Set parameters.

Parameters
vector_tparameters.
Exceptions
std::runtime_error

Reimplemented from roboptim::trajectory::Trajectory< T::derivabilityOrder >.

Examples:
spline-time-optimization.cc.

References roboptim::trajectory::removeScaleFromParameters(), and roboptim::trajectory::detail::unscaleInterval().

template<typename T >
FreeTimeTrajectory< T >::value_type roboptim::trajectory::FreeTimeTrajectory< T >::singularPointAtRank ( size_type  rank) const
virtual

Get singular point at given rank.

Implements roboptim::trajectory::Trajectory< T::derivabilityOrder >.

template<typename T >
FreeTimeTrajectory< T >::value_type roboptim::trajectory::FreeTimeTrajectory< T >::timeScale ( ) const

Get time scale factor.

Returns
time scale factor.
template<typename T >
double roboptim::trajectory::FreeTimeTrajectory< T >::unscaleTime ( double  t) const
template<typename T >
FreeTimeTrajectory< T >::jacobian_t roboptim::trajectory::FreeTimeTrajectory< T >::variationConfigWrtParam ( double  t) const
virtual

Get the variation of a configuration with respect to parameter vector.

Parameters
tvalue \(t\) in the definition interval.
Returns
Jacobian:

\[\frac{\partial\Gamma_{\textbf{p}}(t)}{\partial\textbf{p}}\]

Implements roboptim::trajectory::Trajectory< T::derivabilityOrder >.

template<typename T >
FreeTimeTrajectory< T >::jacobian_t roboptim::trajectory::FreeTimeTrajectory< T >::variationConfigWrtParam ( StableTimePoint  tp) const
virtual
template<typename T >
FreeTimeTrajectory< T >::jacobian_t roboptim::trajectory::FreeTimeTrajectory< T >::variationDerivWrtParam ( double  t,
size_type  order 
) const
virtual

Get the variation of a derivative with respect to parameter vector.

Parameters
tvalue \(t\) in the definition interval.
orderorder \(r\) of the derivative.
Returns
jacobian

\[ \frac{\partial}{\partial\textbf{p}} \left(\frac{d^r\Gamma_{\textbf{p}}}{dt^r}(t)\right) \]

Implements roboptim::trajectory::Trajectory< T::derivabilityOrder >.

template<typename T >
FreeTimeTrajectory< T >::jacobian_t roboptim::trajectory::FreeTimeTrajectory< T >::variationDerivWrtParam ( StableTimePoint  tp,
size_type  order 
) const
virtual