Servo control

This commit is contained in:
2025-07-15 10:59:48 -04:00
parent c1d9a3a8b4
commit 15a0f38bac
20 changed files with 309 additions and 531 deletions

View File

@@ -0,0 +1,18 @@
//
// Created by Johnathon Slightham on 2025-07-15.
//
#ifndef ACTUATORFACTORY_H
#define ACTUATORFACTORY_H
#include "IActuator.h"
#include "flatbuffers_generated/RobotModule_generated.h"
class ActuatorFactory {
public:
static std::unique_ptr<IActuator> create_actuator(ModuleType type);
};
#endif //ACTUATORFACTORY_H

View File

@@ -0,0 +1,15 @@
//
// Created by Johnathon Slightham on 2025-07-15.
//
#ifndef IACTUATOR_H
#define IACTUATOR_H
#include <cstdint>
class IActuator {
public:
virtual ~IActuator() {}
virtual void actuate(uint8_t *cmd) = 0;
};
#endif //IACTUATOR_H

View File

@@ -0,0 +1,18 @@
//
// Created by Johnathon Slightham on 2025-07-15.
//
// 180 deg servo
#ifndef SERVO1ACTUATOR_H
#define SERVO1ACTUATOR_H
#include "IActuator.h"
class Servo1Actuator final : public IActuator {
public:
Servo1Actuator();
void actuate(uint8_t *cmd) override;
};
#endif //SERVO1ACTUATOR_H