public interface GripperFeedbackCapabilities
Register the feedback capabilities of the gripper using this interface. A feedback capability is a type of status the gripper is capable of informing PolyScope about.
PolyScope will execute the script code associated with a feedback capability at appropriate times in the given context. Script code generated must be idempotent (meaning it has no side effects when called multiple times if all other state has not changed in between calls). The script code generated must also execute fast, since the feedback could be checked often.Modifier and Type | Method and Description |
---|---|
void |
registerGripDetectedCapability(ScriptCodeGenerator<GripDetectedParameters> scriptCodeGenerator)
Register this feedback capability if the gripper can inform PolyScope whether it has detected that an object has
been gripped, after a grip action has been triggered.
|
void |
registerReleaseDetectedCapability(ScriptCodeGenerator<ReleaseDetectedParameters> scriptCodeGenerator)
Register this feedback capability if the gripper can inform PolyScope whether it has detected an object has
been released, after a release action has been triggered.
|
void registerGripDetectedCapability(ScriptCodeGenerator<GripDetectedParameters> scriptCodeGenerator)
Register this feedback capability if the gripper can inform PolyScope whether it has detected that an object has been gripped, after a grip action has been triggered. This will enable the end user to configure the actions to take when the gripper has detected that an object has been gripped and/or when the grip action timed out.
The provided implementation of the ScriptCodeGenerator
interface must generate the script code for
determining if a grip was detected. The return value of the script code must be a boolean, i.e. 'True' or
'False'.
GripperContribution.generateGripActionScript(ScriptWriter, GripActionParameters)
method should generate
different grip action script code depending on whether the end user has enabled or disabled the grip detection
option (in the Gripper program node). For more details, see Javadoc for
GripActionParameters.isGripDetectionEnabled()
.scriptCodeGenerator
- script generator that generates the script code for determining if a grip was detected.
When the script code needs to be generated, the method
ScriptCodeGenerator.generateScript(ScriptWriter, Object)
will be called (by
PolyScope). The resulting script code will be embedded in a script function and
must return a boolean, i.e. 'True' or 'False'.CapabilityAlreadyRegistered
- if this capability has already been registeredCalledOutsideGripperConfigurationPhase
- if this method is called at the wrong time, i.e. outside the scope
of the GripperContribution.configureGripper(GripperConfiguration, GripperAPIProvider)
method.void registerReleaseDetectedCapability(ScriptCodeGenerator<ReleaseDetectedParameters> scriptCodeGenerator)
Register this feedback capability if the gripper can inform PolyScope whether it has detected an object has been released, after a release action has been triggered. This will enable the end user to configure the actions to take when the gripper has detected that an object has been released and/or when the release action timed out.
The provided implementation of the ScriptCodeGenerator
interface must generate the script code for
determining if a release was detected. The return value of the script code must be a boolean, i.e. 'True'
or 'False'.
GripperContribution.generateReleaseActionScript(ScriptWriter, ReleaseActionParameters)
method should
generate different release action script code depending on whether the end user has enabled or disabled the release
detection option (in the Gripper program node). For more details, see Javadoc for
GripActionParameters.isGripDetectionEnabled()
.scriptCodeGenerator
- script generator that generates the script code for determining if a release was
detected. When the script code needs to be generated, the method
ScriptCodeGenerator.generateScript(ScriptWriter, Object)
will be called (by
PolyScope). The resulting script code will be embedded in a script function and
must return a boolean, i.e. 'True' or 'False'.CapabilityAlreadyRegistered
- if this capability has already been registeredCalledOutsideGripperConfigurationPhase
- if this method is called at the wrong time, i.e. outside the scope
of the GripperContribution.configureGripper(GripperConfiguration, GripperAPIProvider)
method.Copyright © 2023. All rights reserved.