Skip to content

Commit

Permalink
Fix to make sure the random movements are not overwriting the current…
Browse files Browse the repository at this point in the history
… gesture parameters
  • Loading branch information
MaikePaetzel committed Apr 19, 2017
1 parent 53e8c5a commit 687688e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
12 changes: 6 additions & 6 deletions core/src/iristk/situated/SystemAgentFlow.java
Expand Up @@ -349,20 +349,20 @@ public int onFlowEvent(Event event) throws Exception {
// Line: 61
if (systemAgent.shouldPerformRandomMovements()) {
// Line: 62
Event sendEvent10 = new Event("action.face.param");
Event sendEvent10 = new Event("action.face.param.adj");
sendEvent10.putIfNotNull("name", "BROW_UP_LEFT");
sendEvent10.putIfNotNull("value", Math.max(0, 0.4 + 2*xfilter1.flow(random.nextDouble() - 0.5)));
flowRunner.sendEvent(sendEvent10, new FlowEventInfo(currentState, event, new XMLLocation(new File("C:\\IrisTK\\core\\src\\iristk\\situated\\SystemAgentFlow.xml"), 62, 135)));
flowRunner.sendEvent(sendEvent10, new FlowEventInfo(currentState, event, new XMLLocation(new File("C:\\IrisTK\\core\\src\\iristk\\situated\\SystemAgentFlow.xml"), 62, 139)));
// Line: 63
Event sendEvent11 = new Event("action.face.param");
Event sendEvent11 = new Event("action.face.param.adj");
sendEvent11.putIfNotNull("name", "BROW_UP_RIGHT");
sendEvent11.putIfNotNull("value", Math.max(0, 0.4 + 2*xfilter2.flow(random.nextDouble() - 0.5)));
flowRunner.sendEvent(sendEvent11, new FlowEventInfo(currentState, event, new XMLLocation(new File("C:\\IrisTK\\core\\src\\iristk\\situated\\SystemAgentFlow.xml"), 63, 136)));
flowRunner.sendEvent(sendEvent11, new FlowEventInfo(currentState, event, new XMLLocation(new File("C:\\IrisTK\\core\\src\\iristk\\situated\\SystemAgentFlow.xml"), 63, 140)));
// Line: 64
Event sendEvent12 = new Event("action.face.param");
Event sendEvent12 = new Event("action.face.param.adj");
sendEvent12.putIfNotNull("name", "SMILE_CLOSED");
sendEvent12.putIfNotNull("value", Math.max(0, 0.4 + 2*xfilter3.flow(random.nextDouble() - 0.5)));
flowRunner.sendEvent(sendEvent12, new FlowEventInfo(currentState, event, new XMLLocation(new File("C:\\IrisTK\\core\\src\\iristk\\situated\\SystemAgentFlow.xml"), 64, 135)));
flowRunner.sendEvent(sendEvent12, new FlowEventInfo(currentState, event, new XMLLocation(new File("C:\\IrisTK\\core\\src\\iristk\\situated\\SystemAgentFlow.xml"), 64, 139)));
}
}
if (eventResult != EVENT_IGNORED) return eventResult;
Expand Down
6 changes: 3 additions & 3 deletions core/src/iristk/situated/SystemAgentFlow.xml
Expand Up @@ -59,9 +59,9 @@
<!-- The following manages the random facial movements every about 20 ms if the random movements are enabled -->
<ontime interval="18-20">
<if cond="systemAgent.shouldPerformRandomMovements()">
<send event="action.face.param" p:name="'BROW_UP_LEFT'" p:value="Math.max(0, 0.4 + 2*xfilter1.flow(random.nextDouble() - 0.5))" />
<send event="action.face.param" p:name="'BROW_UP_RIGHT'" p:value="Math.max(0, 0.4 + 2*xfilter2.flow(random.nextDouble() - 0.5))" />
<send event="action.face.param" p:name="'SMILE_CLOSED'" p:value="Math.max(0, 0.4 + 2*xfilter3.flow(random.nextDouble() - 0.5))" />
<send event="action.face.param.adj" p:name="'BROW_UP_LEFT'" p:value="Math.max(0, 0.4 + 2*xfilter1.flow(random.nextDouble() - 0.5))" />
<send event="action.face.param.adj" p:name="'BROW_UP_RIGHT'" p:value="Math.max(0, 0.4 + 2*xfilter2.flow(random.nextDouble() - 0.5))" />
<send event="action.face.param.adj" p:name="'SMILE_CLOSED'" p:value="Math.max(0, 0.4 + 2*xfilter3.flow(random.nextDouble() - 0.5))" />
</if>
</ontime>
<onevent name="blink">
Expand Down

0 comments on commit 687688e

Please sign in to comment.