🌹 Switches to an explicit sense plan act flow
This commit is contained in:
+17
-6
@@ -1,16 +1,27 @@
|
||||
#include <ESP32SvelteKit.h>
|
||||
#include <spot.h>
|
||||
#include <PsychicHttpServer.h>
|
||||
|
||||
#define SERIAL_BAUD_RATE 115200
|
||||
|
||||
DRAM_ATTR PsychicHttpServer server;
|
||||
|
||||
DRAM_ATTR ESP32SvelteKit spot(&server);
|
||||
DRAM_ATTR Spot spot(&server);
|
||||
|
||||
void IRAM_ATTR SpotControlLoopEntry(void*) {
|
||||
TickType_t xLastWakeTime = xTaskGetTickCount();
|
||||
for (;;) {
|
||||
spot.readSensors();
|
||||
spot.planMotion();
|
||||
spot.updateActuators();
|
||||
spot.emitTelemetry();
|
||||
vTaskDelayUntil(&xLastWakeTime, 10 / portTICK_PERIOD_MS);
|
||||
}
|
||||
}
|
||||
|
||||
void setup() {
|
||||
Serial.begin(SERIAL_BAUD_RATE);
|
||||
Serial.begin(115200);
|
||||
|
||||
spot.begin();
|
||||
spot.initialize();
|
||||
|
||||
g_taskManager.createTask(SpotControlLoopEntry, "Spot control task", 4096, nullptr, 3);
|
||||
}
|
||||
|
||||
void loop() { vTaskDelete(NULL); }
|
||||
Reference in New Issue
Block a user