mirror of
https://github.com/BotChain-Robots/firmware.git
synced 2026-07-08 17:47:21 +02:00
25 lines
607 B
C++
25 lines
607 B
C++
//
|
|
// Created by Johnathon Slightham on 2025-07-15.
|
|
//
|
|
|
|
#include <memory>
|
|
|
|
#include "control/ActuatorFactory.h"
|
|
#include "control/DCMotorActuator.h"
|
|
#include "control/Servo1Actuator.h"
|
|
#include "flatbuffers_generated/RobotModule_generated.h"
|
|
|
|
std::unique_ptr<IActuator>
|
|
ActuatorFactory::create_actuator(const ModuleType type) {
|
|
switch (type) {
|
|
case ModuleType_SERVO_1:
|
|
return std::make_unique<Servo1Actuator>();
|
|
case ModuleType_SERVO_2:
|
|
return std::make_unique<Servo1Actuator>();
|
|
case ModuleType_DC_MOTOR:
|
|
return std::make_unique<DCMotorActuator>();
|
|
default:
|
|
return nullptr;
|
|
}
|
|
}
|