Class CognexConsultant
java.lang.Object
edu.tufts.hrilab.consultant.Consultant<CognexReference>
edu.tufts.hrilab.abb.consultant.cognex.CognexConsultant
- All Implemented Interfaces:
ConsultantInterface
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static int
Fields inherited from class edu.tufts.hrilab.consultant.Consultant
defaultProperties, kbName, log, propertiesHandled, refConstructor, references
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddDetectionType
(Symbol descriptor, Symbol jobName) Adds a binding between the human descriptor and the name of the job on the cognex, these doesn't necessarily need to be the same.void
addReference
(CognexReference newRef) Add new reference from some source (file or learning) to the consultantboolean
assertProperties
(Symbol refId, List<Term> properties) Add properties to already existing object ref.boolean
an attempt is made to bring the knowledge base in line with the provided bindings, list of properties, and probability value.void
bindCognexResult
(CognexReference ref, CognexResult result, int indexIntoCognexResult) createCognexRef
(CognexJob job, List<Term> additionalProps) createCogRefWithProperty
(Symbol jobDescriptor, Term property) createCogRefWithProps
(CognexJob j, List<Term> additionalProperties) Get a list of currently highly salient entities that should be considered "activated."Returns the CognexJob able to detect the given reference, if it exists.getCognexJobForDescriptor
(Symbol descriptor) getCognexReferenceForID
(Symbol refId) getJobForDescriptor
(String descriptor) getMatchingResult
(CognexReference toReBind, List<CognexResult> results) protected Symbol
Generates the new refId based on the refNumber counter, and increments.boolean
insertReference
(Symbol refId, CognexReference ref) <U> U
localConvertToType
(Symbol refId, Class<U> type) <U> U
localConvertToType
(Symbol refId, Class<U> type, List<? extends Term> constraints) removeReference
(Symbol refId) void
setGraspPointForJob
(CognexJob job, String graspPoint) Methods inherited from class edu.tufts.hrilab.consultant.Consultant
addPropertiesHandled, convertToType, convertToType, createReference, createReferences, getAssertedProperties, getInitialDomain, getKBName, getPropertiesHandled, getReference, getReferenceSummaries, getReferencesWithAllProperties, getReferencesWithAnyProperties, notifyNewPropertySubscribers, process, registerForNewPropertyNotification, retractProperties, stripQuotesFromMorpheme, unregisterForNewPropertyNotification
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface edu.tufts.hrilab.interfaces.ConsultantInterface
convertToType, convertToType, createReferences, getAssertedProperties, getInitialDomain, getKBName, getPropertiesHandled, notifyNewPropertySubscribers, process, registerForNewPropertyNotification, unregisterForNewPropertyNotification
-
Field Details
-
availableJobs
-
boundJobs
-
graspPoses
-
lessSalientRefIds
-
refNumber
protected static int refNumber
-
-
Constructor Details
-
CognexConsultant
public CognexConsultant()
-
-
Method Details
-
localConvertToType
- Specified by:
localConvertToType
in classConsultant<CognexReference>
-
localConvertToType
- Specified by:
localConvertToType
in classConsultant<CognexReference>
-
assertProperties
Description copied from interface:ConsultantInterface
an attempt is made to bring the knowledge base in line with the provided bindings, list of properties, and probability value.- Specified by:
assertProperties
in interfaceConsultantInterface
- Overrides:
assertProperties
in classConsultant<CognexReference>
- Parameters:
bindings
- list of bindings in tuple form (free-variable and refId pair)prob
- probability valueproperties
- list of Properties- Returns:
- whether the updated was successful?
-
assertProperties
Description copied from interface:ConsultantInterface
Add properties to already existing object ref. Each property should contain a connection to the existing ref either by refId or refId's variable.- Specified by:
assertProperties
in interfaceConsultantInterface
- Overrides:
assertProperties
in classConsultant<CognexReference>
- Returns:
-
addDetectionType
Adds a binding between the human descriptor and the name of the job on the cognex, these doesn't necessarily need to be the same. The system should know about all of the job names, but it doesn't have to know about the human producable descriptors?Once the binding is done it adds the proerty to the consultant. TODO:brad is there a way we could just get the jobs from the Cognex at start up? thT would make this a lot easier.
- Parameters:
descriptor
- human provided descriptorjobName
- name of job on the Cognex that is used to detect the thing associated with the provided descriptor
-
createCognexRef
-
getJobForDescriptor
- Parameters:
descriptor
-- Returns:
-
removeReference
-
insertReference
-
getNextReferenceId
Generates the new refId based on the refNumber counter, and increments. Informs all other consultants with the same kbName of the current ref being allocated to attempt to maintain sync and avoid duplicating refs.- Overrides:
getNextReferenceId
in classConsultant<CognexReference>
- Returns:
-
getCognexJobForDescriptor
-
createCogRefWithProps
-
bindCognexResult
-
getEmptyProps
-
getCognexJobForCognexReference
Returns the CognexJob able to detect the given reference, if it exists.- Parameters:
ref
- The CognexReference to fetch the matching CognexJob of.- Returns:
- The CognexJob associated with this reference.
-
getCognexReferenceForID
-
setGraspPointForJob
-
getGraspPoseForJob
-
getMatchingResult
-
createCogRefWithProperty
-
addReference
Description copied from class:Consultant
Add new reference from some source (file or learning) to the consultant- Overrides:
addReference
in classConsultant<CognexReference>
- Parameters:
newRef
- new reference to add
-
getActivatedEntities
Description copied from interface:ConsultantInterface
Get a list of currently highly salient entities that should be considered "activated."- Specified by:
getActivatedEntities
in interfaceConsultantInterface
- Overrides:
getActivatedEntities
in classConsultant<CognexReference>
- Returns:
- list of refIds and probability pairs
-