Running an automated pick and place task
What you need before starting
A robot arm and gripper or hand integrated to GRIP, either through MoveIt!, via a launch file or using external software to control the hardware.
Prerequisites
In order to illustrate the same example both when the robot is integrated through MoveIt! and when one part of the robot is controlled by an external controller, we are going to use a UR5 robot arm with a EZGripper. If you want to replicate this tutorial, please clone this repository, this one and this one in /home/user/projects/shadow_robot/base/src
. Note that for the simulation of the EZGripper, you might want to clone this repository as well. Now, compile them:
cd /home/user/projects/shadow_robot/base catkin_make source devel/setup.bash
Pick and place with MoveIt! operating the full robot
In this section, we are going to run our robot in simulation because we cannot control the physical EZGripper via MoveIt!. Note that if you can operate your physical robot through MoveIt!, you should follow similar steps!
Integrate your robot following this tutorial. In our case, we have declared two planners, one for the group
arm_and_manipulator
that will control the arm and the other one forezgripper_finger_1
, that will control the gripper.
2. Define the joint states and/or poses that correspond to where the robot should move during the task. In order to illustrate the different features of the provided states, for this tutorial we defined 4 joint states and 1 pose as follow: Named joint states:
arm_grasp:
shoulder_pan_joint: 1.435950220551577
shoulder_lift_joint: -1.1216608234917134
elbow_joint: 1.6512809336516137
wrist_1_joint: -2.0680473866253664
wrist_2_joint: -1.5617962196319137
wrist_3_joint: -0.04593322487126095
open_gripper:
ezgripper_knuckle_palm_L1_1: 0
close_gripper:
ezgripper_knuckle_palm_L1_1: 1.93
Named poses:
drop_state:
reference_frame: world
position: {x: 0.26725, y: 0.24347, z: 0.975}
# You can change r,p,y to x,y,z,w for quaternion
orientation: {x: 0.72173, y: -0.69127, z: 0.03176, w: -0.015492}
Launch the robot (you can either click on the
Launch robot
button or use the shortcutCtrl+l
)In the
Task editor
tab, you should see a set of states ready to be used. You can drag and drop them into the editor area. In this tutorial we are only going to use two of them:ComputePlan
andMove
.Configure each state according to what you want to implement. Note that you can take the most of the dropdown lists to select registered poses and joint states.
Make sure all the sockets are properly connected. Note that to connect all the remaining sockets to the
Task failure
, you can use your right click and selectConnect free sockets
.Right click and select
Execute
. A window is going to prompt you for the name you want to give to the task. Once the new name provided, you should see the robot moving according to what you have just implemented!
Pick and place with MoveIt! and an external controller
In this section, we are going to carry out exactly the same task as in the previous section, but with our physical robot. As a result, we are going to use MoveIt! to control our robot arm and an external controller wrapped into a ROS action to operate the gripper.
Integrate your robot following this and this tutorial. In our case, we keep the same MoveIt! configuration package but only register one MoveIt! planner for the group
arm_and_manipulator
. In theHand configuration
tab, we use the following configuration for theExternal controller
editor:
EZGripperController:
file: /home/user/projects/shadow_robot/base/src/EZGripper/ezgripper_driver/controllers/joint_state_controller.py
action/service: /home/user/projects/shadow_robot/base/src/EZGripper/ezgripper_driver/action/JointStateGripper.action
server_name: joint_state_ezgripper_controller
node_type: joint_state_controller.py
number_outcomes: 2
Define your joint states and/or poses that correspond to where the robot should move during the task. In our case, we use exactly the same as the previous section.
Launch the robot (you can either click on the
Launch robot
button or use the shortcutCtrl+l
)In the
Task editor
tab, you should see a set of states ready to be used. You can drag and drop them into the editor area. In this tutorial we are going to use three of them:ComputePlan
,Move
and the state generated from the integrated controller (hereEZGripperController
).Configure each state according to what you want to implement. Note that you can still take the most of the dropdown lists in the generated states!
Make sure all the sockets are properly connected. Note that to connect all the remaining sockets to the
Task failure
, you can use your right click and selectConnect free sockets
.Right click and select
Execute
. A window is going to prompt you for the name you want to give to the task. Once the new name provided, you should see the robot moving according to what you have just implemented!
Note
You don’t have to use MoveIt! at all if you have your own controller and planner for the robot arm. The steps are mostly the same, except that you won’t have the states ComputePlan
and Move
but the generated one running your own code!