Package edu.tufts.hrilab.mtracs.util
Class CognexResult
java.lang.Object
edu.tufts.hrilab.mtracs.util.CognexResult
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
ConstructorsConstructorDescriptionCognexResult
(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 TypeMethodDescriptiondouble
Returns the confidence score or other numerical data about the target.Returns a convenient predicate representation ofthis
CognexResultgetPose()
Returns a pose representation ofthis
CognexResultdouble
getTheta()
Returns the rotation about the z axis of the target from the center of the camera.double
getXAbs()
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
getYAbs()
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.toString()
-
Constructor Details
-
CognexResult
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
-
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
Returns a convenient predicate representation ofthis
CognexResult- Returns:
- the x, y, and rotation values of
this
CognexResult as acoords
predicate.
-
getPose
Returns a pose representation ofthis
CognexResult- Returns:
- the x, y, and rotation values of
this
CognexResult as a MPose.
-