Skip to content

Commit

Permalink
Tweaking stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
reivaxy committed Jun 23, 2024
1 parent 986a455 commit 169d7f3
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 25 deletions.
18 changes: 12 additions & 6 deletions Apps/Android/app/src/main/java/fr/reivaxy/kinetix/HandHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -127,11 +127,13 @@ private String translateMessage(String position) {
switch(position) {
case "1":
case "un":
case "one":
case "pointé":
case "pointée":
case "pointe":
case "pointer":
case "montrer":
case "show":
case "clavier":
case "pointing":
case "point":
Expand All @@ -145,26 +147,24 @@ private String translateMessage(String position) {
case "de":
case "to":
case "too":
case "two":
case "victory":
position = "two";
break;

case "3":
case "trois":
case "three":
position = "three";
break;

case "4":
case "quatre":
case "for":
case "four":
position = "four";
break;

case "5":
case "cinq":
position = "five";
break;

case "okay":
case "ok":
position = "ok";
Expand All @@ -176,6 +176,9 @@ private String translateMessage(String position) {
case "ouvrir":
case "ouvert":
case "ouverte":
case "five":
case "cinq":
case "5":
position = "five";
break;

Expand All @@ -191,12 +194,14 @@ private String translateMessage(String position) {
position = "fist";
break;

case "scratch":
case "gratte":
case "gratter":
case "gratté":
position = "scratch";
break;

case "pinch":
case "open pinch":
case "opened pinch":
case "pince ouverte":
Expand All @@ -219,6 +224,7 @@ private String translateMessage(String position) {
break;

case "come here":
case "come":
case "viens":
case "viens ici":
case "venez":
Expand All @@ -232,7 +238,7 @@ private String translateMessage(String position) {
break;

default:
position = null;
position = null; // Avoid stopping on non recognized commands
}
SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(fragment.getContext());
boolean safeFilter = preferences.getBoolean("safeFilter", false);
Expand Down
20 changes: 5 additions & 15 deletions firmware/esp32/platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
; https://docs.platformio.org/page/projectconf.html

[platformio]
default_envs = proto
default_envs = right

;this is not working for now
[env:c3]
Expand All @@ -19,26 +19,16 @@ monitor_port = COM10

[env:proto]
build_flags = !python gitVersion.py -std=gnu++17 -DCORE_DEBUG_LEVEL=3
upload_port = COM14
monitor_port = COM14
upload_port = COM22
monitor_port = COM22

[env:right]
build_flags = !python gitVersion.py -std=gnu++17 -DCORE_DEBUG_LEVEL=3
upload_port = COM21
monitor_port = COM21

[env:left]
build_flags = !python gitVersion.py -std=gnu++17 -DLEFT_HAND
upload_port = COM18
monitor_port = COM18

[env:home_right]
build_flags = !python gitVersion.py -std=gnu++17 -DHOME_SERVOS
upload_port = COM19
monitor_port = COM19

[env:home_left]
build_flags = !python gitVersion.py -std=gnu++17 -DLEFT_HAND -DHOME_SERVOS
[env:left]
build_flags = !python gitVersion.py -std=gnu++17 -DLEFT_HAND
upload_port = COM18
monitor_port = COM18

Expand Down
12 changes: 8 additions & 4 deletions firmware/esp32/src/MessageProcessor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ void MessageProcessor::run() {
}

void MessageProcessor::startMovement(char *movementName) {
hand->stop();

// Make sure we use the appropriate min and max Servo values when fingers are wired.
hand->setCalibration(false);

Expand All @@ -68,21 +68,25 @@ void MessageProcessor::startMovement(char *movementName) {
}

if (0 == strcmp(movementName, "calibration")) {
hand->stop();
calibration();
return;
}
if (0 == strcmp(movementName, "scratch")) {
hand->stop();
scratch();
return;
}

if (0 == strcmp(movementName, "come")) {
hand->stop();
come();
return;
}

handMovement = hmf->getByName(movementName);
if (handMovement != NULL) {
HandMovement *newHandMovement = hmf->getByName(movementName);
if (newHandMovement != NULL) {
hand->stop();
handMovement = newHandMovement;
handMovement->start();
}
}
Expand Down

0 comments on commit 169d7f3

Please sign in to comment.