diff --git a/Apps/Android/app/src/main/java/fr/reivaxy/kinetix/HandHandler.java b/Apps/Android/app/src/main/java/fr/reivaxy/kinetix/HandHandler.java index cbf96f3..810434d 100644 --- a/Apps/Android/app/src/main/java/fr/reivaxy/kinetix/HandHandler.java +++ b/Apps/Android/app/src/main/java/fr/reivaxy/kinetix/HandHandler.java @@ -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": @@ -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"; @@ -176,6 +176,9 @@ private String translateMessage(String position) { case "ouvrir": case "ouvert": case "ouverte": + case "five": + case "cinq": + case "5": position = "five"; break; @@ -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": @@ -219,6 +224,7 @@ private String translateMessage(String position) { break; case "come here": + case "come": case "viens": case "viens ici": case "venez": @@ -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); diff --git a/firmware/esp32/platformio.ini b/firmware/esp32/platformio.ini index 945f607..bfde1ef 100644 --- a/firmware/esp32/platformio.ini +++ b/firmware/esp32/platformio.ini @@ -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] @@ -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 diff --git a/firmware/esp32/src/MessageProcessor.cpp b/firmware/esp32/src/MessageProcessor.cpp index 0b011ce..f27c28d 100644 --- a/firmware/esp32/src/MessageProcessor.cpp +++ b/firmware/esp32/src/MessageProcessor.cpp @@ -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); @@ -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(); } }