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