device
Class Gripper

java.lang.Object
  extended by device.Device
      extended by device.RobotDevice
          extended by device.Gripper
All Implemented Interfaces:
IDevice, IGripper, java.lang.Runnable

public class Gripper
extends RobotDevice
implements IGripper

A Gripper device represents a mechanical actuator consisting of typically two paddles that can open/close and lift/release to manipulate some objects.


Nested Class Summary
 
Nested classes/interfaces inherited from interface device.external.IGripper
IGripper.stateType
 
Field Summary
(package private)  Actarray aa
          Controls a lift on the gripper (if gripper equipped)
(package private)  IGripper.stateType currentState
           
(package private)  Dio dio
          Copied from JavaClient: Data: state (PLAYER_GRIPPER_DATA_STATE) The gripper interface returns 3 values that represent the current state of the gripper; the format is given below.
(package private)  java.util.concurrent.CopyOnWriteArrayList<IGripperListener> isDoneListeners
          Callback listeners
(package private)  java.util.logging.Logger logger
          Logging support
(package private)  boolean timeout
           
 
Fields inherited from class device.RobotDevice
device, deviceNode
 
Fields inherited from class device.Device
deviceList, host, id, index, isRunning, isThreaded, port, sleeptime, thread
 
Fields inherited from interface device.external.IDevice
DEVICE_ACTARRAY_CODE, DEVICE_AIO_CODE, DEVICE_AUDIO_CODE, DEVICE_AUDIODSP_CODE, DEVICE_AUDIOMIXER_CODE, DEVICE_BLINKENLIGHT_CODE, DEVICE_BLOBFINDER_CODE, DEVICE_BUMPER_CODE, DEVICE_CAMERA_CODE, DEVICE_DEVICE_CODE, DEVICE_DIO_CODE, DEVICE_ENERGY_CODE, DEVICE_FIDUCIAL_CODE, DEVICE_GPS_CODE, DEVICE_GRAPHICS2D_CODE, DEVICE_GRAPHICS3D_CODE, DEVICE_GRIPPER_CODE, DEVICE_HEALTH_CODE, DEVICE_IMU_CODE, DEVICE_IR_CODE, DEVICE_JOYSTICK_CODE, DEVICE_LASER_CODE, DEVICE_LIMB_CODE, DEVICE_LOCALIZE_CODE, DEVICE_LOG_CODE, DEVICE_MAP_CODE, DEVICE_MCOM_CODE, DEVICE_NOMAD_CODE, DEVICE_NULL_CODE, DEVICE_OPAQUE_CODE, DEVICE_PLANNER_CODE, DEVICE_POINTCLOUD3D_CODE, DEVICE_POSITION1D_CODE, DEVICE_POSITION2D_CODE, DEVICE_POSITION3D_CODE, DEVICE_POWER_CODE, DEVICE_PTZ_CODE, DEVICE_RANGER_CODE, DEVICE_RFID_CODE, DEVICE_SERVICE_ADV_CODE, DEVICE_SIMULATION_CODE, DEVICE_SONAR_CODE, DEVICE_SOUND_CODE, DEVICE_SPEECH_CODE, DEVICE_SPEECH_RECOGNITION_CODE, DEVICE_TRUTH_CODE, DEVICE_WAVEFORM_CODE, DEVICE_WIFI_CODE, DEVICE_WSN_CODE
 
Constructor Summary
Gripper(DeviceNode deviceNode, Device device)
          Creates a Gripper object.
 
Method Summary
 void addIsDoneListener(IGripperListener cb)
           
 void close()
          Deprecated. Use close(IGripperListener). Close the gripper's paddles.
 void close(IGripperListener cb)
           
 void closeLift()
          Deprecated. Use closeLift(IGripperListener).
 void closeLift(IGripperListener cb)
           
 Actarray getAa()
           
 IGripper.stateType getCurrentState()
           
 Dio getDio()
           
 java.util.logging.Logger getLogger()
           
 IGripper.stateType getState()
           
 void lift()
          Deprecated. Use lift(IGripperListener). Lift the gripper's paddles (if supported).
 void lift(IGripperListener cb)
           
 void liftWithObject()
          Sets up the gripper to only close and lift paddles when an object is sensed between the paddles.
(package private)  void notifyListenersClosed()
           
(package private)  void notifyListenersClosedLifted()
           
(package private)  void notifyListenersError()
           
(package private)  void notifyListenersLifted()
           
(package private)  void notifyListenersOpened()
           
(package private)  void notifyListenersReleased()
           
(package private)  void notifyListenersReleasedOpened()
           
 void open()
          Deprecated. Use open(IGripperListener). Opens the gripper's paddles. If available sensors are used to determine when the paddles are open.
 void open(IGripperListener cb)
           
 void release()
          Release the gripper's paddles (if supported).
 void release(IGripperListener cb)
           
 void releaseOpen()
          Deprecated. Use releaseOpen(IGripperListener).
 void releaseOpen(IGripperListener cb)
           
 void removeIsDoneListener(IGripperListener cb)
           
protected  void setAa(Actarray aa)
           
(package private)  void setCurrentState(IGripper.stateType newState)
           
protected  void setDio(Dio dio)
           
 void shutdown()
          Shuts down this (and any sub-) device.
(package private)  void startClose()
           
(package private)  void startLift()
           
(package private)  void startOpen()
           
(package private)  void startRelease()
           
 void stop()
          Stops the gripper current motion (if any).
protected  void update()
          Might be to be implemented by subclass to do something
(package private)  void updateActarray()
          During runtime checks if an actarray device is available, typically used to lift/release the paddles.
(package private)  void updateDio()
          During runtime checks if an dio device is available, typically used to sensor gripper states.
 
Methods inherited from class device.RobotDevice
getDevice, getDeviceNode, toString
 
Methods inherited from class device.Device
equals, getDevice, getDeviceIterator, getDeviceList, getDeviceListArray, getHost, getId, getIndex, getPort, getSleepTime, getThreadName, isInList, isRunning, isSupported, isThreaded, matches, matchesList, run, runThreaded, setDeviceList, setHost, setName, setPort, setSleepTime
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

currentState

IGripper.stateType currentState

isDoneListeners

java.util.concurrent.CopyOnWriteArrayList<IGripperListener> isDoneListeners
Callback listeners


logger

java.util.logging.Logger logger
Logging support


aa

Actarray aa
Controls a lift on the gripper (if gripper equipped)


dio

Dio dio
Copied from JavaClient: Data: state (PLAYER_GRIPPER_DATA_STATE) The gripper interface returns 3 values that represent 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: - state (unsigned byte) - bit 0: Paddles open - bit 1: Paddles closed - bit 2: Paddles moving - bit 3: Paddles error - bit 4: Lift is up - bit 5: Lift is down - bit 6: Lift is moving - bit 7: Lift error - beams (unsigned byte) - bit 0: Gripper limit reached - bit 1: Lift limit reached - bit 2: Outer beam obstructed - bit 3: Inner beam obstructed - bit 4: Left paddle open - bit 5: Right paddle open


timeout

boolean timeout
Constructor Detail

Gripper

public Gripper(DeviceNode deviceNode,
               Device device)
Creates a Gripper object.

Parameters:
deviceNode - The device node containing this device.
device - This device' properties.
Method Detail

shutdown

public void shutdown()
Description copied from class: Device
Shuts down this (and any sub-) device.

Specified by:
shutdown in interface IDevice
Overrides:
shutdown in class Device

update

protected void update()
Description copied from class: Device
Might be to be implemented by subclass to do something

Overrides:
update in class Device

getCurrentState

public IGripper.stateType getCurrentState()

setCurrentState

void setCurrentState(IGripper.stateType newState)

stop

public void stop()
Stops the gripper current motion (if any).


open

public void open()
Deprecated. Use open(IGripperListener). Opens the gripper's paddles. If available sensors are used to determine when the paddles are open.


open

public void open(IGripperListener cb)
Specified by:
open in interface IGripper

startOpen

void startOpen()

close

public void close()
Deprecated. Use close(IGripperListener). Close the gripper's paddles.


close

public void close(IGripperListener cb)
Specified by:
close in interface IGripper

startClose

void startClose()

lift

public void lift()
Deprecated. Use lift(IGripperListener). Lift the gripper's paddles (if supported).


lift

public void lift(IGripperListener cb)
Specified by:
lift in interface IGripper

startLift

void startLift()

liftWithObject

public void liftWithObject()
Sets up the gripper to only close and lift paddles when an object is sensed between the paddles.


releaseOpen

public void releaseOpen()
Deprecated. Use releaseOpen(IGripperListener).


releaseOpen

public void releaseOpen(IGripperListener cb)
Specified by:
releaseOpen in interface IGripper

closeLift

public void closeLift()
Deprecated. Use closeLift(IGripperListener).


closeLift

public void closeLift(IGripperListener cb)
Specified by:
closeLift in interface IGripper

release

public void release()
Release the gripper's paddles (if supported). Use sensors to determine if paddles are released (if available).


release

public void release(IGripperListener cb)
Specified by:
release in interface IGripper

startRelease

void startRelease()

updateActarray

void updateActarray()
During runtime checks if an actarray device is available, typically used to lift/release the paddles.


updateDio

void updateDio()
During runtime checks if an dio device is available, typically used to sensor gripper states. Normally that is supported by some photo diodes.


getState

public IGripper.stateType getState()
Returns:
The current state the gripper is in.

getLogger

public java.util.logging.Logger getLogger()
Overrides:
getLogger in class RobotDevice
Returns:
the logger

getAa

public Actarray getAa()
Returns:
the aa

getDio

public Dio getDio()
Returns:
the dio

setAa

protected void setAa(Actarray aa)
Parameters:
aa - the aa to set

setDio

protected void setDio(Dio dio)
Parameters:
dio - the dio to set

addIsDoneListener

public void addIsDoneListener(IGripperListener cb)
Specified by:
addIsDoneListener in interface IGripper

removeIsDoneListener

public void removeIsDoneListener(IGripperListener cb)
Specified by:
removeIsDoneListener in interface IGripper

notifyListenersOpened

void notifyListenersOpened()

notifyListenersClosed

void notifyListenersClosed()

notifyListenersLifted

void notifyListenersLifted()

notifyListenersReleased

void notifyListenersReleased()

notifyListenersClosedLifted

void notifyListenersClosedLifted()

notifyListenersReleasedOpened

void notifyListenersReleasedOpened()

notifyListenersError

void notifyListenersError()