From b8c552d3b318f35a82df228683a5f68c6ae3c3d1 Mon Sep 17 00:00:00 2001 From: Langevin Gael Date: Thu, 12 Oct 2023 19:22:14 +0200 Subject: [PATCH 1/7] pir modif --- src/main/java/org/myrobotlab/service/InMoov2.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main/java/org/myrobotlab/service/InMoov2.java b/src/main/java/org/myrobotlab/service/InMoov2.java index 03035b6d2f..97ab19c4d2 100644 --- a/src/main/java/org/myrobotlab/service/InMoov2.java +++ b/src/main/java/org/myrobotlab/service/InMoov2.java @@ -925,9 +925,10 @@ public void onPirOn() { led.interval = 500; // FIXME flash on config.flashOnBoot invoke("publishFlash"); - // pirOn event vs wake event - invoke("publishEvent", "WAKE"); - } + String sleepState = fsm.getCurrent(); + if ("SLEEPING".equals(sleepState)) + invoke("publishEvent", "WAKE"); + } // GOOD GOOD GOOD - LOOPBACK - flexible and replacable by python // yet provides a stable default, which can be fully replaced From 5979e709c0ec4f4a3901b20405cfd156f8353768 Mon Sep 17 00:00:00 2001 From: Langevin Gael Date: Thu, 12 Oct 2023 20:37:12 +0200 Subject: [PATCH 2/7] Update InMoov2.java --- src/main/java/org/myrobotlab/service/InMoov2.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/myrobotlab/service/InMoov2.java b/src/main/java/org/myrobotlab/service/InMoov2.java index 97ab19c4d2..736059e43b 100644 --- a/src/main/java/org/myrobotlab/service/InMoov2.java +++ b/src/main/java/org/myrobotlab/service/InMoov2.java @@ -926,9 +926,10 @@ public void onPirOn() { // FIXME flash on config.flashOnBoot invoke("publishFlash"); String sleepState = fsm.getCurrent(); - if ("SLEEPING".equals(sleepState)) + if ("SLEEPING".equals(sleepState)) { invoke("publishEvent", "WAKE"); } + } // GOOD GOOD GOOD - LOOPBACK - flexible and replacable by python // yet provides a stable default, which can be fully replaced From ab0c3f262f74c42c1d90e521b838c858ef887f55 Mon Sep 17 00:00:00 2001 From: Langevin Gael Date: Thu, 12 Oct 2023 22:28:25 +0200 Subject: [PATCH 3/7] botState --- src/main/java/org/myrobotlab/service/InMoov2.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/myrobotlab/service/InMoov2.java b/src/main/java/org/myrobotlab/service/InMoov2.java index 736059e43b..eb72c37425 100644 --- a/src/main/java/org/myrobotlab/service/InMoov2.java +++ b/src/main/java/org/myrobotlab/service/InMoov2.java @@ -925,8 +925,8 @@ public void onPirOn() { led.interval = 500; // FIXME flash on config.flashOnBoot invoke("publishFlash"); - String sleepState = fsm.getCurrent(); - if ("SLEEPING".equals(sleepState)) { + String botState = chatBot.getPredicate("botState"); + if ("sleeping".equals(botState)) { invoke("publishEvent", "WAKE"); } } From 5d683ebced0aa20d8f33665af4939d086921e8fe Mon Sep 17 00:00:00 2001 From: Langevin Gael Date: Fri, 13 Oct 2023 11:05:45 +0200 Subject: [PATCH 4/7] wake with fsm state --- src/main/java/org/myrobotlab/service/InMoov2.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/org/myrobotlab/service/InMoov2.java b/src/main/java/org/myrobotlab/service/InMoov2.java index eb72c37425..7760412fee 100644 --- a/src/main/java/org/myrobotlab/service/InMoov2.java +++ b/src/main/java/org/myrobotlab/service/InMoov2.java @@ -925,7 +925,7 @@ public void onPirOn() { led.interval = 500; // FIXME flash on config.flashOnBoot invoke("publishFlash"); - String botState = chatBot.getPredicate("botState"); + String botState = fsm.getCurrent(); if ("sleeping".equals(botState)) { invoke("publishEvent", "WAKE"); } From 7fdb56137cb04c3ba8cc377f48ea5d130fac8689 Mon Sep 17 00:00:00 2001 From: Langevin Gael Date: Fri, 13 Oct 2023 11:12:58 +0200 Subject: [PATCH 5/7] chatBot set botState --- src/main/java/org/myrobotlab/service/InMoov2.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/org/myrobotlab/service/InMoov2.java b/src/main/java/org/myrobotlab/service/InMoov2.java index 7760412fee..eb72c37425 100644 --- a/src/main/java/org/myrobotlab/service/InMoov2.java +++ b/src/main/java/org/myrobotlab/service/InMoov2.java @@ -925,7 +925,7 @@ public void onPirOn() { led.interval = 500; // FIXME flash on config.flashOnBoot invoke("publishFlash"); - String botState = fsm.getCurrent(); + String botState = chatBot.getPredicate("botState"); if ("sleeping".equals(botState)) { invoke("publishEvent", "WAKE"); } From f137b9c504520817783294e0f0d0dc0a0ab171ce Mon Sep 17 00:00:00 2001 From: Langevin Gael Date: Fri, 13 Oct 2023 16:47:40 +0200 Subject: [PATCH 6/7] Update InMoov2.java --- src/main/java/org/myrobotlab/service/InMoov2.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/org/myrobotlab/service/InMoov2.java b/src/main/java/org/myrobotlab/service/InMoov2.java index eb72c37425..d3b808b485 100644 --- a/src/main/java/org/myrobotlab/service/InMoov2.java +++ b/src/main/java/org/myrobotlab/service/InMoov2.java @@ -926,7 +926,7 @@ public void onPirOn() { // FIXME flash on config.flashOnBoot invoke("publishFlash"); String botState = chatBot.getPredicate("botState"); - if ("sleeping".equals(botState)) { + if ("sleeping".equals("botState")) { invoke("publishEvent", "WAKE"); } } From cef0749321c4938a0c53a781f0c5114d0f3aa4b0 Mon Sep 17 00:00:00 2001 From: Langevin Gael Date: Wed, 18 Oct 2023 18:25:19 +0200 Subject: [PATCH 7/7] remove comma --- src/main/java/org/myrobotlab/service/InMoov2.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/org/myrobotlab/service/InMoov2.java b/src/main/java/org/myrobotlab/service/InMoov2.java index d3b808b485..eb72c37425 100644 --- a/src/main/java/org/myrobotlab/service/InMoov2.java +++ b/src/main/java/org/myrobotlab/service/InMoov2.java @@ -926,7 +926,7 @@ public void onPirOn() { // FIXME flash on config.flashOnBoot invoke("publishFlash"); String botState = chatBot.getPredicate("botState"); - if ("sleeping".equals("botState")) { + if ("sleeping".equals(botState)) { invoke("publishEvent", "WAKE"); } }