Package com.studica.frc

## Class LidarMini.ScanData

- java.lang.Object
- - com.studica.frc.LidarMini.ScanData

Enclosing class:
  LidarMini

    public static class LidarMini.ScanData
    extends java.lang.Object

A single completed 360Â° scan from the T-mini Plus.

All three arrays are parallel and have the same length (`size()`).

- `angle[i]` â€“ degrees, range [0, 360]
- `distance[i]` â€“ metres in [0.05, 12.0], or `-1.0` for out-of-range / interference-flagged samples
- `intensity[i]` â€“ raw reflectance value [0, 255]
- `timestamp` â€“ nanoseconds from the system steady clock at the moment the lap started

### Field Summary

Fields
`float[]` `angle` Angle in degrees [0, 360) for each sample point.
`float[]` `distance` Distance in metres for each sample point.
`float[]` `intensity` Raw reflectance intensity [0, 255] for each sample point.
`long` `timestamp` Nanosecond timestamp (steady clock) when this lap began.

### Constructor Summary

Constructors
`ScanData()`

### Method Summary

All Methods Instance Methods Concrete Methods
`float` `getDistanceAt​(float targetDeg, float toleranceDeg)` Returns the distance (metres) at the closest angle to `targetDeg`, or `-1.0` if no valid sample is available near that angle.
`int` `size()` Returns the number of sample points in this scan.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Field Detail

#### angle

    public float[] angle

Angle in degrees [0, 360) for each sample point.

#### distance

    public float[] distance

Distance in metres for each sample point. `-1.0` means out-of-range or hardware-flagged interference.

#### intensity

    public float[] intensity

Raw reflectance intensity [0, 255] for each sample point.

#### timestamp

    public long timestamp

Nanosecond timestamp (steady clock) when this lap began.

### Constructor Detail

#### ScanData

    public ScanData()

### Method Detail

#### size

    public int size()

Returns the number of sample points in this scan.

Returns:
  number of points, or 0 if arrays have not been populated yet

#### getDistanceAt

    public float getDistanceAt​(float targetDeg,
                               float toleranceDeg)

Returns the distance (metres) at the closest angle to `targetDeg`, or `-1.0` if no valid sample is available near that angle.

Parameters:
  `targetDeg` - desired angle in degrees [0, 360]
  `toleranceDeg` - maximum angular deviation to accept
Returns:
  distance in metres, or `-1.0`