Updated documentation
This commit is contained in:
parent
8d3cfdfa51
commit
07254fd3ac
@ -2,32 +2,23 @@
|
|||||||
|
|
||||||
#include "Sensor.h"
|
#include "Sensor.h"
|
||||||
|
|
||||||
/// @brief A sensor which can measure the distance the the nearest object
|
/// @brief A Sensor which can measure the distance to the nearest object
|
||||||
class DistanceSensor : public Sensor
|
class DistanceSensor : public Sensor {
|
||||||
{
|
public:
|
||||||
public:
|
DistanceSensor();
|
||||||
DistanceSensor(); // { isDistanceSensor = true; }
|
DistanceSensor(float triggerDistance);
|
||||||
DistanceSensor(float triggerDistance); // { isDistanceSensor = true; this->triggerDistance = triggerDistance; }
|
/// @brief Determine the distance to the nearest object
|
||||||
/// @brief Determine the distance to the nearest object
|
/// @return the measured distance in meters to the nearest object
|
||||||
/// @return the measured distance in meters to the nearest object
|
virtual float GetDistance();
|
||||||
virtual float GetDistance(); // { return distance; };
|
void SetDistance(float distance);
|
||||||
void SetDistance(float distance); // { this->distance = distance; }; // for simulation purposes
|
|
||||||
|
|
||||||
/// @brief The distance at which ObjectNearby triggers
|
/// @brief The distance at which ObjectNearby triggers
|
||||||
float triggerDistance = 1;
|
float triggerDistance = 1;
|
||||||
|
|
||||||
bool IsOn();
|
bool IsOn();
|
||||||
// {
|
|
||||||
// bool isOn = GetDistance() <= triggerDistance;
|
|
||||||
// return isOn;
|
|
||||||
// }
|
|
||||||
|
|
||||||
bool isOff();
|
bool isOff();
|
||||||
// {
|
|
||||||
// bool isOff = GetDistance() > triggerDistance;
|
|
||||||
// return isOff;
|
|
||||||
// }
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
float distance = 0;
|
float distance = 0;
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user