:linenothreshold: 5
Range#
Introduction#
The VEX AIR Drone features 2 Range Sensors, one on the front of the drone, and one on the bottom. These sensors allow the drone to detect the distance between it and the nearest object.
Below is a list of all available methods:
Getters
get_distance – Returns the distance from a Range Sensor.
Getters#
get_distance#
get_distance
returns the distance between a Range Sensor and the nearest object.
Usage:
drone.range.get_distance(range, units)
Parameters |
Description |
---|---|
|
The Range Sensor to use:
|
|
Optional. The unit that represents the distance:
|
# Fly forward until close to an object
drone.take_off(500)
drone.move_at(0, 50)
while not drone.range.get_distance(FORWARD_RANGE, MM) < 75:
wait(0.1, SECONDS)
drone.land()