Skip to content

Commit

Permalink
mouth listen servoMixer.java (#1345)
Browse files Browse the repository at this point in the history
* mouth listen servoMixer.java

* Update InMoov2Config.java

* Update InMoov2Config.java

* add chatBot listener to servoMixer

* Update InMoov2Config.java

* Update InMoov2Config.java

* Update InMoov2Config.java

* Update InMoov2Config.java

* Update InMoov2.java

* Update InMoov2.java

* Update InMoov2.java

* Update InMoov2.java

* Update InMoov2.java
  • Loading branch information
hairygael authored Oct 12, 2023
1 parent 0b3cc26 commit d6b17bd
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 6 deletions.
12 changes: 12 additions & 0 deletions src/main/java/org/myrobotlab/service/InMoov2.java
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,8 @@ public InMoov2Config apply(InMoov2Config c) {
setLocale(getSupportedLocale(Runtime.getInstance().getLocale().toString()));
}

loadAppsScripts();

loadInitScripts();

if (c.loadGestures) {
Expand Down Expand Up @@ -637,6 +639,16 @@ public boolean isMute() {
return mute;
}

/**
* execute python scripts in the app directory on startup of the service
*
* @throws IOException
*/
public void loadAppsScripts() throws IOException {
loadScripts(getResourceDir() + fs + "gestures/InMoovApps/Rock_Paper_Scissors");
loadScripts(getResourceDir() + fs + "gestures/InMoovApps/Kids_WordsGame");
}

public void loadGestures() {
loadGestures(getResourceDir() + fs + "gestures");
}
Expand Down
21 changes: 15 additions & 6 deletions src/main/java/org/myrobotlab/service/config/InMoov2Config.java
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,13 @@ public Plan getDefault(Plan plan, String name) {
mouth.voice = "Mark";
mouth.speechRecognizers = new String[] { name + ".ear" };

// == Peer - servoMixer =============================
// setup name references to different services
ServoMixerConfig servoMixer = (ServoMixerConfig) plan.get(getPeerName("servoMixer"));
servoMixer.listeners = new ArrayList<>();
servoMixer.listeners.add(new Listener("publishText", name + ".mouth", "onText"));
//servoMixer.listeners.add(new Listener("publishText", name + ".chatBot", "onText"));

// == Peer - ear =============================
// setup name references to different services
WebkitSpeechRecognitionConfig ear = (WebkitSpeechRecognitionConfig) plan.get(getPeerName("ear"));
Expand Down Expand Up @@ -337,23 +344,25 @@ public Plan getDefault(Plan plan, String name) {
PidConfig pid = (PidConfig) plan.get(getPeerName("pid"));

PidData tiltPid = new PidData();
tiltPid.ki = 0.001;
tiltPid.kp = 30.0;
tiltPid.ki = -0.001;
tiltPid.kp = -40.0;
tiltPid.inverted = true;
pid.data.put(headTracking.getPeer("tilt").name, tiltPid);

PidData panPid = new PidData();
panPid.ki = 0.001;
panPid.kp = 15.0;
panPid.kp = 40.0;
pid.data.put(headTracking.getPeer("pan").name, panPid);

PidData eyeTiltPid = new PidData();
eyeTiltPid.ki = 0.001;
eyeTiltPid.kp = 10.0;
eyeTiltPid.ki = -0.001;
eyeTiltPid.kp = -30.0;
eyeTiltPid.inverted = true;
pid.data.put(eyeTracking.getPeer("tilt").name, eyeTiltPid);

PidData eyePanPid = new PidData();
eyePanPid.ki = 0.001;
eyePanPid.kp = 10.0;
eyePanPid.kp = 30.0;
pid.data.put(eyeTracking.getPeer("pan").name, eyePanPid);

NeoPixelConfig neoPixel = (NeoPixelConfig) plan.get(getPeerName("neoPixel"));
Expand Down

0 comments on commit d6b17bd

Please sign in to comment.