Class Constraint

Inheritance Relationships

Derived Type

Class Documentation

class Constraint

Definition of a differentiable holonomic constraint on a configuration space. See constrainedPlanning for more details.

Subclassed by ompl::base::ConstraintIntersection

Constraint Function Operations

virtual void function(const State *state, Eigen::Ref<Eigen::VectorXd> out) const

Compute the constraint function at state. Result is returned in out, which should be allocated to size coDim.

virtual void function(const Eigen::Ref<const Eigen::VectorXd> &x, Eigen::Ref<Eigen::VectorXd> out) const = 0

Compute the constraint function at x. Result is returned in out, which should be allocated to size coDim.

virtual void jacobian(const State *state, Eigen::Ref<Eigen::MatrixXd> out) const

Compute the Jacobian of the constraint function at state. Result is returned in out, which should be allocated to size coDim by ambientDim. Default implementation performs the differentiation numerically with a seven-point central difference stencil. It is best to provide an analytic formulation.

virtual void jacobian(const Eigen::Ref<const Eigen::VectorXd> &x, Eigen::Ref<Eigen::MatrixXd> out) const

Compute the Jacobian of the constraint function at x. Result is returned in out, which should be allocated to size coDim by ambientDim. Default implementation performs the differentiation numerically with a seven-point central difference stencil. It is best to provide an analytic formulation.

Other Function Operations

virtual bool project(State *state) const

Project a state state given the constraints. If a valid projection cannot be found, this method will return false. Even if this method fails, state will be modified.

virtual bool project(Eigen::Ref<Eigen::VectorXd> x) const

Project a state x given the constraints. If a valid projection cannot be found, this method will return false.

virtual double distance(const State *state) const

Returns the distance of state to the constraint manifold.

virtual double distance(const Eigen::Ref<const Eigen::VectorXd> &x) const

Returns the distance of x to the constraint manifold.

virtual bool isSatisfied(const State *state) const

Check whether a state state satisfies the constraints.

virtual bool isSatisfied(const Eigen::Ref<const Eigen::VectorXd> &x) const

Check whether a state x satisfies the constraints.

Getters and Setters

inline unsigned int getAmbientDimension() const

Returns the dimension of the ambient space.

inline unsigned int getManifoldDimension() const

Returns the dimension of the manifold.

inline unsigned int getCoDimension() const

Returns the dimension of the manifold.

inline void setManifoldDimension(unsigned int k)

Sets the underlying manifold dimension.

inline double getTolerance() const

Returns the tolerance of the projection routine.

inline unsigned int getMaxIterations() const

Returns the maximum number of allowed iterations in the projection routine.

inline void setTolerance(const double tolerance)

Sets the projection tolerance.

inline void setMaxIterations(const unsigned int iterations)

Sets the maximum number of iterations in the projection routine.

Public Functions

inline Constraint(const unsigned int ambientDim, const unsigned int coDim, double tolerance = magic::CONSTRAINT_PROJECTION_TOLERANCE)

Constructor. The dimension of the ambient configuration space as well as the dimension of the function’s output need to be specified (the co-dimension of the constraint manifold). I.E., for a sphere constraint function in.

virtual ~Constraint() = default

Protected Attributes

const unsigned int n_

Ambient space dimension.

unsigned int k_

Manifold dimension.

double tolerance_

Tolerance for Newton method used in projection onto manifold.

unsigned int maxIterations_

Maximum number of iterations for Newton method used in projection onto manifold.