Class Parsec.Scan

java.lang.Object
com.studica.frc.Parsec.Scan
Enclosing class:
Parsec

public static final class Parsec.Scan extends Object
One distance frame.
  • Method Details

    • getSequence

      public int getSequence()
      Returns the frame counter from the device, which increments with each new frame.
      Returns:
      the frame counter
    • getZoneCount

      public int getZoneCount()
      Returns the number of zones.
      Returns:
      16 (4x4) or 64 (8x8)
    • getGridSize

      public int getGridSize()
      Returns the zones per row and column.
      Returns:
      4 or 8
    • getDistance

      public Optional<org.wpilib.units.measure.Distance> getDistance(int zone)
      Returns the distance measured in one zone, in row-major order as reported by the sensor.
      Parameters:
      zone - zone index, 0 to getZoneCount() - 1
      Returns:
      the distance, or empty if the zone has no valid reading or the index is out of range
    • getDistance

      public Optional<org.wpilib.units.measure.Distance> getDistance(int row, int column)
      Returns the distance measured in one zone of the grid.
      Parameters:
      row - row, 0 to getGridSize() - 1
      column - column, 0 to getGridSize() - 1
      Returns:
      the distance, or empty if the zone has no valid reading or is out of range
    • getClosest

      public Optional<org.wpilib.units.measure.Distance> getClosest()
      Returns the nearest valid reading in any zone.
      Returns:
      the nearest distance, or empty if no zone has a valid reading
    • getRawMillimeters

      public short[] getRawMillimeters()
      Returns the raw readings.
      Returns:
      millimetres per zone; -1 means no reading