🕊️ Makes task manager global

This commit is contained in:
Rune Harlyk
2024-11-08 13:34:44 +01:00
committed by Rune Harlyk
parent a3fc3eca2e
commit 698b7fbba9
11 changed files with 37 additions and 79 deletions
+4 -5
View File
@@ -2,7 +2,7 @@
#define MotionService_h
#include <event_socket.h>
#include <TaskManager.h>
#include <task_manager.h>
#include <Kinematics.h>
#include <ServoController.h>
#include <Gait/GaitState.h>
@@ -20,8 +20,8 @@ enum class MOTION_STATE { DEACTIVATED, IDLE, CALIBRATION, REST, STAND, CRAWL, WA
class MotionService {
public:
MotionService(PsychicHttpServer *server, ServoController *servoController, TaskManager *taskManager)
: _server(server), _servoController(servoController), _taskManager(taskManager) {}
MotionService(PsychicHttpServer *server, ServoController *servoController)
: _server(server), _servoController(servoController) {}
void begin() {
socket.onEvent(INPUT_EVENT, [&](JsonObject &root, int originId) { handleInput(root, originId); });
@@ -37,7 +37,7 @@ class MotionService {
body_state.updateFeet(default_feet_positions);
_taskManager->createTask(this->_loopImpl, "MotionService", 4096, this, 3);
g_taskManager.createTask(this->_loopImpl, "MotionService", 4096, this, 3);
}
void anglesEvent(JsonObject &root, int originId) {
@@ -145,7 +145,6 @@ class MotionService {
private:
PsychicHttpServer *_server;
TaskManager *_taskManager;
ServoController *_servoController;
Kinematics kinematics;
ControllerCommand command = {0, 0, 0, 0, 0, 0, 0, 0};