roboptim::FreeTimeTrajectory< T > Class Template Reference

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

#include <roboptim/trajectory/fwd.hh>

+ Inheritance diagram for roboptim::FreeTimeTrajectory< T >:

Public Types

typedef Trajectory
< T::derivabilityOrder > 
parent_t
 Parent type. More...
 
typedef T fixedTimeTrajectory_t
 Fixed point trajectory type. More...
 
typedef FreeTimeTrajectory< T > self_t
 Self type. More...
 
typedef parent_t::value_type value_type
 Import value type. More...
 
typedef parent_t::size_type size_type
 Import size type. More...
 
typedef parent_t::result_t result_t
 Import result type. More...
 
typedef parent_t::gradient_t gradient_t
 Import gradient type. More...
 
typedef parent_t::vector_t vector_t
 Import vector type. More...
 
typedef parent_t::jacobian_t jacobian_t
 Import jacobian type. More...
 
typedef parent_t::interval_t interval_t
 Import interval type. More...
 
- Public Types inherited from roboptim::Trajectory< T::derivabilityOrder >
typedef
NTimesDerivableFunction
< DerivabilityOrder > 
parent_t
 Parent type. More...
 
typedef parent_t::value_type value_type
 Import value type. More...
 
typedef parent_t::size_type size_type
 Import size type. More...
 
typedef parent_t::vector_t vector_t
 Import vector type. More...
 
typedef parent_t::result_t result_t
 Import result type. More...
 
typedef parent_t::gradient_t gradient_t
 Import gradient type. More...
 
typedef parent_t::jacobian_t jacobian_t
 Import jacobian type. More...
 
typedef parent_t::interval_t interval_t
 Import interval type. More...
 

Public Member Functions

 FreeTimeTrajectory (const fixedTimeTrajectory_t &traj, value_type s) throw ()
 
 FreeTimeTrajectory (const self_t &traj) throw ()
 
virtual ~FreeTimeTrajectory () throw ()
 
virtual jacobian_t variationConfigWrtParam (double t) const throw ()
 Get the variation of a configuration with respect to parameter vector. More...
 
virtual jacobian_t variationDerivWrtParam (double t, size_type order) const throw ()
 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_t &) throw ()
 
value_type timeScale () const throw ()
 Get time scale factor. More...
 
size_type getTimeScalingIndex () const throw ()
 
virtual std::ostream & print (std::ostream &o) const throw ()
 Display the function on the specified output stream. More...
 
virtual void normalizeAngles (size_type index) throw ()
 Normalize angles in parameters array. More...
 
const fixedTimeTrajectory_tgetFixedTimeTrajectory () const throw ()
 
self_tresize (interval_t timeRange) const throw ()
 Clone and resize a trajectory. More...
 
fixedTimeTrajectory_tmakeFixedTimeTrajectory () const throw ()
 
double scaleTime (double t) const throw ()
 Scale input time argument. More...
 
double unscaleTime (double t) const throw ()
 
jacobian_t variationConfigWrtParam (StableTimePoint tp) const throw ()
 
jacobian_t variationDerivWrtParam (StableTimePoint tp, size_type order) const throw ()
 
- Public Member Functions inherited from roboptim::Trajectory< T::derivabilityOrder >
virtual ~Trajectory () throw ()
 
result_t operator() (StableTimePoint argument) const throw ()
 
void operator() (result_t &result, StableTimePoint argument) const throw ()
 
gradient_t derivative (StableTimePoint argument, size_type order=1) const throw ()
 
void derivative (gradient_t &derivative, StableTimePoint argument, size_type order=1) const throw ()
 
bool isValidTime (value_type t) const throw ()
 
virtual Trajectory
< DerivabilityOrder > * 
clone () const =0 throw ()
 
const vector_tparameters () const throw ()
 
interval_t timeRange () const throw ()
 
value_type length () const throw ()
 
virtual vector_t state (double t, size_type order) const throw ()
 Get state along trajectory. More...
 
virtual vector_t state (StableTimePoint t, size_type order) const throw ()
 
jacobian_t variationStateWrtParam (double t, size_type order) const throw ()
 Get the variation of the state with respect to parameter vector. More...
 
jacobian_t variationStateWrtParam (StableTimePoint stp, size_type order) const throw ()
 
size_type singularPoints () const throw ()
 Get number of singular points. More...
 

Protected Member Functions

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

Additional Inherited Members

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

Detailed Description

template<typename T>
class roboptim::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::FreeTimeTrajectory< T >::fixedTimeTrajectory_t

Fixed point trajectory type.

template<typename T>
typedef parent_t::gradient_t roboptim::FreeTimeTrajectory< T >::gradient_t

Import gradient type.

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

Import interval type.

template<typename T>
typedef parent_t::jacobian_t roboptim::FreeTimeTrajectory< T >::jacobian_t

Import jacobian type.

template<typename T>
typedef Trajectory<T::derivabilityOrder> roboptim::FreeTimeTrajectory< T >::parent_t

Parent type.

template<typename T>
typedef parent_t::result_t roboptim::FreeTimeTrajectory< T >::result_t

Import result type.

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

Self type.

template<typename T>
typedef parent_t::size_type roboptim::FreeTimeTrajectory< T >::size_type

Import size type.

template<typename T>
typedef parent_t::value_type roboptim::FreeTimeTrajectory< T >::value_type

Import value type.

template<typename T>
typedef parent_t::vector_t roboptim::FreeTimeTrajectory< T >::vector_t

Import vector type.

Constructor & Destructor Documentation

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

Constructor with fixed definition interval trajectory

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

Member Function Documentation

template<typename T >
FreeTimeTrajectory< T >::vector_t roboptim::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< T::derivabilityOrder >.

template<typename T >
FreeTimeTrajectory< T >::vector_t roboptim::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< T::derivabilityOrder >.

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

Normalize angles in parameters array.

Make sure angles are continuous.

Parameters
indexAngles index in parameter array.

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

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

Display the function on the specified output stream.

Parameters
ooutput stream used for display
Returns
output stream

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

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

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

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

template<typename T >
void roboptim::FreeTimeTrajectory< T >::setParameters ( const vector_t p)
throw (
)
virtual
template<typename T >
FreeTimeTrajectory< T >::value_type roboptim::FreeTimeTrajectory< T >::singularPointAtRank ( size_type  rank) const
virtual

Get singular point at given rank.

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

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

Get time scale factor.

Returns
time scale factor.
template<typename T >
double roboptim::FreeTimeTrajectory< T >::unscaleTime ( double  t) const
throw (
)

References roboptim::tMax.

template<typename T >
FreeTimeTrajectory< T >::jacobian_t roboptim::FreeTimeTrajectory< T >::variationConfigWrtParam ( double  t) const
throw (
)
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< T::derivabilityOrder >.

template<typename T >
FreeTimeTrajectory< T >::jacobian_t roboptim::FreeTimeTrajectory< T >::variationConfigWrtParam ( StableTimePoint  tp) const
throw (
)
virtual
template<typename T >
FreeTimeTrajectory< T >::jacobian_t roboptim::FreeTimeTrajectory< T >::variationDerivWrtParam ( double  t,
size_type  order 
) const
throw (
)
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< T::derivabilityOrder >.

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