RoboidControl
Loading...
Searching...
No Matches
d:/PlatformIO/RoboidControl/DistanceSensor.h
Go to the documentation of this file.
1#pragma once
2
3#include "Sensor.h"
4
5namespace Passer {
6namespace RoboidControl {
7
9class DistanceSensor : public Sensor {
10public:
17
20 virtual float GetDistance();
21
23 float minRange = 0.01F;
25 float maxRange = 10.0F;
26
28 float triggerDistance = 1;
29
32 bool ObjectNearby();
33
34protected:
36 float distance = 0;
37};
38
39} // namespace RoboidControl
40} // namespace Passer
41using namespace Passer::RoboidControl;
A Sensor which can measure the distance to the nearest object.
Definition DistanceSensor.h:9
bool ObjectNearby()
Indicate that an object is nearby.
Definition DistanceSensor.cpp:22
float maxRange
The maximum range at which the sensor gives reliable measurements.
Definition DistanceSensor.h:25
DistanceSensor()
Default constructor.
Definition DistanceSensor.cpp:5
float distance
Distance to the closest object.
Definition DistanceSensor.h:36
float triggerDistance
The distance at which ObjectNearby triggers.
Definition DistanceSensor.h:28
float minRange
The minimum range at which the sensor gives reliable measurements.
Definition DistanceSensor.h:23
virtual float GetDistance()
Determine the distance to the nearest object.
Definition DistanceSensor.cpp:15
A sensor is a thing which can perform measurements in the environment.
Definition Sensor.h:9
Definition Accelerometer.h:7
Definition AbsoluteEncoder.h:5