mirror of
https://github.com/BotChain-Robots/control.git
synced 2026-03-10 00:32:26 +01:00
Add distance sensor and display
This commit is contained in:
23
include/sensors/DistanceSensor.h
Normal file
23
include/sensors/DistanceSensor.h
Normal file
@@ -0,0 +1,23 @@
|
||||
#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
|
||||
Reference in New Issue
Block a user