mirror of
https://github.com/BotChain-Robots/firmware.git
synced 2026-07-08 09:37:21 +02:00
16 lines
365 B
C++
16 lines
365 B
C++
|
|
#include <memory>
|
|
|
|
#include "control/SensorFactory.h"
|
|
#include "control/DistanceSensor.h"
|
|
#include "flatbuffers_generated/RobotModule_generated.h"
|
|
|
|
std::unique_ptr<ISensor> SensorFactory::create_sensor(const ModuleType type) {
|
|
switch (type) {
|
|
case ModuleType_DISTANCE_SENSOR:
|
|
return std::make_unique<DistanceSensor>();
|
|
default:
|
|
return nullptr;
|
|
}
|
|
}
|