moveit2
The MoveIt Motion Planning Framework for ROS 2.
|
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... | |
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.
ompl_interface::Bounds::Bounds | ( | ) |
Definition at line 48 of file ompl_constraints.cpp.
ompl_interface::Bounds::Bounds | ( | const std::vector< double > & | lower, |
const std::vector< double > & | upper | ||
) |
Definition at line 52 of file ompl_constraints.cpp.
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 82 of file ompl_constraints.cpp.
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 59 of file ompl_constraints.cpp.
std::size_t ompl_interface::Bounds::size | ( | ) | const |
|
friend |
Pretty printing of bounds.
Definition at line 110 of file ompl_constraints.cpp.