moveit2
The MoveIt Motion Planning Framework for ROS 2.
Public Member Functions | Friends | List of all members
ompl_interface::Bounds Class Reference

Represents upper and lower bound on the elements of a vector. More...

#include <ompl_constraints.h>

Public Member Functions

 Bounds ()
 
 Bounds (const std::vector< double > &lower, const std::vector< double > &upper)
 
Eigen::VectorXd penalty (const Eigen::Ref< const Eigen::VectorXd > &x) const
 Distance to region inside bounds. More...
 
Eigen::VectorXd derivative (const Eigen::Ref< const Eigen::VectorXd > &x) const
 Derivative of the penalty function ^ | | -1-1-1 0 0 0 +1+1+1 |---------------------—> More...
 
std::size_t size () const
 

Friends

std::ostream & operator<< (std::ostream &os, const ompl_interface::Bounds &bounds)
 Pretty printing of bounds. More...
 

Detailed Description

Represents upper and lower bound on the elements of a vector.

OMPL ConstrainedStateSpace requires a model of the constraints given as: f1(joint_values) = 0 f2(joint_values) = 0 f3(joint_values) = 0 ...

So we use a penalty function to convert bounds to an equality constraint. If you do need equality constraint, you can represent them by setting the upper bound and lower bound almost equal. Or you can use the EqualityPositionConstraint version by setting the name of the constraint to "use_equality_constraints". But the latter will ignore bounds on other dimensions.

Definition at line 67 of file ompl_constraints.h.

Constructor & Destructor Documentation

◆ Bounds() [1/2]

ompl_interface::Bounds::Bounds ( )

Definition at line 55 of file ompl_constraints.cpp.

◆ Bounds() [2/2]

ompl_interface::Bounds::Bounds ( const std::vector< double > &  lower,
const std::vector< double > &  upper 
)

Definition at line 59 of file ompl_constraints.cpp.

Member Function Documentation

◆ derivative()

Eigen::VectorXd ompl_interface::Bounds::derivative ( const Eigen::Ref< const Eigen::VectorXd > &  x) const

Derivative of the penalty function ^ | | -1-1-1 0 0 0 +1+1+1 |---------------------—>

Definition at line 89 of file ompl_constraints.cpp.

Here is the caller graph for this function:

◆ penalty()

Eigen::VectorXd ompl_interface::Bounds::penalty ( const Eigen::Ref< const Eigen::VectorXd > &  x) const

Distance to region inside bounds.

Distance of a given value outside the bounds, zero inside the bounds. Creates a penalty function that looks like this:

(penalty) ^ | \ / | \ / | _____/ |-------------—> (variable to be constrained)

Definition at line 66 of file ompl_constraints.cpp.

Here is the caller graph for this function:

◆ size()

std::size_t ompl_interface::Bounds::size ( ) const

Definition at line 112 of file ompl_constraints.cpp.

Here is the caller graph for this function:

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  os,
const ompl_interface::Bounds bounds 
)
friend

Pretty printing of bounds.

Definition at line 117 of file ompl_constraints.cpp.


The documentation for this class was generated from the following files: