moveit2
The MoveIt Motion Planning Framework for ROS 2.
Public Member Functions | Protected Attributes | List of all members
kinematic_constraints::KinematicConstraintSet Class Reference

A class that contains many different constraints, and can check RobotState *versus the full set. A set is satisfied if and only if all constraints are satisfied. More...

#include <kinematic_constraint.h>

Collaboration diagram for kinematic_constraints::KinematicConstraintSet:
Collaboration graph
[legend]

Public Member Functions

 KinematicConstraintSet (const moveit::core::RobotModelConstPtr &model)
 Constructor. More...
 
 ~KinematicConstraintSet ()
 
void clear ()
 Clear the stored constraints. More...
 
bool add (const moveit_msgs::msg::Constraints &c, const moveit::core::Transforms &tf)
 Add all known constraints. More...
 
bool add (const std::vector< moveit_msgs::msg::JointConstraint > &jc)
 Add a vector of joint constraints. More...
 
bool add (const std::vector< moveit_msgs::msg::PositionConstraint > &pc, const moveit::core::Transforms &tf)
 Add a vector of position constraints. More...
 
bool add (const std::vector< moveit_msgs::msg::OrientationConstraint > &oc, const moveit::core::Transforms &tf)
 Add a vector of orientation constraints. More...
 
bool add (const std::vector< moveit_msgs::msg::VisibilityConstraint > &vc, const moveit::core::Transforms &tf)
 Add a vector of visibility constraints. More...
 
ConstraintEvaluationResult decide (const moveit::core::RobotState &state, bool verbose=false) const
 Determines whether all constraints are satisfied by state, returning a single evaluation result. More...
 
ConstraintEvaluationResult decide (const moveit::core::RobotState &state, std::vector< ConstraintEvaluationResult > &results, bool verbose=false) const
 Determines whether all constraints are satisfied by state, returning a vector of results through a parameter in addition to a summed result. More...
 
bool equal (const KinematicConstraintSet &other, double margin) const
 Whether or not another KinematicConstraintSet is equal to this one. More...
 
void print (std::ostream &out=std::cout) const
 Print the constraint data. More...
 
const std::vector< moveit_msgs::msg::PositionConstraint > & getPositionConstraints () const
 Get all position constraints in the set. More...
 
const std::vector< moveit_msgs::msg::OrientationConstraint > & getOrientationConstraints () const
 Get all orientation constraints in the set. More...
 
const std::vector< moveit_msgs::msg::JointConstraint > & getJointConstraints () const
 Get all joint constraints in the set. More...
 
const std::vector< moveit_msgs::msg::VisibilityConstraint > & getVisibilityConstraints () const
 Get all visibility constraints in the set. More...
 
const moveit_msgs::msg::Constraints & getAllConstraints () const
 Get all constraints in the set. More...
 
bool empty () const
 Returns whether or not there are any constraints in the set. More...
 

Protected Attributes

moveit::core::RobotModelConstPtr robot_model_
 The kinematic model used for by the Set. More...
 
std::vector< KinematicConstraintPtr > kinematic_constraints_
 Shared pointers to all the member constraints. More...
 
std::vector< moveit_msgs::msg::JointConstraint > joint_constraints_
 Messages corresponding to all internal joint constraints. More...
 
std::vector< moveit_msgs::msg::PositionConstraint > position_constraints_
 Messages corresponding to all internal position constraints. More...
 
std::vector< moveit_msgs::msg::OrientationConstraint > orientation_constraints_
 Messages corresponding to all internal orientation constraints. More...
 
std::vector< moveit_msgs::msg::VisibilityConstraint > visibility_constraints_
 Messages corresponding to all internal visibility constraints. More...
 
moveit_msgs::msg::Constraints all_constraints_
 Messages corresponding to all internal constraints. More...
 

Detailed Description

A class that contains many different constraints, and can check RobotState *versus the full set. A set is satisfied if and only if all constraints are satisfied.

The set may contain any number of different kinds of constraints. All constraints, including invalid ones, are stored internally.

Definition at line 871 of file kinematic_constraint.h.

Constructor & Destructor Documentation

◆ KinematicConstraintSet()

kinematic_constraints::KinematicConstraintSet::KinematicConstraintSet ( const moveit::core::RobotModelConstPtr &  model)
inline

Constructor.

Parameters
[in]modelThe kinematic model used for constraint evaluation

Definition at line 882 of file kinematic_constraint.h.

◆ ~KinematicConstraintSet()

kinematic_constraints::KinematicConstraintSet::~KinematicConstraintSet ( )
inline

Definition at line 886 of file kinematic_constraint.h.

Here is the call graph for this function:

Member Function Documentation

◆ add() [1/5]

bool kinematic_constraints::KinematicConstraintSet::add ( const moveit_msgs::msg::Constraints &  c,
const moveit::core::Transforms tf 
)

Add all known constraints.

Parameters
[in]cA message potentially contain vectors of constraints of add types
Returns
Whether or not all constraints could be successfully configured given the contents of the message. The KinematicConstraintSet can still be used even if the addition returns false.

Definition at line 1250 of file kinematic_constraint.cpp.

Here is the caller graph for this function:

◆ add() [2/5]

bool kinematic_constraints::KinematicConstraintSet::add ( const std::vector< moveit_msgs::msg::JointConstraint > &  jc)

Add a vector of joint constraints.

Parameters
[in]jcA vector of joint constraints
Returns
Will return true only if all constraints are valid, and false otherwise

Definition at line 1187 of file kinematic_constraint.cpp.

Here is the call graph for this function:

◆ add() [3/5]

bool kinematic_constraints::KinematicConstraintSet::add ( const std::vector< moveit_msgs::msg::OrientationConstraint > &  oc,
const moveit::core::Transforms tf 
)

Add a vector of orientation constraints.

Parameters
[in]ocA vector of orientation constraints
Returns
Will return true only if all constraints are valid, and false otherwise

Definition at line 1218 of file kinematic_constraint.cpp.

Here is the call graph for this function:

◆ add() [4/5]

bool kinematic_constraints::KinematicConstraintSet::add ( const std::vector< moveit_msgs::msg::PositionConstraint > &  pc,
const moveit::core::Transforms tf 
)

Add a vector of position constraints.

Parameters
[in]pcA vector of position constraints
Returns
Will return true only if all constraints are valid, and false otherwise

Definition at line 1202 of file kinematic_constraint.cpp.

Here is the call graph for this function:

◆ add() [5/5]

bool kinematic_constraints::KinematicConstraintSet::add ( const std::vector< moveit_msgs::msg::VisibilityConstraint > &  vc,
const moveit::core::Transforms tf 
)

Add a vector of visibility constraints.

Parameters
[in]vcA vector of visibility constraints
Returns
Will return true only if all constraints are valid, and false otherwise

Definition at line 1234 of file kinematic_constraint.cpp.

Here is the call graph for this function:

◆ clear()

void kinematic_constraints::KinematicConstraintSet::clear ( )

Clear the stored constraints.

Definition at line 1177 of file kinematic_constraint.cpp.

Here is the caller graph for this function:

◆ decide() [1/2]

ConstraintEvaluationResult kinematic_constraints::KinematicConstraintSet::decide ( const moveit::core::RobotState state,
bool  verbose = false 
) const

Determines whether all constraints are satisfied by state, returning a single evaluation result.

Parameters
[in]stateThe state to test
[in]verboseWhether or not to make each constraint give debug output
Returns
A single constraint evaluation result, where it will report satisfied only if all constraints are satisfied, and with a distance that is the sum of all individual distances.

Definition at line 1259 of file kinematic_constraint.cpp.

Here is the caller graph for this function:

◆ decide() [2/2]

ConstraintEvaluationResult kinematic_constraints::KinematicConstraintSet::decide ( const moveit::core::RobotState state,
std::vector< ConstraintEvaluationResult > &  results,
bool  verbose = false 
) const

Determines whether all constraints are satisfied by state, returning a vector of results through a parameter in addition to a summed result.

Parameters
[in]stateThe state to test
[out]resultsThe individual results from constraint evaluation on each constraint contained in the set.
[in]verboseWhether to print the results of each constraint check.
Returns
A single constraint evaluation result, where it will report satisfied only if all constraints are satisfied, and with a distance that is the sum of all individual distances.

Definition at line 1272 of file kinematic_constraint.cpp.

◆ empty()

bool kinematic_constraints::KinematicConstraintSet::empty ( ) const
inline

Returns whether or not there are any constraints in the set.

Returns
True if there are no constraints, otherwise false.

Definition at line 1061 of file kinematic_constraint.h.

Here is the caller graph for this function:

◆ equal()

bool kinematic_constraints::KinematicConstraintSet::equal ( const KinematicConstraintSet other,
double  margin 
) const

Whether or not another KinematicConstraintSet is equal to this one.

Equality means that for each constraint in this set there is a constraint in the other set for which equal() is true with the given margin. Multiple constraints in this set can be matched to single constraints in the other set. Some constraints in the other set may not be matched to constraints in this set.

Parameters
[in]otherThe other set against which to test
[in]marginThe margin to apply to all individual constraint equality tests
Returns
True if all constraints are matched, false otherwise

Definition at line 1295 of file kinematic_constraint.cpp.

Here is the caller graph for this function:

◆ getAllConstraints()

const moveit_msgs::msg::Constraints& kinematic_constraints::KinematicConstraintSet::getAllConstraints ( ) const
inline

Get all constraints in the set.

Returns
All constraints in a single message

Definition at line 1050 of file kinematic_constraint.h.

◆ getJointConstraints()

const std::vector<moveit_msgs::msg::JointConstraint>& kinematic_constraints::KinematicConstraintSet::getJointConstraints ( ) const
inline

Get all joint constraints in the set.

Returns
All joint constraints

Definition at line 1028 of file kinematic_constraint.h.

◆ getOrientationConstraints()

const std::vector<moveit_msgs::msg::OrientationConstraint>& kinematic_constraints::KinematicConstraintSet::getOrientationConstraints ( ) const
inline

Get all orientation constraints in the set.

Returns
All orientation constraints

Definition at line 1017 of file kinematic_constraint.h.

◆ getPositionConstraints()

const std::vector<moveit_msgs::msg::PositionConstraint>& kinematic_constraints::KinematicConstraintSet::getPositionConstraints ( ) const
inline

Get all position constraints in the set.

Returns
All position constraints

Definition at line 1006 of file kinematic_constraint.h.

◆ getVisibilityConstraints()

const std::vector<moveit_msgs::msg::VisibilityConstraint>& kinematic_constraints::KinematicConstraintSet::getVisibilityConstraints ( ) const
inline

Get all visibility constraints in the set.

Returns
All visibility constraints

Definition at line 1039 of file kinematic_constraint.h.

◆ print()

void kinematic_constraints::KinematicConstraintSet::print ( std::ostream &  out = std::cout) const

Print the constraint data.

Parameters
[in]outThe file stream for printing

Definition at line 1288 of file kinematic_constraint.cpp.

Member Data Documentation

◆ all_constraints_

moveit_msgs::msg::Constraints kinematic_constraints::KinematicConstraintSet::all_constraints_
protected

Messages corresponding to all internal constraints.

Definition at line 1081 of file kinematic_constraint.h.

◆ joint_constraints_

std::vector<moveit_msgs::msg::JointConstraint> kinematic_constraints::KinematicConstraintSet::joint_constraints_
protected

Messages corresponding to all internal joint constraints.

Definition at line 1071 of file kinematic_constraint.h.

◆ kinematic_constraints_

std::vector<KinematicConstraintPtr> kinematic_constraints::KinematicConstraintSet::kinematic_constraints_
protected

Shared pointers to all the member constraints.

Definition at line 1069 of file kinematic_constraint.h.

◆ orientation_constraints_

std::vector<moveit_msgs::msg::OrientationConstraint> kinematic_constraints::KinematicConstraintSet::orientation_constraints_
protected

Messages corresponding to all internal orientation constraints.

Definition at line 1075 of file kinematic_constraint.h.

◆ position_constraints_

std::vector<moveit_msgs::msg::PositionConstraint> kinematic_constraints::KinematicConstraintSet::position_constraints_
protected

Messages corresponding to all internal position constraints.

Definition at line 1073 of file kinematic_constraint.h.

◆ robot_model_

moveit::core::RobotModelConstPtr kinematic_constraints::KinematicConstraintSet::robot_model_
protected

The kinematic model used for by the Set.

Definition at line 1067 of file kinematic_constraint.h.

◆ visibility_constraints_

std::vector<moveit_msgs::msg::VisibilityConstraint> kinematic_constraints::KinematicConstraintSet::visibility_constraints_
protected

Messages corresponding to all internal visibility constraints.

Definition at line 1078 of file kinematic_constraint.h.


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