Executes a policy as continuous, collision-checked motion on the arm and optional gripper.
More...
Executes a policy as continuous, collision-checked motion on the arm and optional gripper.
The Behavior gathers the current observation (joint positions and camera images), asks a policy for the next chunk over the GetActionChunk service, and feeds it to a ChunkedTrajectoryExecutor that blends it onto the running motion at the seam, checks it against the commanded joints' position, velocity, and acceleration limits and for collision of the robot with itself and with the world, and stitches it onto the controller. It requests the next chunk before the committed motion drains so the robot does not pause at chunk boundaries, and stops cleanly once total_action_steps points have run, when the policy reports no more actions, or when the Behavior is halted.
The collision checks read a planning scene that is monitored for the whole run and honor its AllowedCollisionMatrix. The matrix and the set of attached objects are read once at run start and not refreshed, so any contact the task means to make, such as a grasp or a place, must be allowed with a collision rule before this Behavior starts. Motion already sent to the controller but not yet executed is re-validated against the current scene when a world-geometry update arrives, and again each time the Behavior requests the next chunk from the policy; a violation cancels the controller goals, the controller decelerates to rest, and the Behavior fails, reporting the contact.
The policy is any node that serves the GetActionChunk ROS 2 service (moveit_pro_ml_msgs/srv/GetActionChunk); the serving node can wrap an in-process model adapter, a local GPU server, or a remote one. Every chunk is blended onto the running motion at the seam regardless of the policy; the seam blend is never delegated to the producer. When the policy runs real-time chunking (policy_uses_real_time_chunking), the Behavior additionally sends it the previous chunk's unexecuted tail and the state that chunk was anchored to, so it continues the committed motion and the blend has less to correct.
The arm and the gripper are driven on separate paths from the same chunk. The arm joints are streamed to the trajectory controller; the gripper, when one is configured, is the joint named by gripper_joint_name, which the chunk must carry as its one joint beyond the arm group (only single-DOF grippers are supported), and is commanded through the GripperCommand action server named by gripper_command_action_name, streamed step by step across each committed chunk so it tracks the policy's gripper motion rather than holding one value per chunk. The two gripper ports are set together or both left empty. With a gripper configured, the joint's sensed position is appended to the robot state sent to the policy after the arm group's joints, so the policy observes the gripper it commands; the executor and the controller still command the arm joints only. Leaving both ports empty runs the arm only and leaves the gripper to a separate Behavior. Each gripper target is checked for finiteness and clamped to the gripper joint's position limits. The gripper's links are part of the collision check at the pose the monitored scene currently reports, so the gripper geometry is considered, but the commanded gripper opening itself is not re-validated per step the way the arm chunk is. A halt cancels both the arm controller goals and any in-flight gripper goal; a position controller may still hold its last gripper setpoint after a cancel, so a halt is not guaranteed to reopen the gripper.
| Data Port Name | Port Type | Object Type |
| policy_service_name | input | std::string |
| joint_group_name | input | std::string |
| total_action_steps | input | int |
| prompt | input | std::string |
| committed_action_steps | input | int |
| dt | input | double |
| num_interpolation_points | input | int |
| link_padding | input | double |
| goal_path_tolerance | input | double |
| policy_tracking_weight | input | double |
| policy_uses_real_time_chunking | input | bool |
| guidance_horizon | input | int |
| controller_action_name | input | std::string |
| absolute_force_torque_threshold | input | std::vector<double> |
| policy_call_timeout | input | double |
| image_names | input | std::vector<std::string> |
| image_topics | input | std::vector<std::string> |
| joint_states_topic | input | std::string |
| gripper_command_action_name | input | std::string |
| gripper_joint_name | input | std::string |