javaclient
Class GripperInterface

java.lang.Object
  extended by javaclient.PlayerDevice
      extended by javaclient.GripperInterface

public class GripperInterface
extends PlayerDevice

The gripper interface provides access to a robotic gripper. This interface is VERY Pioneer-specific, and should really be generalized.

Version:
Author:
Maxim A. Batalin & Radu Bogdan Rusu

Field Summary
 
Fields inherited from class javaclient.PlayerDevice
device, DIFFERENCE_SYNCH_FACTOR, index, is, os, pc, PLAYER_MAX_REQREP_SIZE, PLAYER_STXX, reserved, size, t_sec, t_usec, ts_sec, ts_usec
 
Constructor Summary
GripperInterface(PlayerClient pc, short indexOfDevice)
          Constructor for GripperInterface.
 
Method Summary
 byte getBeams()
          Get the gripper's beams.
 byte getState()
          Get the gripper's state.
 void readData()
          Read the current state of the gripper; the format is given below.
 void setGripper(int cmd, int arg)
          The gripper interface accepts 2-byte commands, the format of which is given below.
 
Methods inherited from class javaclient.PlayerDevice
getTimeForDataSampled_sec, getTimeForDataSampled_usec, getTimeForDataSampled, getTimeForDataSent_sec, getTimeForDataSent_usec, getTimeForDataSent, handleEARMessage, handleNARMessage, handleResponse, readHeader, sendHeader
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GripperInterface

public GripperInterface(PlayerClient pc,
                        short indexOfDevice)
Constructor for GripperInterface.

Parameters:
pc - a reference to the PlayerClient object
indexOfDevice - the index of the device
Method Detail

readData

public void readData()
Read the current state of the gripper; the format is given below. Note that the exact interpretation of this data may vary depending on the details of your gripper and how it is connected to your robot (e.g., General I/O vs. User I/O for the Pioneer gripper).

The following list defines how the data can be interpreted for some Pioneer robots and Stage:

setGripper

public void setGripper(int cmd,
                       int arg)
The gripper interface accepts 2-byte commands, the format of which is given below. These two bytes are sent directly to the gripper; refer to Table 3-3 page 10 in the Pioneer 2 Gripper Manual for a list of commands. The first byte is the command. The second is the argument for the LIFTcarry and GRIPpress commands, but for all others it is ignored.

Parameters:
cmd - the command
arg - the argument for the LIFTcarry and GRIPpress commands

getState

public byte getState()
Get the gripper's state.

Returns:
the gripper's state as a byte

getBeams

public byte getBeams()
Get the gripper's beams.

Returns:
the gripper's beams as a byte