Built In Behaviors
In MoveIt Pro, Behaviors are the fundamental building blocks for creating Objectives. Each Behavior defines a discrete step in sensing, planning, motion execution, or decision-making. MoveIt Pro provides a collection of predefined Behavior plugins that enable core planning, execution, and perception capabilities.
You can submit a request to access Behavior Source code.
List of Core Behaviors
Documentation for built-in Behaviors are provided in the MoveIt Pro Behavior Package.
When to Use Input Ports and Parameters
Behaviors should be written similar to functions, that is, they should have single responsibility and, ideally, no side effects. Data can be passed between Behaviors using input and output ports. The ports should be used for runtime generated data that isn't known ahead of time.
Within an Objective definition, it is possible to use input ports with hardcoded values to pass in "static" parameters that are known ahead of time, but it is not recommended to do so. It makes for a much cleaner Objective definition, especially when the number of parameterized Behaviors is high, if the parameters are placed to a separate configuration file. In addition, more complex data is easier to read and maintain if it is placed into a configuration file. A typical example of a more complex data would be a 6DOF pose.
Motion Planning and Execution via MTC Behaviors
A core feature of the MoveIt Pro SDK is the ability to compose Moveit Task Constructor (MTC) Tasks that define motion plans.
More information on MTC can be found as part of MoveIt2 Tutorials.
Multiple Behaviors work together to create an MTC Task, populate it with a sequence of Stages, and finally plan and execute it. Several minimal requirements must be satisfied:
- The InitializeMTCTask Behavior must be run first to create a new Task. The key for the output data port should be set to a new value unique to this Task within the scope of the Objective. Each Task should only be configured by a single InitializeMTCTask Behavior.
- Note: While multiple subsequent Behaviors may modify the Task, the Task will not be planned until it is passed to a PlanMTCTask Behavior. Until that point, it only represents a "recipe" for a motion planning scenario.
- The SetupMTCCurrentState Behavior must be run next to add a connection between the current state of the robot and the planned motion.
- Note: Subsequent work may add different Behaviors that can be used instead of SetupMTCCurrentState to allow multiple Tasks to be planned concurrently.
- After that, additional SetupMTC Behaviors may be added to the Task to add additional motion planning MTC Stages.
- Once the Task has been configured as desired, add a PlanMTCTask Behavior that takes this Task as an input port. Set the key of the output data port for the solution to a new value unique for this Task. This Behavior will attempt to solve the MTC Task and produce a solution if one exists.
- Finally, add an ExecuteMTCTask Behavior that takes the solution as an input port. When this Behavior is executed, it will use MoveIt's motion execution interface to perform the planned robot trajectory.
When the Behavior Tree for the Objective is executed, each of these Behaviors will individually succeed or fail. The Behavior Tree can be designed to perform a fallback action if any individual Behavior fails.