Class CognexConsultant

java.lang.Object
edu.tufts.hrilab.consultant.Consultant<CognexReference>
edu.tufts.hrilab.mtracs.consultant.vision.CognexConsultant
All Implemented Interfaces:
ConsultantInterface

public class CognexConsultant extends Consultant<CognexReference> implements ConsultantInterface
  • Field Details

    • availableJobs

      protected Set<CognexJob> availableJobs
    • boundJobs

      protected Map<String,CognexJob> boundJobs
    • groupNames

      protected String groupNames
      Group identifier to be prepended to reference names
  • Constructor Details

    • CognexConsultant

      public CognexConsultant(List<String> groups)
  • Method Details

    • localConvertToType

      public <U> U localConvertToType(Symbol refId, Class<U> type)
      Specified by:
      localConvertToType in class Consultant<CognexReference>
    • localConvertToType

      public <U> U localConvertToType(Symbol refId, Class<U> type, List<? extends Term> constraints)
      Specified by:
      localConvertToType in class Consultant<CognexReference>
    • assertProperties

      public boolean assertProperties(Map<Variable,Symbol> bindings, Double prob, List<Term> properties)
      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 interface ConsultantInterface
      Overrides:
      assertProperties in class Consultant<CognexReference>
      Parameters:
      bindings - list of bindings in tuple form (free-variable and refId pair)
      prob - probability value
      properties - list of Properties
      Returns:
      whether the updated was successful?
    • assertProperties

      public boolean assertProperties(Symbol refId, List<Term> properties)
      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 interface ConsultantInterface
      Overrides:
      assertProperties in class Consultant<CognexReference>
      Returns:
    • addDetectionType

      public void addDetectionType(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. The system should know about all of the job names, but it doesn't have to know about the human producible descriptors?

      Once the binding is done it adds the property to the consultant. TODO:brad is there a way we could just get the jobs from the Cognex at start up? that would make this a lot easier.

      Parameters:
      descriptor - human provided descriptor
      jobName - name of job on the Cognex that is used to detect the thing associated with the provided descriptor
    • createCognexRef

      public CognexReference createCognexRef(CognexJob job, List<Term> additionalProps)
    • getNextReferenceId

      protected Symbol getNextReferenceId()
      Description copied from class: Consultant
      Helper method to generate next unique reference ID (e.g., object_3).
      Overrides:
      getNextReferenceId in class Consultant<CognexReference>
      Returns:
    • getJobForDescriptor

      public CognexJob getJobForDescriptor(String descriptor)
      Parameters:
      descriptor -
      Returns:
    • removeReference

      public CognexReference removeReference(Symbol refId)
    • insertReference

      public boolean insertReference(Symbol refId, CognexReference ref)