Smartcar Shield
Loading...
Searching...
No Matches
DistanceSensor.hpp
Go to the documentation of this file.
1
5#pragma once
6
7#include <stdint.h> // NOLINT(modernize-deprecated-headers)
8
9namespace smartcarlib
10{
11namespace constants
12{
13namespace distanceSensor
14{
15const int kMaxMedianMeasurements = 100;
16}
17} // namespace constants
18} // namespace smartcarlib
19
21{
22public:
23 virtual ~DistanceSensor() = default;
24
36 virtual unsigned int getDistance() = 0;
37
51 virtual unsigned int getMedianDistance(uint8_t iterations) = 0;
52};
A parent class for all sensors that conduct distance measurements.
virtual unsigned int getMedianDistance(uint8_t iterations)=0
Gets the median distance from the specified number of measurements.
virtual ~DistanceSensor()=default
virtual unsigned int getDistance()=0
Gets the distance measured by the sensor in centimeters.