mirror of
https://github.com/BotChain-Robots/firmware.git
synced 2026-07-08 17:47:21 +02:00
Fix RIP bugs, add in UART
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user