Create a Pick and Place Objective

Tutorial Level: Beginner

This tutorial will walk you through how to use the Objective Builder and the waypoints editor to create a basic pick and place application. The demo will use pre-saved waypoints to move to different locations.

The high-level plan is to have the robot execute a sequence of four steps:

  1. Open the gripper.

  2. Move to the “Pick” position.

  3. Close the gripper.

  4. Move to the “Place” position.

The sequence will repeat indefinitely unless canceled by the user, or until one of the Behaviors fails (in planning or execution).

Launch MoveIt Studio

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

cd $HOME/moveit_studio
./moveit_studio run

1. Create and Edit Waypoints

A waypoint is a saved robot joint pose that the arm can be commanded to move to using the buttons from the “Endpoint” tab. For this tutorial, there is an existing waypoint: Place, and one that we will create: Pick. Pressing the Place button will move the robot to the saved waypoint.

Give it a try!

../../../_images/waypoints_place_highlights.png

Waypoints can be created, updated, or deleted directly from the “Endpoint” tab. The robot’s current pose will always be persisted when creating or updating waypoints.

Using either the “Endpoint” tab or the “Joints” tab, manually drive the robot to a new pose for the Pick waypoint.

../../../_images/joint_jogging_tab.png

When the robot is in a reasonable pose, return to the “Endpoint” tab. Expand the right side panel using the top right “More” button to open the waypoints editor side panel.

../../../_images/waypoint_creation_more_button.png

To create a new waypoint from the robot’s current pose, click on “New”.

../../../_images/waypoint_creation_create_button.png

Then enter details for the Pick waypoint. When you are satisfied, click “Create”.

../../../_images/waypoint_creation_new_joint_state.png

The waypoint is now available in the side menu and top navigation menu. Clicking the Pick and Place waypoints will take the robot back and forth between the two poses.

../../../_images/waypoint_creation_pick_made.png

Saved waypoints can also be overwritten with new poses. From the Place waypoint, use the “Endpoint” or “Joints” tab to jog the robot to a new pose.

Open the waypoints editor side panel. Next to the Place waypoint, select the three dots to open the options menu, and click “Edit Position”,

../../../_images/waypoint_creation_editing_waypoint.png

A popup will appear with a warning about overwriting the existing saved waypoint. To confirm your changes, click “Save”.

../../../_images/waypoint_creation_edit_place.png

You have successfully saved the waypoint.

Now use the button on the “Endpoint” tab to move to the updated poses, or use them in an Objective!

2. Create New Objective

Once the Pick and Place waypoints have been made, open the “Objective Builder” screen and click the “New” button to create a new Objective.

../../../_images/objective_new.png

Enter the following information and click the “Create” button.

  • Name: Waypoints Pick and Place

  • File Name: waypoints_pick_and_place

  • Description: Pick and Place at given positions.

../../../_images/objective_create.png

The Objective has been created and can now be edited or run in the UI. Click on “Edit Objective” to open the editor.

../../../_images/objective_create_edit.png

A new Objective will be created and displayed as a node called “Waypoints Pick and Place”.

3. Add Behaviors

While editing an Objective in the Objective Builder, the full list of Behaviors available for inclusion is provided in the left panel. Additional information about each Behavior is available by selecting one, and hovering the cursor over the info icon.

The first Behavior needed is Keep Running Until Failure, which causes an Objective to be run forever. From the Behavior pane on the left, add the Decorator node called Keep Running Until Failure and connect it to the existing tree.

../../../_images/objective_step_1.png

Next, add a Control node called Sequence,

../../../_images/objective_step_2.png

All of the following nodes will descend from the Sequence Behavior. Add children to this node to encapsulate the desired Pick and Place motion. The first is a Behavior to open the gripper. Add a Move Gripper Action node as the first child of the Sequence.

This node requires the following input parameters:

  • gripper_command_action_namme: /robotiq_gripper_controller/gripper_cmd

  • position: 0

Zero is the position for the open gripper.

../../../_images/objective_step_3.png

Then, add a Move to Joint State node to move the robot to the “Pick” position. This node requires the following input parameters:

  • waypoint_name: Pick

  • planning_group_name: manipulator

  • controller_names: /joint_trajectory_controller /robotiq_gripper_controller

../../../_images/objective_step_4.png

Again, add a Move Gripper Action to close the gripper. The parameters are the same as the ones used in the previous node except for the position of the gripper:

  • gripper_command_action_namme: /robotiq_gripper_controller/gripper_cmd

  • position: 0.7929

0.7929 is the position for the closed gripper.

../../../_images/objective_step_5.png

Finally, we add a “Move to Joint State” node to move the robot to the “Place” position.

This node requires the following input parameters:

  • waypoint_name: Place

  • planning_group_name: manipulator

  • controller_names: /joint_trajectory_controller /robotiq_gripper_controller

../../../_images/objective_step_6.png

4. Run the New Objective

The last step is running the new Objective by clicking the “Run” button on the menu.

../../../_images/example.png

Your robot should now be running the Waypoints Pick and Place Objective. Great job!