10 #include "SensorBase.h"
12 #include "PIDSource.h"
13 #include "LiveWindow/LiveWindowSendable.h"
39 Ultrasonic(uint32_t pingChannel, uint32_t echoChannel, DistanceUnit units = kInches);
40 Ultrasonic(uint8_t pingModuleNumber, uint32_t pingChannel,
41 uint8_t echoModuleNumber, uint32_t echoChannel, DistanceUnit units = kInches);
49 bool IsEnabled() {
return m_enabled; }
50 void SetEnabled(
bool enable) { m_enabled = enable; }
57 void StartLiveWindowMode();
58 void StopLiveWindowMode();
59 std::string GetSmartDashboardType();
60 void InitTable(ITable *subTable);
66 static void UltrasonicChecker();
68 static constexpr
double kPingTime = 10 * 1e-6;
69 static const uint32_t kPriority = 90;
70 static constexpr
double kMaxUltrasonicTime = 0.1;
71 static constexpr
double kSpeedOfSoundInchesPerSec = 1130.0 * 12.0;
75 static bool m_automaticEnabled;
76 static SEM_ID m_semaphore;
80 bool m_allocatedChannels;
double GetRangeInches()
Definition: Ultrasonic.cpp:279
virtual ~Ultrasonic()
Definition: Ultrasonic.cpp:168
Definition: DigitalOutput.h:21
Ultrasonic(DigitalOutput *pingChannel, DigitalInput *echoChannel, DistanceUnit units=kInches)
Definition: Ultrasonic.cpp:110
static void SetAutomaticMode(bool enabling)
Definition: Ultrasonic.cpp:216
double PIDGet()
Definition: Ultrasonic.cpp:302
Definition: SensorBase.h:20
double GetRangeMM()
Definition: Ultrasonic.cpp:292
DistanceUnit GetDistanceUnits()
Definition: Ultrasonic.cpp:330
Definition: PIDSource.h:15
Definition: Ultrasonic.h:29
bool IsRangeValid()
Definition: Ultrasonic.cpp:269
void Ping()
Definition: Ultrasonic.cpp:255
void SetDistanceUnits(DistanceUnit units)
Definition: Ultrasonic.cpp:320