Skip to content
Matei Ciocarlie edited this page May 1, 2013 · 10 revisions

Welcome to the velo_gripper wiki!

Overview

The Velo gripper can be used either standalone, or mounted on a PR2 robot.

For mounting the Velo on a PR2, refer to the separate instructions.

For using the Velo standalone, you will need to power it up and also plug it into the Ethernet port of your computer. You can manufacture a cable that has a connector for the Velo MCB on one end and then splits into an Ethernet cable and a power cable. You will need to connect the power cable to a source able to provide ~20V and 1A. For a nice portable setup, an off-the-shelf laptop charger can fit the bill nicely.

Software Installation

You will need the following debians for the Velo:

sudo apt-get install ros-[distro]-velo-gripper ros-[distro]-pr2-ethercat-drivers ros-[distro]-pr2-robot

where [distro] stands for the version of ROS you are using.

Make sure your ROS environment is set, for example by using

source /opt/ros/[distro]/setup.bash

If using the Velo standalone, go ahead and power it up and plug it into the Ethernet port of your computer.

pr2-grant

If you are on a PR2, you can skip this step as all PR2's already have the pr2-grant in the right spot.

In the velo_controller/bin you will find an executable called pr2-grant. This utility allows the ros realtime loop to run with root privileges. Copy this executable to usr/local/bin and give it the right permissions:

roscd velo_controller/bin
sudo cp pr2-grant /usr/local/bin
sudo chown root:root /usr/local/bin/pr2-grant
sudo chmod +s /usr/local/bin/pr2-grant

WARNING: make sure you get the pr2-grant from velo_controller/bin and NOT from the root of the velo_controller package. The latter should not be there and will be removed from future releases.

Programming the Velo MCB

First, let's speak to the Velo board and the EtherCAT chain.

You'll need to figure out which eth interface the Velo is connected to. If using the Velo standalone, it can be eth0, eth1 etc., depending on how many Ethernet cards you have and which one you plugged the Velo in. On the PR2, it will be ecat0. ifconfig will tell you more about how many interfaces you have and which are active. The rest of these instructions will assume the Velo is on eth0, replace that with the correct name of your interface.

In the ethercat_hardware package you will find the motorconf utility which can be used to program or talk to the board. The -i option just prints out information about the devices on the EtherCAT chain.

roscd ethercat_hardware
pr2-grant ./motorconf -ieth0

When using the Velo standalone, there is only one device on the chain (#00). You should see an output along the lines of:

[DEBUG] [1365555420.253989026]: Device #00: WG06 (0x67d60e) Firmware Revision 1.02, PCB Revision E.01, Serial #: 1098
[DEBUG] [1365555420.255918352]:             Serial #: 01098
[DEBUG] [1365555420.262040250]:             Name: l_velo_gripper_motor
[ WARN] [1365555420.266888302]: l_velo_gripper_motor EEPROM does not contain motor heating model parameters
[DEBUG] [1365555420.268262462]: No calibration offset was stored on device l_velo_gripper_motor

On the PR2, you will see all devices on the chain, so you'll have to find the Velo somewhere in there. You can find it by the fact that the board used is WG06:

[DEBUG] [1365703011.038168970]: Device #24: WG06 (0x67d60e) Firmware Revision 1.02, PCB Revision D.01, Serial #: 1040
[DEBUG] [1365703011.039107936]:             Serial #: 01040
[DEBUG] [1365703011.043096625]:             Name: l_velo_gripper_motor
[ WARN] [1365703011.047364178]: l_velo_gripper_motor EEPROM does not contain motor heating model parameters

Write down the device number (Device #xx) the Velo has in this list, you will need it below.

The Name as it shows up here should be l_velo_gripper_motor or r_velo_gripper_motor depending on which side of the PR2 the Velo is mounted on. If you're using the Velo standalone, either of those will work, but you will need to choose the appropriate launch file later based on whether the name is l_... or r_....

If the name is incorrect, you will need to program the MCB to change it. Use the following command:

pr2-grant ./motorconf -ieth0 -a `rospack find velo_controller`/actuators.conf -n l_velo_gripper_motor -d00 -m 222055 -b wg006 -p

Where:

  • -iXXX points to the right EtherCAT interface
  • -dXX points to the correct device number from above
  • -n ### sets the name you want (either l_velo_gripper_motor or r_velo_gripper_motor)

After this, run pr2-grant ./motorconf -ieth0 again to make sure the name got programmed correctly.

Starting the Velo standalone

Use the following command:

roslaunch velo_bench bench_l.launch interface:=eth0

At this point, the Velo should calibrate: the fingers will close all the way, open a little bit, close again, then open all the way.

If, during this procedure, the Velo detects that the gripper is not installed on the actuation module, it will print an error message:

[ERROR] [1365609228.372424494]: Gripper "l_gripper_joint" NOT installed!  Please install and recalibrate.  (pos=0.0163m)

If that happens, Ctrl-C the launch file, install a gripper, and start it again.

Starting the PR2 with a Velo installed

You will need a pr2.urdf.xacro appropriately modified to contain the Velo on the appropriate arm(s), as well as a pr2.launch that brings up the correct controller for the Velo(s). Both are provided in the velo_pr2 package. Modify them based on which arm(s) you have Velo(s) installed, and use them to launch the robot:

roslaunch velo_pr2 robot.launch

Commanding the gripper

At this point, the Velo controller should be up and listening to commands of the type ``pr2_controllers_msgs/Pr2GripperCommandon the input topic/{l,r}_gripper_controller/command`.

A convenient way to send commands is the lcg_set_pos script provided with the Velo stack.

roscd velo_controller/scripts
./lcg_set_pos.py -p 0.0 -f 5

The arguments are:

  • -p # the desired gap between fingers, in meters. A gap of 0 (or negative) will close the gripper all the way. A gap of approximately 0.135 will open the gripper all the way
  • -f % applied gripping force, in N. The controller will clamp this to within the limits of the Velo. The max gripping force that can actually be executed is approx. 10N.