Getting ready

First of all, we are going to see how to perform grasping in MoveIt. This means we are going to perform it without controlling the real robot.

For this, we are going to be using the moveit_simple_grasps package. This package is very useful for generating grasp poses for simple objects, such as blocks or cylinders, and it's quite simple, which helps in the process of learning. This package takes the position of the object to be grasped as input, and generates the necessary grasping sequences in order to pick the object up.

This package already supports robots such as Baxter, REEM, and Clam arm, among others, but it is quite easy to interface any other custom manipulator robot to the package, without having to modify too many of the codes.

First of all, we will create a new package called myrobot_grasping. Inside this package, create a new folder named launch, which will contain a launch file called grasp_generator_server.launch. Copy the following content inside of this file:

<launch> 
  <arg name="robot" default="fetch"/> 
  <arg name="group"        default="arm"/> 
  <arg name="end_effector" default="gripper"/> 
  <node pkg="moveit_simple_grasps" type="moveit_simple_grasps_server" name="moveit_simple_grasps_server"> 
    <param name="group"        value="$(arg group)"/>  
    <param name="end_effector" value="$(arg end_effector)"/> 
    <rosparam command="load" file="$(find fetch_gazebo)/config/$(arg robot)_grasp_data.yaml"/>  
  </node> 
</launch> 

Basically, in this launch file, we are starting a grasp server that will provide grasp sequences to a grasp client node. We need to specify the following in the node:

  • The planning group of the arm
  • The planning group of the end-effector

We are also going to load the fetch_grasp_data.yaml file, which will contain detailed information about the gripper. We are going to create this file now.

Inside this package, we will create a new folder named config, and create a new file named fetch_grasp_data.yaml inside of it before copying the following contents into the file:

base_link: 'base_link' 
gripper: 
  #The end effector name for grasping 
  end_effector_name: 'gripper' 
   
  # Gripper joints 
  joints: ['l_gripper_finger_joint', 'r_gripper_finger_joint'] 
   
  #Posture of grippers before grasping 
  pregrasp_posture: [0.048, 0.048] 
  pregrasp_time_from_start: 4.0 
  grasp_posture: [0.016, 0.016] 
  grasp_time_from_start: 4.0 
  postplace_time_from_start: 4.0 
   
  # Desired pose from end effector to grasp [x, y, z] + [R, P, Y] 
  grasp_pose_to_eef: [-0.12, 0.0, 0.0] 
  grasp_pose_to_eef_rotation: [0.0, 0.0, 0.0] 
  end_effector_parent_link: 'wrist_roll_link' 
 

So, in this file, we are basically providing detailed information about the gripper. These parameters can be tuned in order to improve the grasping process. The most important parameters that we are defining here are as follows:

  • end_effector_name: The name of the end-effector group, as stated in the MoveIt package
  • joints: The joints that form the gripper
  • pregrasp_posture: The position of the gripper before grasping (open position)
  • pregrasp_time_from_start: The time to wait before grasping
  • grasp_posture: The position of the gripper when grasping (closed position)
  • grasp_time_from_start: The time to wait after grasping
  • postplace_time_from_start: The name of the end-effector
  • grasp_pose_to_eef: The desired pose from end-effector to grasp—[xyz]
  • grasp_pose_to_eef: The desired pose from end-effector to grasp—[roll, pitch, yaw]
  • end_effector_parent_link: The name of the link that connects the gripper to the robot

So, we have now created the basic structure to create a grasping server, which will allow us to send object positions to this server, and it will provide us with a sequence so that we can grasp the specified object.

But, for that, we need to communicate with that server, and that's exactly what we are going to learn in the next subsection.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.16.51.157