roboptim::trajectory::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::trajectory::TrajectorySumCost< T >:
DerivableFunction

List of all members.

Public Types

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

Public Member Functions

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

Protected Member Functions

void impl_compute (result_ref, const_argument_ref) const
void impl_gradient (gradient_ref, const_argument_ref, size_type) const

Discrete interval of stable time points.

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

Detailed Description

template<typename T>
class roboptim::trajectory::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::trajectory::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::trajectory::TrajectorySumCost< T >::gradient_t

Import gradient type.

Parent type.

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

Trajectory type.

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

Import vector type.


Constructor & Destructor Documentation

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

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::trajectory::TrajectorySumCost< T >::~TrajectorySumCost ( ) [virtual]

Member Function Documentation

template<typename T >
static StableTimePoint roboptim::trajectory::TrajectorySumCost< T >::getLowerBound ( const discreteStableTimePointInterval_t interval) [inline, static]

Get the lower bound of a discrete interval.

Parameters:
intervalaccessed discrete interval
Returns:
lower bound of the discrete interval
template<typename T >
static StableTimePoint roboptim::trajectory::TrajectorySumCost< T >::getStep ( const discreteStableTimePointInterval_t interval) [inline, static]

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::trajectory::TrajectorySumCost< T >::getUpperBound ( const discreteStableTimePointInterval_t interval) [inline, static]

Get the upper bound of a discrete interval.

Parameters:
intervalaccessed discrete interval
Returns:
upper bound of the discrete interval
template<typename T >
void roboptim::trajectory::TrajectorySumCost< T >::impl_compute ( result_ref  res,
const_argument_ref  p 
) const [protected]

ROBOPTIM_DO_NOT_CHECK_ALLOCATION

ROBOPTIM_DO_NOT_CHECK_ALLOCATION

template<typename T >
void roboptim::trajectory::TrajectorySumCost< T >::impl_gradient ( gradient_ref  grad,
const_argument_ref  p,
size_type  i 
) const [protected]

ROBOPTIM_DO_NOT_CHECK_ALLOCATION

ROBOPTIM_DO_NOT_CHECK_ALLOCATION

Construct a discrete interval.

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

Construct a discrete interval.

Parameters:
intervalcontinuous interval
stepdiscretization step
template<typename T >
TrajectorySumCost< T >::size_type roboptim::trajectory::TrajectorySumCost< T >::order ( ) const
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines