Skip to content

Commit

Permalink
last of the merge problems hopefully
Browse files Browse the repository at this point in the history
  • Loading branch information
supertick committed Sep 20, 2023
1 parent a35a268 commit cf072b0
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 148 deletions.
102 changes: 0 additions & 102 deletions src/main/java/org/myrobotlab/service/InMoov2.java
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,6 @@ public class InMoov2 extends Service<InMoov2Config> implements ServiceLifeCycleL

static String speechRecognizer = "WebkitSpeechRecognition";

protected static final Set<String> stateDefaults = new TreeSet<>();

/**
* This method will load a python file into the python interpreter.
*
Expand Down Expand Up @@ -1238,97 +1236,6 @@ public void onMoveLeftHand(Map<String, Double> map) {
}
}

// public Message publishPython(String method, Object...data) {
// return Message.createMessage(getName(), getName(), method, data);
// }

public void onMoveRightArm(Map<String, Double> map) {
InMoov2Arm rightArm = (InMoov2Arm) getPeer("rightArm");
if (rightArm != null) {
rightArm.onMove(map);
}
}

public void onMoveRightHand(Map<String, Double> map) {
InMoov2Hand rightHand = (InMoov2Hand) getPeer("rightHand");
if (rightHand != null) {
rightHand.onMove(map);
}
}

public void onMoveTorso(Map<String, Double> map) {
InMoov2Torso torso = (InMoov2Torso) getPeer("torso");
if (torso != null) {
torso.onMove(map);
}
}

public void onMoveHead(Map<String, Double> map) {
InMoov2Head head = (InMoov2Head) getPeer("head");
if (head != null) {
head.onMove(map);
}
}

public void onMoveLeftArm(Map<String, Double> map) {
InMoov2Arm leftArm = (InMoov2Arm) getPeer("leftArm");
if (leftArm != null) {
leftArm.onMove(map);
}
}

public void onMoveLeftHand(Map<String, Double> map) {
InMoov2Hand leftHand = (InMoov2Hand) getPeer("leftHand");
if (leftHand != null) {
leftHand.onMove(map);
}
}

// public Message publishPython(String method, Object...data) {
// return Message.createMessage(getName(), getName(), method, data);
// }

public void onMoveRightArm(Map<String, Double> map) {
InMoov2Arm rightArm = (InMoov2Arm) getPeer("rightArm");
if (rightArm != null) {
rightArm.onMove(map);
}
}

public void onMoveRightHand(Map<String, Double> map) {
InMoov2Hand rightHand = (InMoov2Hand) getPeer("rightHand");
if (rightHand != null) {
rightHand.onMove(map);
}
}

public void onMoveTorso(Map<String, Double> map) {
InMoov2Torso torso = (InMoov2Torso) getPeer("torso");
if (torso != null) {
torso.onMove(map);
}
}

public void onMoveHead(Map<String, Double> map) {
InMoov2Head head = (InMoov2Head) getPeer("head");
if (head != null) {
head.onMove(map);
}
}

public void onMoveLeftArm(Map<String, Double> map) {
InMoov2Arm leftArm = (InMoov2Arm) getPeer("leftArm");
if (leftArm != null) {
leftArm.onMove(map);
}
}

public void onMoveLeftHand(Map<String, Double> map) {
InMoov2Hand leftHand = (InMoov2Hand) getPeer("leftHand");
if (leftHand != null) {
leftHand.onMove(map);
}
}

// public Message publishPython(String method, Object...data) {
// return Message.createMessage(getName(), getName(), method, data);
Expand Down Expand Up @@ -1623,15 +1530,6 @@ public void publishInactivity() {
fsm.fire("inactvity");
}

/**
* if inactivityTime configured, this event is published after there has not
* been in activity since.
*/
public void publishInactivity() {
log.info("publishInactivity");
fsm.fire("inactvity");
}

/**
* A more extensible interface point than publishEvent FIXME - create
* interface for this
Expand Down
29 changes: 0 additions & 29 deletions src/main/java/org/myrobotlab/service/NeoPixel.java
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,6 @@ private class Worker implements Runnable {
public void run() {
try {
running = true;
while (running) {
LedDisplayData led = displayQueue.take();
// save existing state if necessary ..
// stop animations if running
// String lastAnimation = currentAnimation;
if ((led.count > 0) && (currentAnimation == null)){

while (running) {
LedDisplayData led = displayQueue.take();
// save existing state if necessary ..
Expand Down Expand Up @@ -411,17 +404,6 @@ public void flash(int r, int g, int b) {
public void flash(int r, int g, int b, int count) {
flash(r, g, b, count, flashTimeOn, flashTimeOff);
}

public void flash(int r, int g, int b, int count, long timeOn, long timeOff) {
LedDisplayData data = new LedDisplayData();
data.red = r;
data.green = g;
data.blue = b;
data.count = count;
data.timeOn = timeOn;
data.timeOff = timeOff;
displayQueue.add(data);
}

public void onPlayAnimation(String animation) {
playAnimation(animation);
Expand All @@ -431,17 +413,6 @@ public void onStopAnimation() {
stopAnimation();
}

public void onFlash(LedDisplayData data) {
displayQueue.add(data);
}

public void flashBrightness(double brightNess) {
NeoPixelConfig c = (NeoPixelConfig)config;

public void onStopAnimation() {
stopAnimation();
}

public void flash(int r, int g, int b, int count, long timeOn, long timeOff) {
LedDisplayData data = new LedDisplayData();
data.red = r;
Expand Down
20 changes: 3 additions & 17 deletions src/main/java/org/myrobotlab/service/config/InMoov2Config.java
Original file line number Diff line number Diff line change
Expand Up @@ -122,14 +122,7 @@ public class InMoov2Config extends ServiceConfig {
*
*/
public boolean stateChangeIsMute = true;

public boolean startupSound = true;

/**
*
*/
public boolean stateChangeIsMute = true;


/**
* Interval in seconds for a idle state event to fire off.
* If the fsm is in a state which will allow transitioning, the InMoov2
Expand Down Expand Up @@ -497,12 +490,7 @@ public Plan getDefault(Plan plan, String name) {
listeners.add(new Listener("publishMoveLeftHand", name));
listeners.add(new Listener("publishMoveTorso", name));

// service --to--> InMoov2
AudioFileConfig mouth_audioFile = (AudioFileConfig) plan.get(getPeerName("mouth.audioFile"));
mouth_audioFile.listeners = new ArrayList<>();
mouth_audioFile.listeners.add(new Listener("publishPeak", name));
fsm.listeners.add(new Listener("publishStateChange", name, "publishStateChange"));



LogConfig log = (LogConfig) plan.get(getPeerName("log"));
log.listeners = new ArrayList<>();
Expand All @@ -519,9 +507,6 @@ public Plan getDefault(Plan plan, String name) {
listeners.add(new Listener("publishPlayAnimation", getPeerName("neoPixel")));
listeners.add(new Listener("publishStopAnimation", getPeerName("neoPixel")));

// remove the auto-added starts in the plan's runtime RuntimConfig.registry
plan.removeStartsWith(name + ".");

// listeners.add(new Listener("publishPowerUp", name));
// listeners.add(new Listener("publishPowerDown", name));
// listeners.add(new Listener("publishError", name));
Expand All @@ -533,6 +518,7 @@ public Plan getDefault(Plan plan, String name) {
listeners.add(new Listener("publishMoveLeftHand", name));
listeners.add(new Listener("publishMoveTorso", name));


// service --to--> InMoov2
AudioFileConfig mouth_audioFile = (AudioFileConfig) plan.get(getPeerName("mouth.audioFile"));
mouth_audioFile.listeners = new ArrayList<>();
Expand Down

0 comments on commit cf072b0

Please sign in to comment.