Modifier and Type | Method and Description |
---|---|
<T extends CapabilitySupport> |
getCapabilitySupport(Class<T> capabilitySupport)
Get information about the support (provided by the gripper device) for a specific capability.
|
URCapInfo |
getContributorInfo()
Get information about the URCap that added/contributed this gripper device to PolyScope.
|
boolean |
isResolvable()
A device cannot be guaranteed to be present in PolyScope.
|
URCapInfo getContributorInfo()
boolean isResolvable()
true
if this gripper device is present in PolyScope, otherwise false
.<T extends CapabilitySupport> Optional<T> getCapabilitySupport(Class<T> capabilitySupport)
Get information about the support (provided by the gripper device) for a specific capability. This information
can be used to configure the supported capability when creating a configuration for a Gripper node
(a GripperNode
instance) with the GripActionConfigBuilder
or ReleaseActionConfigBuilder
interface. The method can also be used just to check if the device supports a specific capability (for instance
to determine how to configure the gripper device or to help decide which gripper device to select based on its
capabilities).
The various grippers available in Polyscope can support different sets of capabilities ranging from a very basic
gripper, which does not provide any additional capabilities (besides basic simple grip and release actions), to a
more advanced gripper supporting several capabilities. Therefore the returned capability support instance is
wrapped in an Optional
. Always use Optional.isPresent()
to check if the specific gripper device
supports the specified capability before accessing it using Optional.get()
.
Code example:
Here is an example of how to get the list of individual grippers available in a multi-gripper device. The returned
list can be used to select a specific gripper when creating a GripperNode
configuration.
Optional<MultiGripperSupport> support = gripperDevice.getCapabilitySupport(MultiGripperSupport.class);
if (support.isPresent()) {
MultiGripperSupport multiGripperSupport = support.get();
List<SelectableGripper> selectableGrippers = multiGripperSupport.getSelectableGrippers();
...
}
T
- The type of the capability support (an interface extending the CapabilitySupport
base interface)
to be returnedcapabilitySupport
- The class of the capability support instance to be returned, not null
.Optional
. This instance provides
information relevant for configuring the capability. Note that this information is only applicable for this specific
gripper device. Always use the Optional.isPresent()
method on the returned instance to check if the
capability is supported by the gripper device, prior to accessing the capability support
(using Optional.get()
).Copyright © 2021. All rights reserved.