All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
roboptim::trajectory::ProblemOverSplinesFactory< T, S > Class Template Reference

Factory of problems over splines. More...

#include <roboptim/trajectory/problem-over-splines-factory.hh>

Public Types

enum  CostType {
  COST_DEFAULT,
  COST_JERK
}
 Cost functions supported. More...
 
typedef Problem< T > problem_t
 
typedef problem_t::scaling_t scaling_t
 
typedef problem_t::scalingVect_t scalingVect_t
 
typedef problem_t::intervals_t intervals_t
 
typedef problem_t::function_t function_t
 
typedef problem_t::constraint_t constraint_t
 
typedef std::vector< constraint_tconstraints_t
 
typedef function_t::value_type value_type
 
typedef function_t::size_type size_type
 
typedef function_t::interval_t interval_t
 
typedef function_t::vector_t vector_t
 
typedef function_t::matrix_t matrix_t
 
typedef ConstraintsOverSplines
< T, S > 
splinesConstraint_t
 
typedef boost::shared_ptr
< splinesConstraint_t
splinesConstraintPtr_t
 
typedef boost::tuple
< splinesConstraintPtr_t,
intervals_t, scaling_t
globalConstraint_t
 
typedef
GenericNumericLinearFunction
< T > 
numericLinearConstraint_t
 
typedef boost::shared_ptr
< numericLinearConstraint_t
numericLinearConstraintPtr_t
 
typedef boost::tuple
< numericLinearConstraintPtr_t,
interval_t, value_type
freeze_t
 
typedef boost::variant
< globalConstraint_t, freeze_t
supportedConstraint_t
 
typedef S spline_t
 
typedef boost::shared_ptr
< spline_t
splinePtr_t
 
typedef std::vector
< boost::shared_ptr< S > > 
splines_t
 
typedef std::vector< std::pair
< value_type, std::vector
< supportedConstraint_t > > > 
problemConstraints_t
 The constraints are stored with their given startingPoint/time. More...
 

Public Member Functions

 ProblemOverSplinesFactory (const splines_t &splines, const problem_t &problem, CostType cost=COST_DEFAULT, value_type scaling=-1.)
 Constructor. More...
 
value_type t0 () const
 
value_typet0 ()
 
value_type tmax () const
 
value_typetmax ()
 
value_type epsilon () const
 
value_typeepsilon ()
 
void updateRange (const interval_t &newRange, CostType cost=COST_DEFAULT)
 Updates the range of the optimization problem. More...
 
void updateStartingPoint (value_type startingPoint, CostType cost=COST_DEFAULT)
 Updates the startingPoint of the problem, using updateRange. More...
 
void updateEndingPoint (value_type endingPoint, CostType cost=COST_DEFAULT)
 Updates the endingPoint of the problem, using updateRange. More...
 
void addSpline (const S &spline)
 Adds a spline to the problem. More...
 
void addConstraint (value_type time, int order, const vector_t &value, const scaling_t &scaling, value_type eps=-1.)
 Adds freezing contraints on every spline at a given time. More...
 
void addIntervalConstraint (value_type startingPoint, int order, const intervals_t &range, const scalingVect_t &scaling)
 Adds contraints on every spline starting at a given time. More...
 
void addConstraint (value_type time, int order, const vector_t &value)
 Adds freezing contraints on every spline at a given time. More...
 
void addIntervalConstraint (value_type startingPoint, int order, const intervals_t &range)
 Adds contraints on every spline starting at a given time. More...
 
const problem_tproblem () const
 Return a reference to the stored problem. More...
 

Detailed Description

template<typename T, typename S>
class roboptim::trajectory::ProblemOverSplinesFactory< T, S >

Factory of problems over splines.

Template Parameters
TMatrix type.
SSpline type.

Member Typedef Documentation

template<typename T, typename S>
typedef problem_t::constraint_t roboptim::trajectory::ProblemOverSplinesFactory< T, S >::constraint_t
template<typename T, typename S>
typedef std::vector<constraint_t> roboptim::trajectory::ProblemOverSplinesFactory< T, S >::constraints_t
template<typename T, typename S>
typedef boost::tuple<numericLinearConstraintPtr_t, interval_t, value_type> roboptim::trajectory::ProblemOverSplinesFactory< T, S >::freeze_t
template<typename T, typename S>
typedef problem_t::function_t roboptim::trajectory::ProblemOverSplinesFactory< T, S >::function_t
template<typename T, typename S>
typedef boost::tuple<splinesConstraintPtr_t, intervals_t, scaling_t> roboptim::trajectory::ProblemOverSplinesFactory< T, S >::globalConstraint_t
template<typename T, typename S>
typedef function_t::interval_t roboptim::trajectory::ProblemOverSplinesFactory< T, S >::interval_t
template<typename T, typename S>
typedef problem_t::intervals_t roboptim::trajectory::ProblemOverSplinesFactory< T, S >::intervals_t
template<typename T, typename S>
typedef function_t::matrix_t roboptim::trajectory::ProblemOverSplinesFactory< T, S >::matrix_t
template<typename T, typename S>
typedef GenericNumericLinearFunction<T> roboptim::trajectory::ProblemOverSplinesFactory< T, S >::numericLinearConstraint_t
template<typename T, typename S>
typedef boost::shared_ptr<numericLinearConstraint_t> roboptim::trajectory::ProblemOverSplinesFactory< T, S >::numericLinearConstraintPtr_t
template<typename T, typename S>
typedef Problem<T> roboptim::trajectory::ProblemOverSplinesFactory< T, S >::problem_t
template<typename T, typename S>
typedef std::vector<std::pair<value_type, std::vector<supportedConstraint_t> > > roboptim::trajectory::ProblemOverSplinesFactory< T, S >::problemConstraints_t

The constraints are stored with their given startingPoint/time.

template<typename T, typename S>
typedef problem_t::scaling_t roboptim::trajectory::ProblemOverSplinesFactory< T, S >::scaling_t
template<typename T, typename S>
typedef problem_t::scalingVect_t roboptim::trajectory::ProblemOverSplinesFactory< T, S >::scalingVect_t
template<typename T, typename S>
typedef function_t::size_type roboptim::trajectory::ProblemOverSplinesFactory< T, S >::size_type
template<typename T, typename S>
typedef S roboptim::trajectory::ProblemOverSplinesFactory< T, S >::spline_t
template<typename T, typename S>
typedef boost::shared_ptr<spline_t> roboptim::trajectory::ProblemOverSplinesFactory< T, S >::splinePtr_t
template<typename T, typename S>
typedef std::vector<boost::shared_ptr<S> > roboptim::trajectory::ProblemOverSplinesFactory< T, S >::splines_t
template<typename T, typename S>
typedef ConstraintsOverSplines<T, S> roboptim::trajectory::ProblemOverSplinesFactory< T, S >::splinesConstraint_t
template<typename T, typename S>
typedef boost::shared_ptr<splinesConstraint_t> roboptim::trajectory::ProblemOverSplinesFactory< T, S >::splinesConstraintPtr_t
template<typename T, typename S>
typedef boost::variant<globalConstraint_t, freeze_t> roboptim::trajectory::ProblemOverSplinesFactory< T, S >::supportedConstraint_t
template<typename T, typename S>
typedef function_t::value_type roboptim::trajectory::ProblemOverSplinesFactory< T, S >::value_type
template<typename T, typename S>
typedef function_t::vector_t roboptim::trajectory::ProblemOverSplinesFactory< T, S >::vector_t

Member Enumeration Documentation

template<typename T, typename S>
enum roboptim::trajectory::ProblemOverSplinesFactory::CostType

Cost functions supported.

Enumerator
COST_DEFAULT 
COST_JERK 

Constructor & Destructor Documentation

template<typename T , typename S >
roboptim::trajectory::ProblemOverSplinesFactory< T, S >::ProblemOverSplinesFactory ( const splines_t splines,
const problem_t problem,
CostType  cost = COST_DEFAULT,
value_type  scaling = -1. 
)

Constructor.

Parameters
splinesvector of splines considered.
problemoptimization problem.
costtype of cost function.
scalingscaling for the cost function (scaling > 0.).

Member Function Documentation

template<typename T , typename S >
void roboptim::trajectory::ProblemOverSplinesFactory< T, S >::addConstraint ( value_type  time,
int  order,
const vector_t value,
const scaling_t scaling,
value_type  eps = -1. 
)

Adds freezing contraints on every spline at a given time.

These constraints are equality constraints on the value, derivative or second derivative (depending on the given order) of the spline at t=time. It constraints every spline.

Parameters
timeTime of the constraint
orderDerivation order (0 for no derivation)
valueGoals of the constraints for each spline
scalingScalings of the constraints for each spline
epsEpsilon used for the equality constraints
template<typename T , typename S >
void roboptim::trajectory::ProblemOverSplinesFactory< T, S >::addConstraint ( value_type  time,
int  order,
const vector_t value 
)

Adds freezing contraints on every spline at a given time.

Calls the corresponding addConstraint with a scaling set to 1 for each spline.

template<typename T , typename S >
void roboptim::trajectory::ProblemOverSplinesFactory< T, S >::addIntervalConstraint ( value_type  startingPoint,
int  order,
const intervals_t range,
const scalingVect_t scaling 
)

Adds contraints on every spline starting at a given time.

These constraints are bounding constraints on the value, derivative or second derivative (depending on the given order) of the spline, on the time range between the given startingPoint and the end of the interval. It constrains every spline.

Parameters
startingPointTime when the constraint interval starts
orderDerivation order (0 for no derivation)
rangeBounds of the constraint for each spline
scalingScalings of the constraints for each spline
template<typename T , typename S >
void roboptim::trajectory::ProblemOverSplinesFactory< T, S >::addIntervalConstraint ( value_type  startingPoint,
int  order,
const intervals_t range 
)

Adds contraints on every spline starting at a given time.

Calls the corresponding addConstraint with a scaling set to 1 for each spline.

template<typename T , typename S>
void roboptim::trajectory::ProblemOverSplinesFactory< T, S >::addSpline ( const S &  spline)

Adds a spline to the problem.

Warning, the size of the existing cost function will not change, it can therefore break your optimization problem.

It is best practice to give all the splines to the constructor.

template<typename T , typename S >
ProblemOverSplinesFactory< T, S >::value_type roboptim::trajectory::ProblemOverSplinesFactory< T, S >::epsilon ( ) const
template<typename T , typename S >
ProblemOverSplinesFactory< T, S >::value_type & roboptim::trajectory::ProblemOverSplinesFactory< T, S >::epsilon ( )
template<typename T , typename S >
const ProblemOverSplinesFactory< T, S >::problem_t & roboptim::trajectory::ProblemOverSplinesFactory< T, S >::problem ( ) const

Return a reference to the stored problem.

template<typename T , typename S >
ProblemOverSplinesFactory< T, S >::value_type roboptim::trajectory::ProblemOverSplinesFactory< T, S >::t0 ( ) const
template<typename T , typename S >
ProblemOverSplinesFactory< T, S >::value_type & roboptim::trajectory::ProblemOverSplinesFactory< T, S >::t0 ( )
template<typename T , typename S >
ProblemOverSplinesFactory< T, S >::value_type roboptim::trajectory::ProblemOverSplinesFactory< T, S >::tmax ( ) const
template<typename T , typename S >
ProblemOverSplinesFactory< T, S >::value_type & roboptim::trajectory::ProblemOverSplinesFactory< T, S >::tmax ( )
template<typename T , typename S >
void roboptim::trajectory::ProblemOverSplinesFactory< T, S >::updateEndingPoint ( value_type  endingPoint,
CostType  cost = COST_DEFAULT 
)

Updates the endingPoint of the problem, using updateRange.

template<typename T , typename S >
void roboptim::trajectory::ProblemOverSplinesFactory< T, S >::updateRange ( const interval_t newRange,
CostType  cost = COST_DEFAULT 
)

Updates the range of the optimization problem.

Parameters
newRangedesired timeRange
costnew function we want to use (or DEFAULT if keep the same one).
template<typename T , typename S >
void roboptim::trajectory::ProblemOverSplinesFactory< T, S >::updateStartingPoint ( value_type  startingPoint,
CostType  cost = COST_DEFAULT 
)

Updates the startingPoint of the problem, using updateRange.