roboptim::trajectory::FreeTimeTrajectory< T > Class Template Reference

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

#include <roboptim/trajectory/free-time-trajectory.hh>

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

List of all members.

Public Types

typedef T fixedTimeTrajectory_t
 Fixed point trajectory type.
typedef FreeTimeTrajectory< T > self_t
 Self type.
typedef parent_t::interval_t interval_t
 Import interval type.

Public Member Functions

 ROBOPTIM_DIFFERENTIABLE_FUNCTION_FWD_TYPEDEFS_ (Trajectory< T::derivabilityOrder >)
 Parent type and imports.
 FreeTimeTrajectory (const fixedTimeTrajectory_t &traj, value_type s)
 Constructor with fixed definition interval trajectory.
 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.
virtual jacobian_t variationDerivWrtParam (double t, size_type order) const
 Get the variation of a derivative with respect to parameter vector.
virtual value_type singularPointAtRank (size_type rank) const
 Get singular point at given rank.
virtual vector_t derivBeforeSingularPoint (size_type rank, size_type order) const
 Get left limit value of derivative at given singular point.
virtual vector_t derivAfterSingularPoint (size_type rank, size_type order) const
 Get right limit value of derivative at given singular point.
virtual void setParameters (const vector_t &)
 Set parameters.
value_type timeScale () const
 Get time scale factor.
size_type getTimeScalingIndex () const
virtual std::ostream & print (std::ostream &o) const
 Display the function on the specified output stream.
virtual void normalizeAngles (size_type index)
 Normalize angles in parameters array.
const fixedTimeTrajectory_tgetFixedTimeTrajectory () const
self_tresize (interval_t) const
 Clone and resize a trajectory.
fixedTimeTrajectory_tmakeFixedTimeTrajectory () const
double scaleTime (double t) const
 Scale input time argument.
double unscaleTime (double t) const
jacobian_t variationConfigWrtParam (StableTimePoint tp) const
jacobian_t variationDerivWrtParam (StableTimePoint tp, size_type order) const

Protected Member Functions

void impl_compute (result_ref, double) const
void impl_derivative (gradient_ref g, double x, size_type order) const
void impl_derivative (gradient_ref g, StableTimePoint, size_type order) const

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.

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

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]

ROBOPTIM_DO_NOT_CHECK_ALLOCATION

template<typename T >
void roboptim::trajectory::FreeTimeTrajectory< T >::impl_derivative ( gradient_ref  g,
double  x,
size_type  order 
) const [protected]

ROBOPTIM_DO_NOT_CHECK_ALLOCATION

template<typename T >
void roboptim::trajectory::FreeTimeTrajectory< T >::impl_derivative ( gradient_ref  g,
StableTimePoint  stp,
size_type  order 
) const [protected, virtual]

ROBOPTIM_DO_NOT_CHECK_ALLOCATION

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

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 >.

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_t &  ) [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 >
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 >::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]
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines