Class Vertex

Class Documentation

class Vertex

A vertex describes the properties of a support point of a path.

A vertex has a set of constraints, the derivative of position a value, that have to be matched during optimization procedures. In case of a multi-dimensional vertex (mostly 3D), the constraint for a derivative exists in all dimensions, but can have different values in each dimension. X———X————X vertex segment

Public Types

typedef std::vector<Vertex> Vector
typedef Eigen::VectorXd ConstraintValue
typedef std::pair<int, ConstraintValue> Constraint
typedef std::map<int, ConstraintValue> Constraints

Public Functions

Vertex(size_t dimension)

Constructs an empty vertex and sets time_to_next and derivative_to_optimize to zero.

int D() const
void addConstraint(int derivative_order, double value)

Adds a constraint for the specified derivative order with the given value.

If this is a multi-dimensional vertex, all dimensions are set to the same value.

void addConstraint(int type, const Eigen::VectorXd &constraint)

Adds a constraint for the derivative specified in type with the given values in the constraint vector.

The dimension has to match the derivative.

bool removeConstraint(int type)

Removes a constraint for the derivative specified in type.

Returns false if constraint was not set.

void makeStartOrEnd(const Eigen::VectorXd &constraint, int up_to_derivative)

Sets a constraint for position and sets all derivatives up to (including) up_to_derivative to zero.

Convenience method for beginning / end vertices. up_to_derivative should be set to getHighestDerivativeFromN(N), where N is the order of your polynomial.

void makeStartOrEnd(double value, int up_to_derivative)
bool hasConstraint(int derivative_order) const

Returns whether the vertex has a constraint for the specified derivative order.

bool getConstraint(int derivative_order, Eigen::VectorXd *constraint) const

Passes the value of the constraint for derivative order to *value, and returns whether the constraint is set.

Constraints::const_iterator cBegin() const

Returns a const iterator to the first constraint.

Constraints::const_iterator cEnd() const

Returns a const iterator to the end of the constraints, i.e.

one after the last element.

size_t getNumberOfConstraints() const

Returns the number of constraints.

bool isEqualTol(const Vertex &rhs, double tol) const

Checks if both lhs and rhs are equal up to tol in case of double values.

bool getSubdimension(const std::vector<size_t> &subdimensions, int max_derivative_order, Vertex *subvertex) const

Get subdimension vertex.