Public Member Functions
|virtual bool ||configure (const moveit_msgs::Constraints &constr)|
| ||Configures the IK constraint given a constraints message. |
|bool ||configure (const IKSamplingPose &sp)|
| ||Configures the Constraint given a IKSamplingPose. |
|double ||getIKTimeout () const |
| ||Gets the timeout argument passed to the IK solver. |
|const std::string & ||getLinkName () const |
| ||Gets the link name associated with this sampler. |
|virtual const std::string & ||getName () const |
| ||Get the name of the constraint sampler, for debugging purposes should be in CamelCase format. |
|getOrientationConstraint () const |
| ||Gets the orientation constraint associated with this sampler. |
|getPositionConstraint () const |
| ||Gets the position constraint associated with this sampler. |
|double ||getSamplingVolume () const |
| ||Gets the volume associated with the position and orientation constraints. |
| ||IKConstraintSampler (const planning_scene::PlanningSceneConstPtr &scene, const std::string &group_name)|
| ||Constructor. |
|virtual bool ||project (robot_state::RobotState &state, unsigned int max_attempts)|
| ||Project a sample given the constraints, updating the joint state group. This function allows the parameter max_attempts to be set. |
|virtual bool ||sample (robot_state::RobotState &state, const robot_state::RobotState &reference_state, unsigned int max_attempts)|
| ||Produces an IK sample. |
|bool ||samplePose (Eigen::Vector3d &pos, Eigen::Quaterniond &quat, const robot_state::RobotState &ks, unsigned int max_attempts)|
| ||Returns a pose that falls within the constraint regions. |
|void ||setIKTimeout (double timeout)|
| ||Sets the timeout argument passed to the IK solver. |
Protected Member Functions
|bool ||callIK (const geometry_msgs::Pose &ik_query, const kinematics::KinematicsBase::IKCallbackFn &adapted_ik_validity_callback, double timeout, robot_state::RobotState &state, bool use_as_seed)|
| ||Actually calls IK on the given pose, generating a random seed state. |
|virtual void ||clear ()|
| ||Clears all data from the constraint. |
|bool ||loadIKSolver ()|
| ||Performs checks and sets various internal values associated with the IK solver. |
|bool ||sampleHelper (robot_state::RobotState &state, const robot_state::RobotState &reference_state, unsigned int max_attempts, bool project)|
|bool ||validate (robot_state::RobotState &state) const |
| ||Holds the base from of the IK solver. |
| ||Holds the timeout associated with IK. |
| ||Holds the kinematics solver. |
| ||Random generator used by the sampler. |
| ||Holder for the pose used for sampling. |
| ||True if the frame associated with the kinematic model is different than the base frame of the IK solver. |
A class that allows the sampling of IK constraints.
An IK constraint can have a position constraint, and orientation constraint, or both. The constraint will attempt to sample a pose that adheres to the constraint, and then solves IK for that pose.
Definition at line 293 of file default_constraint_samplers.h.
Configures the IK constraint given a constraints message.
If the constraints message contains both orientation constraints and positions constraints, the function iterates through each potential pair until it finds a pair of position orientation constraints that lead to valid configuration of kinematic constraints. It creates an IKSamplingPose from these and calls configure(const IKSamplingPose &sp). If no pair leads to both having valid configuration, it will attempt to iterate through the position constraints in the Constraints message, calling configure(const IKSamplingPose &sp) on the resulting IKSamplingPose. Finally, if no valid position constraints exist it will attempt the same procedure with the orientation constraints. If no valid position or orientation constraints exist, it will return false. For more information, see the docs for configure(const IKSamplingPose &sp).
|constr||The Constraint message|
- True if some valid position and orientation constraints exist and the overloaded configuration function returns true. Otherwise, returns false.
Definition at line 277 of file default_constraint_samplers.cpp.
Gets the volume associated with the position and orientation constraints.
This function computes the volume of the sampling constraint. The volume associated with the position constraint is either the product of the volume of all position constraint regions, or 1.0 otherwise. The volume associated with the orientation constraint is the product of all the axis tolerances, or 1.0 otherwise. If both are specified, the product of the volumes is returned.
- Returns the sum of the volumes of all constraint regions associated with the position and orientation constraints.
Definition at line 310 of file default_constraint_samplers.cpp.
Produces an IK sample.
This function first calls the samplePose function to produce a position and orientation in the constraint region. It then calls IK on that pose. If a pose that satisfies the constraints can be determined, and IK returns a solution for that pose, then the joint values associated with the joint group will be populated with the results of the IK, and the function will return true. The function will attempt to sample a pose up to max_attempts number of times, and then call IK on that value. If IK is not successful, it will repeat the pose sample and IK procedure max_attempt times. If in any iteration a valid pose cannot be sample within max_attempts time, it will return false.
|jsg||The joint state group in question. Must match the group passed in the constructor or will return false. |
|ks||A reference state that will be used for transforming the IK poses |
|max_attempts||The number of attempts to both sample and try IK|
- True if a valid sample pose was produced and valid IK found for that pose. Otherwise false.
Definition at line 534 of file default_constraint_samplers.cpp.
Returns a pose that falls within the constraint regions.
If a position constraint is specified, then a position is produced by selecting a random region among the constraint regions and taking a sample in that region. If no region is valid the function returns false. If no position constraint is specified, a position is produced by assigning a random valid value to each group joint, performing forward kinematics, and taking the resulting pose. If an orientation constraint is specified, then an quaternion is produced by sampling a difference value within the axis tolerances and applying the difference rotation to the orientation constraint target. Otherwise, a random quaternion is produced.
|[out]||pos||The position component of the sample |
|[out]||quat||The orientation component of the sample |
|[in]||ks||The reference state used for performing transforms |
|[in]||max_attempts||The maximum attempts to try to sample - applies only to the position constraint|
- True if a sample was successfully produced, otherwise false
Definition at line 409 of file default_constraint_samplers.cpp.