-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🌹 Switches to an explicit sense plan act flow
- Loading branch information
1 parent
e919b2a
commit f3d2fec
Showing
5 changed files
with
64 additions
and
113 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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.initialize(); | ||
|
||
spot.begin(); | ||
g_taskManager.createTask(SpotControlLoopEntry, "Spot control task", 4096, nullptr, 3); | ||
} | ||
|
||
void loop() { vTaskDelete(NULL); } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters