RoboidControl-cpp/DirectionalSensor.h
2024-11-29 12:56:59 +01:00

29 lines
755 B
C++

#pragma once
#include "Sensor.h"
namespace Passer {
namespace RoboidControl {
/// @brief A Sensor which can measure the distance to the nearest object
class DirectionalSensor : public Sensor {
public:
/// @brief Default constructor
DirectionalSensor();
const unsigned int Type = SensorType | (unsigned int)Type::DirectionalSensor;
/// @brief Determine the distance to the nearest object
/// @return the measured distance in meters to the nearest object
virtual Spherical16 GetVector();
virtual void ProcessBytes(unsigned char *bytes) override;
protected:
/// @brief Distance to the closest object
Spherical16 vector = Spherical16::zero;
};
} // namespace RoboidControl
} // namespace Passer
using namespace Passer::RoboidControl;