mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-22 01:11:42 +00:00
[wpilibc] Add units to Ultrasonic class API (#3403)
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user