pros::v5::Distance class

Base classes

class Device

Public static functions

static std::vector<Distance> get_all_devices()
Gets all distance sensors.

Constructors, destructors, conversion operators

Distance(const std::uint8_t port)
Creates a Distance Sensor object for the given port.
Distance(const Device& device)

Public functions

std::int32_t get() virtual
Get the currently measured distance from the sensor in mm.
std::int32_t get_distance() virtual
Get the currently measured distance from the sensor in mm.
std::int32_t get_confidence() virtual
Get the confidence in the distance reading.
std::int32_t get_object_size() virtual
Get the current guess at relative object size.
double get_object_velocity() virtual
Get the object velocity in m/s.

Friends

std::ostream& operator<<(std::ostream& os, pros::Distance& distance)
This is the overload for the << operator for printing to streams.