Fix RIP bugs, add in UART

This commit is contained in:
Johnathon Slightham
2026-03-31 14:26:37 -04:00
committed by Johnathon Slightham
parent d4602012f1
commit 548e8db484
26 changed files with 704 additions and 434 deletions

View File

@@ -6,6 +6,7 @@
#include "IActuator.h"
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include <atomic>
class DCMotorActuator final : public IActuator {
public:
@@ -16,14 +17,16 @@ class DCMotorActuator final : public IActuator {
private:
void setup_encoder();
static void pid_task(char *args);
static void pid_task(void *args);
double m_current_angle;
int64_t m_target_angle;
TaskHandle_t m_pid_task;
volatile int32_t m_encoder_ticks{0};
double m_integral;
double m_last_error;
double m_current_angle{0.0};
std::atomic<int64_t> m_target_angle{0};
TaskHandle_t m_pid_task{nullptr};
double m_integral{0.0};
double m_last_error{0.0};
};
#endif //SERVO1ACTUATOR_H
#endif //DCMOTORACTUATOR_H