[wpilibc] Add units to Ultrasonic class API (#3403)

This commit is contained in:
Tyler Veness
2021-06-01 21:54:56 -07:00
committed by GitHub
parent fe570e000c
commit d9eeb45b03
2 changed files with 11 additions and 25 deletions

View File

@@ -10,6 +10,7 @@
#include <vector>
#include <hal/SimDevice.h>
#include <units/length.h>
#include <units/time.h>
#include <units/velocity.h>
@@ -123,22 +124,13 @@ class Ultrasonic : public Sendable, public SendableHelper<Ultrasonic> {
static void SetAutomaticMode(bool enabling);
/**
* Get the range in inches from the ultrasonic sensor.
* Get the range from the ultrasonic sensor.
*
* @return Range in inches of the target returned from the ultrasonic sensor.
* If there is no valid value yet, i.e. at least one measurement
* hasn't completed, then return 0.
* @return Range of the target returned from the ultrasonic sensor. If there
* is no valid value yet, i.e. at least one measurement hasn't
* completed, then return 0.
*/
double GetRangeInches() const;
/**
* Get the range in millimeters from the ultrasonic sensor.
*
* @return Range in millimeters of the target returned by the ultrasonic
* sensor. If there is no valid value yet, i.e. at least one
* measurement hasn't completed, then return 0.
*/
double GetRangeMM() const;
units::meter_t GetRange() const;
bool IsEnabled() const;