Class VisionSolutions

  • All Implemented Interfaces:
    Solutions.Subject

    public class VisionSolutions
    extends java.lang.Object
    implements Solutions.Subject
    This helper class implements the Issues & Solutions for the Vision milestone.
    • Field Detail

      • diagnosticsMilliseconds

        protected long diagnosticsMilliseconds
    • Constructor Detail

      • VisionSolutions

        public VisionSolutions()
    • Method Detail

      • getSuperSampling

        public int getSuperSampling()
      • getDiagnosticsMilliseconds

        public long getDiagnosticsMilliseconds()
      • getZeroKnowledgeSettleTimeMs

        public long getZeroKnowledgeSettleTimeMs()
      • getSettleWantedResolutionMm

        public double getSettleWantedResolutionMm()
      • getSettleAcceptableComputeTime

        public double getSettleAcceptableComputeTime()
      • getSettleMaximumPixelDiff

        public double getSettleMaximumPixelDiff()
      • getSettleTestMoveMm

        public double getSettleTestMoveMm()
      • autoCalibrateCamera

        public Length autoCalibrateCamera​(ReferenceCamera camera,
                                          HeadMountable movable,
                                          java.lang.Double expectedDiameter,
                                          java.lang.String diagnostics,
                                          boolean secondary,
                                          boolean autoFocus)
                                   throws java.lang.Exception
        As we don't know anything about the camera yet, the preliminary auto-calibration is somewhat of a chicken and egg proposition. The current solution is very simple: we just stake out three points in the camera view that we assume will always fit in (see zeroKnowledgeDisplacementMm The three points define the X and Y axis grid.
        Parameters:
        camera -
        movable -
        expectedDiameter -
        diagnostics -
        secondary - true if this should calibrate the secondary units per pixel
        Returns:
        The diameter of the detected feature.
        Throws:
        java.lang.Exception
      • centerInOnSubjectLocation

        public Location centerInOnSubjectLocation​(ReferenceCamera camera,
                                                  HeadMountable movable,
                                                  Length subjectDiameter,
                                                  java.lang.String diagnostics,
                                                  boolean secondary)
                                           throws java.lang.Exception
        A fiducial/nozzle tip locator using the same built-in subject detection as the auto-calibration. This supports vision calibration early in the machine setup process, i.e. long before the user should be confronted with editing fiducial locator and nozzle tip calibration pipelines.
        Parameters:
        camera -
        movable -
        diagnostics -
        secondary -
        Returns:
        Throws:
        java.lang.Exception
      • getSubjectPixelLocation

        public CvStage.Result.Circle getSubjectPixelLocation​(ReferenceCamera camera,
                                                             HeadMountable movable,
                                                             CvStage.Result.Circle expectedOffsetAndDiameter,
                                                             double extraSearchRange,
                                                             java.lang.String diagnostics,
                                                             DetectCircularSymmetry.ScoreRange scoreRange,
                                                             boolean rough)
                                                      throws java.lang.Exception
        Before we know anything about the camera, we cannot use pipelines, so we use the DetectCircularSymmetry stage directly. We can get a pixel locations for now.
        Parameters:
        camera -
        movable -
        expectedOffsetAndDiameter -
        extraSearchRange - Specifies an extra search range, relative to the camera view size (minimum of width, height).
        diagnostics -
        scoreRange -
        rough - TODO
        Returns:
        The match as a Circle.
        Throws:
        java.lang.Exception
      • zeroKnowledgeMoveTo

        public void zeroKnowledgeMoveTo​(HeadMountable hm,
                                        Location location,
                                        boolean safeZ)
                                 throws java.lang.Exception
        Moves the head-mountable to a location at safe Z using a conservative backlash-compensation scheme. Used to get precise camera and camera subject positioning before proper backlash compensation can be configured and calibrated.
        Parameters:
        hm -
        location -
        safeZ -
        Throws:
        java.lang.Exception
      • isSolvedPrimaryXY

        public boolean isSolvedPrimaryXY​(ReferenceHead head)
      • isSolvedPrimaryZ

        public boolean isSolvedPrimaryZ​(ReferenceHead head)
      • isSolvedSecondaryXY

        public boolean isSolvedSecondaryXY​(ReferenceHead head)
      • isSolvedSecondaryZ

        public boolean isSolvedSecondaryZ​(ReferenceHead head)
      • calibrateVisualHoming

        public void calibrateVisualHoming​(ReferenceHead head,
                                          ReferenceCamera defaultCamera,
                                          Length fiducialDiameter)
                                   throws java.lang.Exception
        Calibrate the visual homing.
        Parameters:
        head -
        defaultCamera -
        fiducialDiameter -
        Throws:
        java.lang.Exception
      • getHomingFiducialDiameter

        public Length getHomingFiducialDiameter()