mirror of
https://github.com/BotChain-Robots/control.git
synced 2026-03-09 16:22:26 +01:00
24 lines
562 B
C++
24 lines
562 B
C++
#ifndef CONTROL_DISTANCESENSOR_H
|
|
#define CONTROL_DISTANCESENSOR_H
|
|
|
|
#include "Module.h"
|
|
#include "flatbuffers/SensorMessageBuilder.h"
|
|
#include "util/Variant.h"
|
|
|
|
class DistanceSensor : public Module {
|
|
|
|
public:
|
|
DistanceSensor(uint8_t device_id, ModuleType type) : Module(device_id, type) {
|
|
}
|
|
|
|
double get_distance() override;
|
|
|
|
std::vector<uint8_t> get_actuation_message() override;
|
|
void update_sensor_data(const Flatbuffers::sensor_value &value) override;
|
|
|
|
private:
|
|
double m_current_distance = 0.0;
|
|
};
|
|
|
|
#endif // CONTROL_DISTANCESENSOR_H
|