com.kuka.roboticsAPI.deviceModel
Class Device

java.lang.Object
  extended by com.kuka.common.TaggableObject
      extended by com.kuka.roboticsAPI.geometricModel.SceneGraphObject
          extended by com.kuka.roboticsAPI.geometricModel.SpatialObject
              extended by com.kuka.roboticsAPI.geometricModel.PhysicalObject
                  extended by com.kuka.roboticsAPI.deviceModel.Device
All Implemented Interfaces:
com.kuka.common.ITaggable
Direct Known Subclasses:
MovableDevice, Sensor

public abstract class Device
extends PhysicalObject

A device is an abstract thing which is able to perform some action or deliver some data. Device is controlled via some controller.


Field Summary
protected  com.kuka.roboticsAPI.deviceModel.VersionInfoGroup[] _hardwareVersion
          Array with hardware version information.
 
Constructor Summary
protected Device(Controller controller, String name)
          Creates a new device with the given controller.
 
Method Summary
 void acquireCommandPermit(ICommandContainer container)
          Asks the device for a command permit.
protected  com.kuka.common.params.IParameterSet createDefaultsParameterSet()
          Creates the defaults parameter set for this device.
 void dispose()
          Disposes the device.
 RoboticsAPIContext getContext()
          Gets the context for this device.
 Controller getController()
          Gets the controller to which this device is logically connected.
 com.kuka.common.params.IParameterSet getDefaults()
          Gets the map containing the default values of the device.
 com.kuka.roboticsAPI.deviceModel.VersionInfoGroup[] getHardwareVersion()
          Gets the hardware version.
 String getUniqueName()
          Gets the unique name of the device which looks like 'controllerName/deviceName'.
 void initialize()
          Initializes this device.
 boolean isInitialized()
          Determines if this device is initialized.
protected  void onDispose()
          Called when the device get's disposed.
protected  void onInitialize()
          Called when the device get's initialized.
 com.kuka.roboticsAPI.controllerModel.StatePortState refreshHardwareVersion()
          Refreshes the hardware version.
 void releaseCommandPermit(ICommandContainer container)
          Releases a formerly acquired command permit.
 void setName(String name)
          Unsupported operation.
 
Methods inherited from class com.kuka.roboticsAPI.geometricModel.PhysicalObject
addDefaultMotionFrame, getDefaultMotionFrame, getLoadData, move, move, moveAsync, moveAsync, setDefaultMotionFrame
 
Methods inherited from class com.kuka.roboticsAPI.geometricModel.SpatialObject
attachTo, attachTo, changeParent, detach, switchParent, switchParent
 
Methods inherited from class com.kuka.roboticsAPI.geometricModel.SceneGraphObject
addChildFrame, addChildFrame, addChildFrame, addChildFrame, addChildFrame, addChildFrame, allObjects, changeFrameParent, changeFramePosition, findMembersOfGroup, findRobot, getAllFrames, getAllUserParameters, getChild, getChildFrameLock, getChildren, getFrame, getName, getParent, getRootFrame, getRootOfGroup, getUserParameter, groupToParent, isDescendantOf, isGroupedToParent, isMemberOfGroup, isRootOfGroup, removeFrame, renameFrame, setRootFrame, setUserParameter, toString, ungroupFromParent
 
Methods inherited from class com.kuka.common.TaggableObject
getTag, setTag
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_hardwareVersion

protected volatile com.kuka.roboticsAPI.deviceModel.VersionInfoGroup[] _hardwareVersion
Array with hardware version information.

Constructor Detail

Device

protected Device(Controller controller,
                 String name)
Creates a new device with the given controller.

Parameters:
controller - The controller. May be null.
name - The name of the device.
Method Detail

setName

public void setName(String name)
Unsupported operation.

A device name cannot be changed. This method will therefore fail with an IllegalStateException.

Overrides:
setName in class SpatialObject
Parameters:
name - Unsupported.
This element is not in its final state and might change in future versions.

getContext

public final RoboticsAPIContext getContext()
Gets the context for this device. This method will throw an exception if the device is not attached to a controller.

Returns:
The context for this device.
This element is not in its final state and might change in future versions.

getDefaults

public com.kuka.common.params.IParameterSet getDefaults()
Gets the map containing the default values of the device.

Returns:
The map containing the default values of the device.
This element is not in its final state and might change in future versions.

getController

public final Controller getController()
Gets the controller to which this device is logically connected.

Returns:
The controller to which this device is logically connected.
Throws:
IllegalStateException - if the device has no controller.

isInitialized

public final boolean isInitialized()
Determines if this device is initialized.

Returns:
True if this device was initialized, false otherwise.

refreshHardwareVersion

public com.kuka.roboticsAPI.controllerModel.StatePortState refreshHardwareVersion()
Refreshes the hardware version.

Returns:
state port state Unknown
This element is not in its final state and might change in future versions.

getHardwareVersion

public final com.kuka.roboticsAPI.deviceModel.VersionInfoGroup[] getHardwareVersion()
Gets the hardware version.

Returns:
the _hardwareVersion
This element is not in its final state and might change in future versions.

dispose

public final void dispose()
Disposes the device. Called automatically when the controller get's disposed. If it is already disposed, nothing will happen.

This element is an undocumented internal feature. It is not intended to be used by applications as it might change or be removed in future versions.

acquireCommandPermit

public final void acquireCommandPermit(ICommandContainer container)
                                throws InterruptedException
Asks the device for a command permit. Blocks until one is available.

This is a framework method and should never get called manually.

Each device has a bunch of command permits which regulate how many commands for a device are active at the same time (within one RoboticsAPIContext). The permit-amount is configurable through the RoboticsAPIDefaults class and the 'DEVICE_COMMAND_PERMITS' constant. 3 is the default value of this property.

Parameters:
container - The container which will be used for the execution of the command.
Throws:
InterruptedException - if waiting was interrupted.
This element is an undocumented internal feature. It is not intended to be used by applications as it might change or be removed in future versions.

releaseCommandPermit

public final void releaseCommandPermit(ICommandContainer container)
Releases a formerly acquired command permit.

This is a framework method and should never get called manually.

Parameters:
container - The container which was used for the execution of the command.
See Also:
acquireCommandPermit(com.kuka.roboticsAPI.executionModel.ICommandContainer)
This element is an undocumented internal feature. It is not intended to be used by applications as it might change or be removed in future versions.

initialize

public final void initialize()
Initializes this device. Each device returned by a controller will be initialized automatically. If this method is called on a initialized device, it returns without doing anything.

This element is an undocumented internal feature. It is not intended to be used by applications as it might change or be removed in future versions.

getUniqueName

public String getUniqueName()
Gets the unique name of the device which looks like 'controllerName/deviceName'.

Returns:
the unique name of the device which looks like 'controllerName/deviceName'.

createDefaultsParameterSet

protected com.kuka.common.params.IParameterSet createDefaultsParameterSet()
Creates the defaults parameter set for this device.

This method is called once during device initialization. This is the place for the device to return a device specific type of a parameter set. The device should then also override the getDefaults() method and change the return type of this method appropriately.

Returns:
The defaults parameter set for this device.

onInitialize

protected void onInitialize()
Called when the device get's initialized. The RoboticsAPI ensures that this method is called before the device get's returned to a user program.

May be overridden by subclasses. Will only be called once. If this method fails with an exception, the device will not be initialized and may behave strange under some circumstances.


onDispose

protected void onDispose()
Called when the device get's disposed.

May be overridden by subclasses. Will only be called once.



Copyright © 2019. All rights reserved.