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