Class Parsec.Scan
java.lang.Object
com.studica.frc.Parsec.Scan
- Enclosing class:
Parsec
One distance frame.
-
Method Summary
Modifier and TypeMethodDescriptionOptional<org.wpilib.units.measure.Distance> Returns the nearest valid reading in any zone.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.Optional<org.wpilib.units.measure.Distance> getDistance(int row, int column) Returns the distance measured in one zone of the grid.intReturns the zones per row and column.short[]Returns the raw readings.intReturns the frame counter from the device, which increments with each new frame.intReturns the number of zones.
-
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
Returns the distance measured in one zone, in row-major order as reported by the sensor.- Parameters:
zone- zone index, 0 togetZoneCount()- 1- Returns:
- the distance, or empty if the zone has no valid reading or the index is out of range
-
getDistance
Returns the distance measured in one zone of the grid.- Parameters:
row- row, 0 togetGridSize()- 1column- column, 0 togetGridSize()- 1- Returns:
- the distance, or empty if the zone has no valid reading or is out of range
-
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
-