Loading...
Searching...
No Matches
roboptim::trajectory::StateFunction< T > Class Template Reference

Trajectory cost function defined by state evaluation at parameter. More...

#include <roboptim/trajectory/state-function.hh>

Inheritance diagram for roboptim::trajectory::StateFunction< T >:
Collaboration diagram for roboptim::trajectory::StateFunction< T >:

Public Types

typedef T trajectory_t
 Trajectory type.
 

Public Member Functions

 StateFunction (const trajectory_t &gamma, boost::shared_ptr< DerivableFunction > cost, const StableTimePoint tpt, size_type order=1)
 Constructor.
 
virtual ~StateFunction ()
 
size_type order () const
 

Static Public Member Functions

template<typename F , typename CLIST >
static void addToProblem (const trajectory_t &trajectory, boost::shared_ptr< DerivableFunction > function, unsigned order, Problem< F, CLIST > &problem, typename Function::interval_t bounds, unsigned nConstraints)
 
template<typename F , typename CLIST >
static void addToProblem (const trajectory_t &trajectory, boost::shared_ptr< DerivableFunction > function, unsigned order, Problem< F, CLIST > &problem, const typename Function::intervals_t &bounds, const std::vector< typename Function::value_type > &scales, unsigned nConstraints)
 

Protected Member Functions

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

Detailed Description

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

Trajectory cost function defined by state evaluation at parameter.

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) = cost
\left({\Gamma(t)}, {\dot{\Gamma}(t)},\cdots,\frac{d^{r}\Gamma}{dt^{r}}(t)
\right)
     \]

where

  • $\textbf{Cost}$ is the trajectory cost,
  • $cost$ is the state cost,
  • $t$ is the parameter along the trajectory where the cost is evaluated (fixed at construction),
  • $r$ is called the order of the state.
Template Parameters
Ttrajectory type

Member Typedef Documentation

◆ trajectory_t

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

Trajectory type.

Constructor & Destructor Documentation

◆ StateFunction()

template<typename T >
roboptim::trajectory::StateFunction< T >::StateFunction ( const trajectory_t & gamma,
boost::shared_ptr< DerivableFunction > cost,
const StableTimePoint tpt,
size_type order = 1 )

Constructor.

Parameters
gammaTrajectory $\Gamma$ along which the state is evaluated.
coststate cost: $cost$.
tptparameter $t$ where the state is evaluated.
orderorder $r$ of derivation.
Exceptions
std::runtime_error

References roboptim::trajectory::StateFunction< T >::order().

◆ ~StateFunction()

template<typename T >
roboptim::trajectory::StateFunction< T >::~StateFunction ( )
virtual

Member Function Documentation

◆ addToProblem() [1/2]

template<typename T >
template<typename F , typename CLIST >
static void roboptim::trajectory::StateFunction< T >::addToProblem ( const trajectory_t & trajectory,
boost::shared_ptr< DerivableFunction > function,
unsigned order,
Problem< F, CLIST > & problem,
const typename Function::intervals_t & bounds,
const std::vector< typename Function::value_type > & scales,
unsigned nConstraints )
inlinestatic

◆ addToProblem() [2/2]

template<typename T >
template<typename F , typename CLIST >
static void roboptim::trajectory::StateFunction< T >::addToProblem ( const trajectory_t & trajectory,
boost::shared_ptr< DerivableFunction > function,
unsigned order,
Problem< F, CLIST > & problem,
typename Function::interval_t bounds,
unsigned nConstraints )
inlinestatic

◆ impl_compute()

template<typename T >
void roboptim::trajectory::StateFunction< T >::impl_compute ( result_ref res,
const_argument_ref p ) const
protected

ROBOPTIM_DO_NOT_CHECK_ALLOCATION

ROBOPTIM_DO_NOT_CHECK_ALLOCATION

◆ impl_gradient()

template<typename T >
void roboptim::trajectory::StateFunction< 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

◆ order()