isWithinDistance

fun isWithinDistance(threshold: Double, unit: DistanceUnit = DistanceUnit.CM): Boolean

True if a distance sensor senses an object within threshold in the given unit.