Skip to main content
Version: 7

Planning With Orientation Constraints

Skill Level: Intermediate

For certain applications, motion plans that are generated require orientation constraints on things like the robot's gripper. One example of this is moving a glass of water - the robot's gripper needs to be oriented in a way that doesn't spill any water while moving the glass.

This how-to guide will walk through an example Objective that executes a motion plan with orientation constraints, and explain how to enforce orientation constraints when building Objectives.

Launch MoveIt Pro

We assume you have already installed MoveIt Pro to the default install location. Launch the application using:

moveit_pro run -c lab_sim

1. Run the "Move Beakers to Burners" Objective

To get an understanding of what orientation constrained motion planning looks like in practice, run the Move Beakers to Burners Objective. You'll see that the robot gripper keeps the same orientation throughout the motion plan, avoiding any sideways tilt so that no liquid is spilled:

2. Inspecting the Orientation Constraints in the "Move Beakers to Burners" Objective

After running the Objective, open the Behavior Tree to learn about how the orientation constraints are implemented. Select the Build tab, click on the Objective, and then select "Edit". Expand the "Constrained Pick And Place Subtree" block, and look at the "Move to Waypoint" port values.

You will notice three port names that are used to enforce orientation constraints:

  1. keep_orientation: If true, an orientation constraint will be enforced at the links specified in keep_orientation_link_names.
  2. keep_orientation_tolerance: Specifies the maximum angular error allowed with respect to the initial orientation, for the entire motion.
  3. keep_orientation_link_names: Specifies the link names where the orientation constraint will be enforced. Multiple links can be specified by separating them with semicolons, but note that the planning time will increase considerably with the number of constrained links.

Please check out the PlanToJointGoal Behavior description in the objective editor for more detailed information about how the constraint is enforced.

3. Using Orientation Constraints in Motion Plans

keep_orientation, keep_orientation_tolerance and keep_orientation_link_names are ultimately used by the ProRRT planning Behaviors PlanToJointGoal (standalone planning) or SetupMTCPlanToJointState (MTC tasks). If you need to constrain any specific motion plan in your setup, just set those ports in the corresponding Behaviors.

For your convenience, those ports are plumbed through the "Move to Waypoint" and "Move to Pose" subtrees, so you can constraint the motion directly via those subtrees as well.