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 intFields 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.voidaddReference(CognexReference newRef) Add new reference from some source (file or learning) to the consultantbooleanassertProperties(Symbol refId, List<Term> properties) Add properties to already existing object ref.booleanan attempt is made to bring the knowledge base in line with the provided bindings, list of properties, and probability value.voidbindCognexResult(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 SymbolGenerates the new refId based on the refNumber counter, and increments.booleaninsertReference(Symbol refId, CognexReference ref) <U> UlocalConvertToType(Symbol refId, Class<U> type) <U> UlocalConvertToType(Symbol refId, Class<U> type, List<? extends Term> constraints) removeReference(Symbol refId) voidsetGraspPointForJob(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, unregisterForNewPropertyNotificationMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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:
localConvertToTypein classConsultant<CognexReference>
-
localConvertToType
- Specified by:
localConvertToTypein classConsultant<CognexReference>
-
assertProperties
Description copied from interface:ConsultantInterfacean attempt is made to bring the knowledge base in line with the provided bindings, list of properties, and probability value.- Specified by:
assertPropertiesin interfaceConsultantInterface- Overrides:
assertPropertiesin 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:ConsultantInterfaceAdd 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:
assertPropertiesin interfaceConsultantInterface- Overrides:
assertPropertiesin 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:
getNextReferenceIdin 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:ConsultantAdd new reference from some source (file or learning) to the consultant- Overrides:
addReferencein classConsultant<CognexReference>- Parameters:
newRef- new reference to add
-
getActivatedEntities
Description copied from interface:ConsultantInterfaceGet a list of currently highly salient entities that should be considered "activated."- Specified by:
getActivatedEntitiesin interfaceConsultantInterface- Overrides:
getActivatedEntitiesin classConsultant<CognexReference>- Returns:
- list of refIds and probability pairs
-