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_t > | constraints_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_type & | t0 () |
value_type | tmax () const |
value_type & | tmax () |
value_type | epsilon () const |
value_type & | epsilon () |
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_t & | problem () const |
Return a reference to the stored problem. More... | |
Factory of problems over splines.
T | Matrix type. |
S | Spline type. |
typedef problem_t::constraint_t roboptim::trajectory::ProblemOverSplinesFactory< T, S >::constraint_t |
typedef std::vector<constraint_t> roboptim::trajectory::ProblemOverSplinesFactory< T, S >::constraints_t |
typedef boost::tuple<numericLinearConstraintPtr_t, interval_t, value_type> roboptim::trajectory::ProblemOverSplinesFactory< T, S >::freeze_t |
typedef problem_t::function_t roboptim::trajectory::ProblemOverSplinesFactory< T, S >::function_t |
typedef boost::tuple<splinesConstraintPtr_t, intervals_t, scaling_t> roboptim::trajectory::ProblemOverSplinesFactory< T, S >::globalConstraint_t |
typedef function_t::interval_t roboptim::trajectory::ProblemOverSplinesFactory< T, S >::interval_t |
typedef problem_t::intervals_t roboptim::trajectory::ProblemOverSplinesFactory< T, S >::intervals_t |
typedef function_t::matrix_t roboptim::trajectory::ProblemOverSplinesFactory< T, S >::matrix_t |
typedef GenericNumericLinearFunction<T> roboptim::trajectory::ProblemOverSplinesFactory< T, S >::numericLinearConstraint_t |
typedef boost::shared_ptr<numericLinearConstraint_t> roboptim::trajectory::ProblemOverSplinesFactory< T, S >::numericLinearConstraintPtr_t |
typedef Problem<T> roboptim::trajectory::ProblemOverSplinesFactory< T, S >::problem_t |
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.
typedef problem_t::scaling_t roboptim::trajectory::ProblemOverSplinesFactory< T, S >::scaling_t |
typedef problem_t::scalingVect_t roboptim::trajectory::ProblemOverSplinesFactory< T, S >::scalingVect_t |
typedef function_t::size_type roboptim::trajectory::ProblemOverSplinesFactory< T, S >::size_type |
typedef S roboptim::trajectory::ProblemOverSplinesFactory< T, S >::spline_t |
typedef boost::shared_ptr<spline_t> roboptim::trajectory::ProblemOverSplinesFactory< T, S >::splinePtr_t |
typedef std::vector<boost::shared_ptr<S> > roboptim::trajectory::ProblemOverSplinesFactory< T, S >::splines_t |
typedef ConstraintsOverSplines<T, S> roboptim::trajectory::ProblemOverSplinesFactory< T, S >::splinesConstraint_t |
typedef boost::shared_ptr<splinesConstraint_t> roboptim::trajectory::ProblemOverSplinesFactory< T, S >::splinesConstraintPtr_t |
typedef boost::variant<globalConstraint_t, freeze_t> roboptim::trajectory::ProblemOverSplinesFactory< T, S >::supportedConstraint_t |
typedef function_t::value_type roboptim::trajectory::ProblemOverSplinesFactory< T, S >::value_type |
typedef function_t::vector_t roboptim::trajectory::ProblemOverSplinesFactory< T, S >::vector_t |
enum roboptim::trajectory::ProblemOverSplinesFactory::CostType |
roboptim::trajectory::ProblemOverSplinesFactory< T, S >::ProblemOverSplinesFactory | ( | const splines_t & | splines, |
const problem_t & | problem, | ||
CostType | cost = COST_DEFAULT , |
||
value_type | scaling = -1. |
||
) |
Constructor.
splines | vector of splines considered. |
problem | optimization problem. |
cost | type of cost function. |
scaling | scaling for the cost function (scaling > 0.). |
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.
time | Time of the constraint |
order | Derivation order (0 for no derivation) |
value | Goals of the constraints for each spline |
scaling | Scalings of the constraints for each spline |
eps | Epsilon used for the equality constraints |
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.
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.
startingPoint | Time when the constraint interval starts |
order | Derivation order (0 for no derivation) |
range | Bounds of the constraint for each spline |
scaling | Scalings of the constraints for each spline |
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.
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.
ProblemOverSplinesFactory< T, S >::value_type roboptim::trajectory::ProblemOverSplinesFactory< T, S >::epsilon | ( | ) | const |
ProblemOverSplinesFactory< T, S >::value_type & roboptim::trajectory::ProblemOverSplinesFactory< T, S >::epsilon | ( | ) |
const ProblemOverSplinesFactory< T, S >::problem_t & roboptim::trajectory::ProblemOverSplinesFactory< T, S >::problem | ( | ) | const |
Return a reference to the stored problem.
ProblemOverSplinesFactory< T, S >::value_type roboptim::trajectory::ProblemOverSplinesFactory< T, S >::t0 | ( | ) | const |
ProblemOverSplinesFactory< T, S >::value_type & roboptim::trajectory::ProblemOverSplinesFactory< T, S >::t0 | ( | ) |
ProblemOverSplinesFactory< T, S >::value_type roboptim::trajectory::ProblemOverSplinesFactory< T, S >::tmax | ( | ) | const |
ProblemOverSplinesFactory< T, S >::value_type & roboptim::trajectory::ProblemOverSplinesFactory< T, S >::tmax | ( | ) |
void roboptim::trajectory::ProblemOverSplinesFactory< T, S >::updateEndingPoint | ( | value_type | endingPoint, |
CostType | cost = COST_DEFAULT |
||
) |
Updates the endingPoint of the problem, using updateRange.
void roboptim::trajectory::ProblemOverSplinesFactory< T, S >::updateRange | ( | const interval_t & | newRange, |
CostType | cost = COST_DEFAULT |
||
) |
Updates the range of the optimization problem.
newRange | desired timeRange |
cost | new function we want to use (or DEFAULT if keep the same one). |
void roboptim::trajectory::ProblemOverSplinesFactory< T, S >::updateStartingPoint | ( | value_type | startingPoint, |
CostType | cost = COST_DEFAULT |
||
) |
Updates the startingPoint of the problem, using updateRange.