Orientation-Constrained Planning
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 the Runtime and Desktop App
We assume you have already installed MoveIt Pro to the default install location. Start the MoveIt Pro Runtime using:
moveit_pro run -c lab_sim
Then launch or connect the separately distributed MoveIt Pro Desktop App. The Runtime does not serve a bundled user interface.
1. Run the Move Flasks to Burners Objective
To get an understanding of what orientation constrained motion planning looks like in practice, run the Move Flasks 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 Flasks to Burners Objective
After running the Objective, edit the Behavior Tree to learn about how the orientation constraints are implemented.
Expand a Constrained Pick And Place Subtree block down to the PlanToJointGoal Behavior, and look at its orientation_constraint port.
Orientation constraints are set through the single orientation_constraint port on the ProRRT planning Behaviors. The port holds a list of per-link entries, each specifying:
link_name: The link where the orientation constraint will be enforced.angle_tolerance: The maximum angular error allowed with respect to the initial orientation, in radians, for the entire motion.
To edit the constraint, click the edit icon next to the orientation_constraint port to open a dialog where you can add links and set each link's tolerance. Constraining multiple links is supported, but note that the planning time increases considerably with the number of constrained links.
Make sure the orientation of the constrained link at the goal is within the tolerance of its initial orientation. If attempting an infeasible goal, MoveIt Pro will report the error that "The goal joint positions are not valid".
See 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
The orientation_constraint port is accepted by the ProRRT planning Behaviors PlanToJointGoal (standalone planning), SetupMTCPlanToRobotState, SetupMTCPlanToPose, and SetupMTCConnectWithProRRT (MTC tasks).
If you need to constrain any specific motion plan in your setup, just set that port on the corresponding Behavior.
keep_orientationEarlier releases exposed keep_orientation, keep_orientation_tolerance, and keep_orientation_link_names ports. These were removed in 10.0 in favor of orientation_constraint. See the 10.0 migration guide for how to port existing Objectives.
The same ProRRT Behaviors also accept a joint_range_constraint port, to tighten the allowed range for specific joints during a single motion, and an optimization_params port, to tune RRT seed attempts and Informed RRT* refinement. See Motion Planning Best Practices for when to use each.