Skip to content

Commit

Permalink
temp
Browse files Browse the repository at this point in the history
  • Loading branch information
AJ-Koenig committed Dec 16, 2024
1 parent 98ce1a1 commit c5fc30c
Show file tree
Hide file tree
Showing 6 changed files with 70 additions and 24 deletions.
3 changes: 3 additions & 0 deletions Software/platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,16 @@ build_flags =
-D HTTPCLIENT_1_1_COMPATIBLE=0
; This flag is used for Stroke Engine.
-D DEBUG_TALKATIVE
-fconcepts
extends = common
platform = espressif32
board = esp32dev
framework = arduino
monitor_speed = 115200
monitor_filters = colorize, esp32_exception_decoder, time
upload_port = /dev/cu.usbserial-0001
targets = upload, monitor


[env:debugWithoutMotor]
build_flags =
Expand Down
12 changes: 6 additions & 6 deletions Software/src/constants/Menu.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
enum Menu {
SimplePenetration,
StrokeEngine,
Streaming,
UpdateOSSM,
WiFiSetup,
Help,
Expand All @@ -16,11 +17,10 @@ enum Menu {
};

static String menuStrings[Menu::NUM_OPTIONS] = {
UserConfig::language.SimplePenetration,
UserConfig::language.StrokeEngine,
UserConfig::language.Update,
UserConfig::language.WiFiSetup,
UserConfig::language.GetHelp,
UserConfig::language.Restart};
UserConfig::language.SimplePenetration, UserConfig::language.StrokeEngine,
UserConfig::language.Streaming, UserConfig::language.Update,
UserConfig::language.WiFiSetup, UserConfig::language.GetHelp,
UserConfig::language.Restart,
};

#endif // OSSM_SOFTWARE_MENU_H
29 changes: 11 additions & 18 deletions Software/src/constants/copy/en-us.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ static const LanguageStruct enUs = {
.Speed = "Speed",
.SpeedWarning = "Decrease the speed to begin playing.",
.StateNotImplemented = "State: %u not implemented.",
.Streaming = "Streaming",
.Stroke = "Stroke",
.StrokeEngine = "Stroke Engine",
.StrokeTooShort = "Stroke too short. Please check you drive belt.",
Expand All @@ -34,24 +35,16 @@ static const LanguageStruct enUs = {
.WiFiSetupLine1 = "Connect to",
.WiFiSetupLine2 = "'Ossm Setup'",
.YouShouldNotBeHere = "You should not be here.",
.StrokeEngineDescriptions = {
"Acceleration, coasting, deceleration equally split; no sensation.",
"Speed shifts with sensation; balances faster strokes.",
"Sensation varies acceleration; from robotic to gradual.",
"Full and half depth strokes alternate; sensation affects speed.",
"Stroke depth increases per cycle; sensation sets count.",
"Pauses between strokes; sensation adjusts length.",
"Modifies length, maintains speed; sensation influences direction."
},
.StrokeEngineNames = {
"Simple Stroke",
"Teasing Pounding",
"Robo Stroke",
"Half'n'Half",
"Deeper",
"Stop'n'Go",
"Insist"
},
.StrokeEngineDescriptions =
{"Acceleration, coasting, deceleration equally split; no sensation.",
"Speed shifts with sensation; balances faster strokes.",
"Sensation varies acceleration; from robotic to gradual.",
"Full and half depth strokes alternate; sensation affects speed.",
"Stroke depth increases per cycle; sensation sets count.",
"Pauses between strokes; sensation adjusts length.",
"Modifies length, maintains speed; sensation influences direction."},
.StrokeEngineNames = {"Simple Stroke", "Teasing Pounding", "Robo Stroke",
"Half'n'Half", "Deeper", "Stop'n'Go", "Insist"},
};

#endif // OSSM_SOFTWARE_EN_US_H
37 changes: 37 additions & 0 deletions Software/src/ossm/OSSM.Streaming.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#include "OSSM.h"

#include "services/stepper.h"

void startStreamingTask(void *pvParameters) {
// OSSM *ossm = (OSSM *)pvParameters;

// auto isInCorrectState = [](OSSM *ossm) {
// // Add any states that you want to support here.
// // return ossm->sm->is("streaming"_s) ||
// // ossm->sm->is("streaming.preflight"_s) ||
// // ossm->sm->is("streaming.idle"_s);
// return true;
// };

// // create a function that, given a time, returns a value between 0 and
// 100
// // from a sine wave with period of 1000ms
// auto sineWave = [](int time) { return sin(time * 2 * M_PI / 1000) * 100;
// };

// while (isInCorrectState(ossm)) {
// stepper->moveTo(sineWave(millis()), false);
// vTaskDelay(1);
// }

// vTaskDelete(nullptr);
}

void OSSM::startStreaming() {
// int stackSize = 10 * configMINIMAL_STACK_SIZE;

// xTaskCreatePinnedToCore(startStreamingTask, "startStreamingTask",
// stackSize,
// this, configMAX_PRIORITIES - 1, nullptr,
// Tasks::operationTaskCore);
}
12 changes: 12 additions & 0 deletions Software/src/ossm/OSSM.h
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,9 @@ class OSSM : public OSSMInterface {
auto startSimplePenetration = [](OSSM &o) {
o.startSimplePenetration();
};

// auto startStreaming = [](OSSM &o) { o.startStreaming(); };

auto startStrokeEngine = [](OSSM &o) { o.startStrokeEngine(); };
auto emergencyStop = [](OSSM &o) {
o.stepper->forceStop();
Expand Down Expand Up @@ -182,6 +185,7 @@ class OSSM : public OSSMInterface {
"homing.backward"_s + done[isFirstHomed] / setHomed = "menu"_s,
"homing.backward"_s + done[(isOption(Menu::SimplePenetration))] / setHomed = "simplePenetration"_s,
"homing.backward"_s + done[(isOption(Menu::StrokeEngine))] / setHomed = "strokeEngine"_s,
// "homing.backward"_s + done[(isOption(Menu::Streaming))] / setHomed = "streaming"_s,

"menu"_s / (drawMenu, startWifi) = "menu.idle"_s,
"menu.idle"_s + buttonPress[(isOption(Menu::SimplePenetration))] = "simplePenetration"_s,
Expand All @@ -197,6 +201,13 @@ class OSSM : public OSSMInterface {
"simplePenetration.preflight"_s + done / (resetSettings, drawPlayControls, startSimplePenetration) = "simplePenetration.idle"_s,
"simplePenetration.idle"_s + longPress / (emergencyStop, setNotHomed) = "menu"_s,

// "streaming"_s [isNotHomed] = "homing"_s,
// "streaming"_s [isPreflightSafe] / (resetSettings, drawPlayControls, startStreaming) = "streaming.idle"_s,
// "streaming"_s / drawPreflight = "streaming.preflight"_s,
// "streaming.preflight"_s + done / (resetSettings, drawPlayControls, startStreaming) = "streaming.idle"_s,
// "streaming.idle"_s + longPress / (emergencyStop, setNotHomed) = "menu"_s,


"strokeEngine"_s [isNotHomed] = "homing"_s,
"strokeEngine"_s [isPreflightSafe] / (resetSettings, drawPlayControls, startStrokeEngine) = "strokeEngine.idle"_s,
"strokeEngine"_s / drawPreflight = "strokeEngine.preflight"_s,
Expand Down Expand Up @@ -356,6 +367,7 @@ class OSSM : public OSSMInterface {

return currentState;
}
void startStreaming();
};

extern OSSM *ossm;
Expand Down
1 change: 1 addition & 0 deletions Software/src/structs/LanguageStruct.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ struct LanguageStruct {
String Speed;
String SpeedWarning;
String StateNotImplemented;
String Streaming;
String Stroke;
String StrokeEngine;
String StrokeTooShort;
Expand Down

0 comments on commit c5fc30c

Please sign in to comment.