moveit2
The MoveIt Motion Planning Framework for ROS 2.
Loading...
Searching...
No Matches
ompl_interface::OrientationConstraint Class Reference

Orientation constraints parameterized using exponential coordinates. More...

#include <ompl_constraints.hpp>

Inheritance diagram for ompl_interface::OrientationConstraint:
Collaboration diagram for ompl_interface::OrientationConstraint:

Public Member Functions

 OrientationConstraint (const moveit::core::RobotModelConstPtr &robot_model, const std::string &group, const unsigned int num_dofs)
void parseConstraintMsg (const moveit_msgs::msg::Constraints &constraints) override
 Parse bounds on orientation parameters from MoveIt's constraint message.
Public Member Functions inherited from ompl_interface::BaseConstraint
 BaseConstraint (const moveit::core::RobotModelConstPtr &robot_model, const std::string &group, const unsigned int num_dofs, const unsigned int num_cons=3)
 Construct a BaseConstraint using 3 num_cons by default because all constraints currently implemented have 3 constraint equations.
void init (const moveit_msgs::msg::Constraints &constraints)
 Initialize constraint based on message content.
void function (const Eigen::Ref< const Eigen::VectorXd > &joint_values, Eigen::Ref< Eigen::VectorXd > out) const override
void jacobian (const Eigen::Ref< const Eigen::VectorXd > &joint_values, Eigen::Ref< Eigen::MatrixXd > out) const override
 Jacobian of the constraint function.
Eigen::Isometry3d forwardKinematics (const Eigen::Ref< const Eigen::VectorXd > &joint_values) const
 Wrapper for forward kinematics calculated by MoveIt's Robot State.
Eigen::MatrixXd robotGeometricJacobian (const Eigen::Ref< const Eigen::VectorXd > &joint_values) const
 Calculate the robot's geometric Jacobian using MoveIt's Robot State.
const std::string & getLinkName ()
const Eigen::Vector3d getTargetPosition ()
const Eigen::Quaterniond getTargetOrientation ()

Additional Inherited Members

Public Attributes inherited from ompl_interface::BaseConstraint
 const
 For inequality constraints: calculate the value of the parameter that is being constrained by the bounds.
Protected Attributes inherited from ompl_interface::BaseConstraint
TSStateStorage state_storage_
 Thread-safe storage of the robot state.
const moveit::core::JointModelGroupjoint_model_group_
std::string link_name_
 Robot link the constraints are applied to.
Bounds bounds_
 Upper and lower bounds on constrained variables.
Eigen::Vector3d target_position_
 target for equality constraints, nominal value for inequality constraints.
Eigen::Quaterniond target_orientation_
 target for equality constraints, nominal value for inequality constraints.

Detailed Description

Orientation constraints parameterized using exponential coordinates.

An orientation constraint is modeled as a deviation from a target orientation. The deviation is represented using exponential coordinates. A three element vector represents the rotation axis multiplied with the angle in radians around this axis.

R_error = R_end_effector ^ (-1) * R_target R_error -> rotation angle and axis (using Eigen3) error = angle * axis (vector with three elements)

And then the constraints can be written as

  • absolute_x_axis_tolerance < error[0] < absolute_x_axis_tolerance
  • absolute_y_axis_tolerance < error[1] < absolute_y_axis_tolerance
  • absolute_z_axis_tolerance < error[2] < absolute_z_axis_tolerance

IMPORTANT It is NOT how orientation error is handled in the default MoveIt constraint samplers, where XYZ intrinsic euler angles are used. Using exponential coordinates is analog to how orientation error is calculated in the TrajOpt motion planner.

Definition at line 377 of file ompl_constraints.hpp.

Constructor & Destructor Documentation

◆ OrientationConstraint()

ompl_interface::OrientationConstraint::OrientationConstraint ( const moveit::core::RobotModelConstPtr & robot_model,
const std::string & group,
const unsigned int num_dofs )
inline

Definition at line 380 of file ompl_constraints.hpp.

Here is the call graph for this function:

Member Function Documentation

◆ parseConstraintMsg()

void ompl_interface::OrientationConstraint::parseConstraintMsg ( const moveit_msgs::msg::Constraints & constraints)
overridevirtual

Parse bounds on orientation parameters from MoveIt's constraint message.

This can be non-trivial given the often complex structure of these messages.

Implements ompl_interface::BaseConstraint.

Definition at line 310 of file ompl_constraints.cpp.

Here is the call graph for this function:

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