roboptim::TrajectorySumCost< T > Class Template Reference

Trajectory cost function defined by sum of state evaluations at parameters. More...

#include <roboptim/trajectory/trajectory-sum-cost.hh>

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

Public Types

typedef DerivableFunction parent_t
 Parent type. More...
 
typedef T trajectory_t
 Trajectory type. More...
 
typedef parent_t::vector_t vector_t
 Import vector type. More...
 
typedef parent_t::gradient_t gradient_t
 Import gradient type. More...
 
typedef
parent_t::discreteInterval_t 
discreteInterval_t
 Import discrete interval type. More...
 

Public Member Functions

 TrajectorySumCost (const trajectory_t &gamma, boost::shared_ptr< DerivableFunction > cost, const discreteStableTimePointInterval_t &interval, size_type order=1) throw ()
 Constructor. More...
 
virtual ~TrajectorySumCost () throw ()
 
size_type order () const throw ()
 

Protected Member Functions

void impl_compute (result_t &, const argument_t &) const throw ()
 
void impl_gradient (gradient_t &, const argument_t &, size_type) const throw ()
 

Discrete interval of stable time points.

typedef boost::tuple
< StableTimePoint,
StableTimePoint,
StableTimePoint
discreteStableTimePointInterval_t
 Types representing a discrete interval of stable time points. A discrete interval is a triplet of values: More...
 
static
discreteStableTimePointInterval_t 
makeDiscreteInterval (StableTimePoint min, StableTimePoint max, StableTimePoint step)
 Construct a discrete interval. More...
 
static
discreteStableTimePointInterval_t 
makeDiscreteInterval (interval_t interval, StableTimePoint step)
 Construct a discrete interval. More...
 
static StableTimePoint getLowerBound (const discreteStableTimePointInterval_t &interval) throw ()
 Get the lower bound of a discrete interval. More...
 
static StableTimePoint getUpperBound (const discreteStableTimePointInterval_t &interval) throw ()
 Get the upper bound of a discrete interval. More...
 
static StableTimePoint getStep (const discreteStableTimePointInterval_t &interval) throw ()
 Get the upper step of a discrete interval. More...
 

Detailed Description

template<typename T>
class roboptim::TrajectorySumCost< T >

Trajectory cost function defined by sum of state evaluations at parameters.

The state along a trajectory is defined as the vector containing the configuration and derivatives up to order $r$ of the configuration.

\[ \textbf{Cost}(\Gamma) = \sum_{i=1}{n} cost \left({\Gamma(t_i)}, {\dot{\Gamma}(t_i)},\cdots,\frac{d^{r}\Gamma}{dt^{r}}(t_i) \right) \]

where

  • $\textbf{Cost}$ is the trajectory cost,
  • $cost$ is the state cost,
  • $t_i\ \ i=1\cdots n$ are the parameters along the trajectory where the cost is evaluated,
  • $r$ is called the order of the state.
Template Parameters
Ttrajectory type

Member Typedef Documentation

template<typename T >
typedef parent_t::discreteInterval_t roboptim::TrajectorySumCost< T >::discreteInterval_t

Import discrete interval type.

Types representing a discrete interval of stable time points. A discrete interval is a triplet of values:

  • lower bound,
  • upper bound,
  • step.
template<typename T >
typedef parent_t::gradient_t roboptim::TrajectorySumCost< T >::gradient_t

Import gradient type.

template<typename T >
typedef DerivableFunction roboptim::TrajectorySumCost< T >::parent_t

Parent type.

template<typename T >
typedef T roboptim::TrajectorySumCost< T >::trajectory_t

Trajectory type.

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

Import vector type.

Constructor & Destructor Documentation

template<typename T >
roboptim::TrajectorySumCost< T >::TrajectorySumCost ( const trajectory_t gamma,
boost::shared_ptr< DerivableFunction >  cost,
const discreteStableTimePointInterval_t interval,
size_type  order = 1 
) throw ()

Constructor.

Parameters
gammaTrajectory $\Gamma$ along which the state is evaluated.
coststate cost: $cost$.
intervalStable time points list where cost will be evaluated.
orderorder $r$ of derivation.
template<typename T >
roboptim::TrajectorySumCost< T >::~TrajectorySumCost ( ) throw ()
virtual

Member Function Documentation

template<typename T >
static StableTimePoint roboptim::TrajectorySumCost< T >::getLowerBound ( const discreteStableTimePointInterval_t interval) throw ()
inlinestatic

Get the lower bound of a discrete interval.

Parameters
intervalaccessed discrete interval
Returns
lower bound of the discrete interval

Referenced by roboptim::TrajectorySumCost< T >::makeDiscreteInterval().

template<typename T >
static StableTimePoint roboptim::TrajectorySumCost< T >::getStep ( const discreteStableTimePointInterval_t interval) throw ()
inlinestatic

Get the upper step of a discrete interval.

Parameters
intervalaccessed discrete interval
Returns
upper step of the discrete interval
template<typename T >
static StableTimePoint roboptim::TrajectorySumCost< T >::getUpperBound ( const discreteStableTimePointInterval_t interval) throw ()
inlinestatic

Get the upper bound of a discrete interval.

Parameters
intervalaccessed discrete interval
Returns
upper bound of the discrete interval

Referenced by roboptim::TrajectorySumCost< T >::makeDiscreteInterval().

template<typename T >
void roboptim::TrajectorySumCost< T >::impl_compute ( result_t &  res,
const argument_t &  p 
) const throw ()
protected
template<typename T >
void roboptim::TrajectorySumCost< T >::impl_gradient ( gradient_t grad,
const argument_t &  p,
size_type  i 
) const throw ()
protected
template<typename T >
static discreteStableTimePointInterval_t roboptim::TrajectorySumCost< T >::makeDiscreteInterval ( StableTimePoint  min,
StableTimePoint  max,
StableTimePoint  step 
)
inlinestatic

Construct a discrete interval.

Parameters
minmiminum value of the interval
maxmaxinum value of the interval
stepdiscretization step
template<typename T >
static discreteStableTimePointInterval_t roboptim::TrajectorySumCost< T >::makeDiscreteInterval ( interval_t  interval,
StableTimePoint  step 
)
inlinestatic

Construct a discrete interval.

Parameters
intervalcontinuous interval
stepdiscretization step

References roboptim::TrajectorySumCost< T >::getLowerBound(), and roboptim::TrajectorySumCost< T >::getUpperBound().

template<typename T >
TrajectorySumCost< T >::size_type roboptim::TrajectorySumCost< T >::order ( ) const throw ()