Class Pixy2Line


  • public class Pixy2Line
    extends java.lang.Object
    Java Port of Pixy2 Arduino Library Defines line tracker for Pixy2 https://github.com/PseudoResonance/Pixy2JavaAPI
    • Constructor Detail

      • Pixy2Line

        protected Pixy2Line​(Pixy2 pixy)
        Constructs Pixy2 Line Tracker
        Parameters:
        pixy - Pixy2 instance
    • Method Detail

      • getAllFeatures

        public byte getAllFeatures()

        Gets all features from Pixy2

        Defaults to getting all available features and waiting for a response

        Returned data should be retrieved from the cache with getVectorCache(), getIntersectionCache() or getBarcodeCache()

        Returns:
        Pixy2 error code
      • getMainFeatures

        public byte getMainFeatures()

        Gets the main features from the Pixy2. This is a more constrained line tracking algorithm.

        Defaults to getting all available features and waiting for a response

        Returned data should be retrieved from the cache with getVectorCache(), getIntersectionCache() or getBarcodeCache()

        Returns:
        Pixy2 error code
      • getAllFeatures

        public byte getAllFeatures​(byte features)

        Gets all features from Pixy2

        Defaults to waiting for a response

        Returned data should be retrieved from the cache with getVectorCache(), getIntersectionCache() or getBarcodeCache()

        Parameters:
        features - Features to get
        Returns:
        Pixy2 error code
      • getMainFeatures

        public byte getMainFeatures​(byte features)

        Gets the main features from the Pixy2. This is a more constrained line tracking algorithm.

        Defaults to waiting for a response

        Returned data should be retrieved from the cache with getVectorCache(), getIntersectionCache() or getBarcodeCache()

        Parameters:
        features - Features to get
        Returns:
        Pixy2 error code
      • getAllFeatures

        public byte getAllFeatures​(byte features,
                                   boolean wait)

        Gets all features from Pixy2

        Returned data should be retrieved from the cache with getVectorCache(), getIntersectionCache() or getBarcodeCache()

        Parameters:
        features - Features to get
        wait - Wait for response
        Returns:
        Pixy2 error code
      • getMainFeatures

        public byte getMainFeatures​(byte features,
                                    boolean wait)

        Gets the main features from the Pixy2. This is a more constrained line tracking algorithm.

        Returned data should be retrieved from the cache with getVectorCache(), getIntersectionCache() or getBarcodeCache()

        Parameters:
        features - Features to get
        wait - Wait for response
        Returns:
        Pixy2 error code
      • setMode

        public byte setMode​(int mode)
        Sets Pixy2 line tracking mode
        Parameters:
        mode - Pixy2 line tracking mode
        Returns:
        Pixy2 error code
      • setNextTurn

        public byte setNextTurn​(short angle)
        Sets turn angle to use for next intersection
        Parameters:
        angle - Turn angle
        Returns:
        Pixy2 error code
      • setDefaultTurn

        public byte setDefaultTurn​(short angle)
        Sets default angle to turn to at an intersection
        Parameters:
        angle - Turn angle
        Returns:
        Pixy2 error code
      • setVector

        public byte setVector​(int index)
        Choose vector to track manually
        Parameters:
        index - Index of vector
        Returns:
        Pixy2 error code
      • reverseVector

        public byte reverseVector()
        Requests to invert vector
        Returns:
        Pixy2 error code