Tutorials/1.4/build robot/simple gripper


 * 1) Tutorial: Make a Simple Gripper#


 * Prerequisites:** Model Database

This tutorial describes how to make a simple two-bar pinching gripper.


 * 1) Setup your model directory

Reference Model Database documentation and SDF documentation for this tutorial.


 * 1) Setup your workspace

1. Create a directory for the world file.

mkdir ~/simple_gripper_tutorial; cd ~/simple_gripper_tutorial

1. We will begin with a simple empty world. Create a world file: gedit ~/simple_gripper_tutorial/gripper.world

Copy the following SDF into `gripper.world`:  

model://ground_plane

model://sun

model://my_gripper

1. Create a model directory inside ~/.gazebo. This is where we'll put the model files:

mkdir -p ~/.gazebo/models/my_gripper cd ~/.gazebo/models/my_gripper

1. Let's layout the basic structure of our gripper. The easiest way to accomplish this is to make a `static` model and add in the links one at a time. A static model means the links will not move when the simulator starts. This will allow you to start the simulator, and visually inspect the link placement before adding joints.

1. Create a `model.config` file

gedit ~/.gazebo/models/my_gripper/model.config

1. Fill `model.config` with the following contents:



My Gripper 1.0          simple_gripper.sdf

My Name me@my.email

My awesome robot.

1. Make a new file for the model:

gedit ~/.gazebo/models/my_gripper/simple_gripper.sdf

1. Copy the following code in the `simple_gripper.sdf` file.

   -0.15 0.0 0.5 0 0 0                0 0 -0.5 0 0 0                     0.01                     0                     0                     0.01                     0                     0.01                 10.0                         0.2 0.2 1.0                         0.2 0.2 1.1                     Gazebo/Purple 0.0 0.0 0.05 0 0 0                    0.01                     0                     0                     0.01                     0                     0.01                 0.5                         0.1 0.2 0.1                         0.1 0.2 0.1                     Gazebo/Red  0.1 0.2 0.05 0 0 -0.78539                    0.01                     0                     0                     0.01                     0                     0.01                 0.1                         0.1 0.3 0.1                         0.1 0.3 0.1                     Gazebo/Blue  0.336 0.3 0.05 0 0 1.5707                    0.01                     0                     0                     0.01                     0                     0.01                 0.1                         0.1 0.2 0.1                         0.1 0.2 0.1                     Gazebo/Blue  0.1 -0.2 0.05 0 0 .78539                    0.01                     0                     0                     0.01                     0                     0.01                 0.1                         0.1 0.3 0.1                         0.1 0.3 0.1                     Gazebo/Green  0.336 -0.3 0.05 0 0 1.5707                    0.01                     0                     0                     0.01                     0                     0.01                 0.1                         0.1 0.2 0.1                         0.1 0.2 0.1                     Gazebo/Green true

1. Run the world file to visualize what we have created up to this point. gazebo ~/simple_gripper_tutorial/gripper.world 1. Once we are happy with the layout of the links, we can add in the joints, by copying the following code into the `simple_gripper.model` file before the ` ` line.  0 -0.15 0 0 0 0            left_finger palm -0.4                    0.4                 0 0 1          0 0.1 0 0 0 0            left_finger_tip left_finger -0.4                    0.4                 0 0 1          0 0.15 0 0 0 0            right_finger palm -0.4                    0.4                 0 0 1          0 0.1 0 0 0 0            right_finger_tip right_finger -0.4                    0.4                 0 0 1          palm riser 0                    0.9                 0 0 1

1. And make the model non-static:

<model name="simple_gripper"> false

The model should look like:



1. Run the world file again. This time right click on the model and select "View->Joints". The newly created joints will be displayed. 1. You can also control the forces on each joint using the Joint Control widget. Select the model, and pull the gripper on the right side of the render widget to the left. This widget displays a list of sliders, one for each joint. Use the sliders to apply forces to each joint, and you should see the gripper move.



1. Optional:

1. Add a small box or cylinder to the world, and position it in the gripper. 1. Try to use the joint control GUI interface to pick up the object.

Tip: You may need to adjust the interia of the object.


 * 1) Next

Next: Attach Gripper to Robot