Class CognexResult

java.lang.Object
edu.tufts.hrilab.mtracs.util.CognexResult

public class CognexResult extends Object
CognexResult represents the data from a single Cognex Tool, as defined by the format we have selected for our Cognex Jobs. Each Cognex Result has a confidence score (or other number expressed as a Double), and a location described by an x, y, and theta value, where theta represents a rotation around the z axis. The ethernet communication string of a CognexJob must deliver the results of CognexTools in the order described above in order to work with our system.
  • Constructor Summary

    Constructors
    Constructor
    Description
    CognexResult(String oneResult, MPose takenAt)
    Constructs a CognexResult given the ethernet communication string representation of a Cognex Tool result, the pose that the picture was taken at, and a 3 dimensional point representing the offset from the end effector to the Cognex.
  • Method Summary

    Modifier and Type
    Method
    Description
    double
    Returns the confidence score or other numerical data about the target.
    Returns a convenient predicate representation of this CognexResult
    Returns a pose representation of this CognexResult
    double
    Returns the rotation about the z axis of the target from the center of the camera.
    double
    Returns the absolute x value of the target in the robot base frame.
    double
    Returns the displacement on the x axis of the target from the center of the camera.
    double
    Returns the absolute y value of the target in the robot base frame.
    double
    Returns the displacement on the y axis of the target from the center of the camera.
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • CognexResult

      public CognexResult(String oneResult, MPose takenAt)
      Constructs a CognexResult given the ethernet communication string representation of a Cognex Tool result, the pose that the picture was taken at, and a 3 dimensional point representing the offset from the end effector to the Cognex.
      Parameters:
      oneResult - The String representation of one Cognex Tool result from the ethernet communication string.
      takenAt - The Pose that the arm was in when the Cognex Job was triggered.
  • Method Details

    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getXOffset

      public double getXOffset()
      Returns the displacement on the x axis of the target from the center of the camera.
      Returns:
      the x displacement of the target in meters.
    • getXAbs

      public double getXAbs()
      Returns the absolute x value of the target in the robot base frame.
      Returns:
      the absolute x value of the target in meters.
    • getYOffset

      public double getYOffset()
      Returns the displacement on the y axis of the target from the center of the camera.
      Returns:
      the y displacement of the target in meters.
    • getYAbs

      public double getYAbs()
      Returns the absolute y value of the target in the robot base frame.
      Returns:
      the absolute y value of the target in meters.
    • getTheta

      public double getTheta()
      Returns the rotation about the z axis of the target from the center of the camera.
      Returns:
      the z rotation of the target in radians.
    • getConfidenceScore

      public double getConfidenceScore()
      Returns the confidence score or other numerical data about the target.
      Returns:
      the double representing the confidence of the target from 0 - 1.
    • getCoords

      public Symbol getCoords()
      Returns a convenient predicate representation of this CognexResult
      Returns:
      the x, y, and rotation values of this CognexResult as a coords predicate.
    • getPose

      public MPose getPose()
      Returns a pose representation of this CognexResult
      Returns:
      the x, y, and rotation values of this CognexResult as a MPose.