/
Epi.ikc
598 lines (451 loc) · 34.2 KB
/
Epi.ikc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
<?xml version="1.0"?>
<group name="Epi"
servosIndexBody = "0"
servosIndexHead = "1"
servosIndexLeftArm = "5"
servosIndexRightArm = "11"
servosIndexPupil = "17"
nrServosBody = "1"
nrServosHead = "4"
nrServosLeftArm = "6"
nrServosRightArm = "6"
nrServosPupil = "2"
nrServosTotal = "19"
>
<!-- import frame and id for epi robots> -->
<!-- <module class = "FRAMES" name = "EpiFrames"/> -->
<!-- Where is Epi in global coordinate system And what is the rotation -->
<module class = "Constant" name = "EpiPosition" data = "
1 0 0 0.85
0 1 0 0.15
0 0 1 0.847
0 0 0 1;" />
<module class = "Constant" name = "EpiRotation" data = "
0 -1 0 0
1 0 0 0
0 0 1 0
0 0 0 1;" />
<!-- Multiply -->
<module class="Transform" name="Epi" />
<connection sourcemodule = "EpiPosition" source = "OUTPUT" targetmodule = "Epi" target = "MATRIX_1" delay = "0"/>
<connection sourcemodule = "ExoID" source = "OUTPUT" targetmodule = "Epi" target = "OBJECT_ID_1" delay = "0"/>
<connection sourcemodule = "ExoID" source = "OUTPUT" targetmodule = "Epi" target = "FRAME_ID_1" delay = "0"/>
<connection sourcemodule = "EpiRotation" source = "OUTPUT" targetmodule = "Epi" target = "MATRIX_2" delay = "0"/>
<connection sourcemodule = "ExoID" source = "OUTPUT" targetmodule = "Epi" target = "OBJECT_ID_2" delay = "0"/>
<connection sourcemodule = "ExoID" source = "OUTPUT" targetmodule = "Epi" target = "FRAME_ID_2" delay = "0"/>
<input name = "EXT_FOCUS_POINT" targetmodule = "HighLevelFocusArbiter" target = "INPUT_6"/>
<input name = "EXT_FOCUS_POINT_V" targetmodule = "HighLevelFocusArbiter" target = "VALUE_6"/>
<!-- Attention -->
<!-- ********************************* -->
<!-- ********************************* -->
<!-- ********************************* -->
<!-- FocusPoint -->
<!-- Where should Epi Look at -->
<!-- Set the coordinate where Epi should look at in egocentric coordinates -->
<module class = "Constant" name = "ManFocusPoint" data = "
1 0 0 1
0 1 0 -0.5
0 0 1 2
0 0 0 1"/>
<_module
class = "FunctionGenerator"
name = "ManualX"
type = "sin"
frequency = "0.1"
offset = "0.5"
amplitude = "0.4"
shift = "0.1"
/>
<_module class="Constant" name="ManualX" data = "2" />
<_module class="Constant" name="ManualY" data = "2" />
<_module class="Constant" name="ManualZ" data = "1" />
<!-- Drifts away -->
<module class="Constant" name="ChangeID" data = "500" /> <!-- All change has the same ID -->
<!-- Random movements -->
<module class = "Randomizer" name = "RandomFocusX" outputsize = "1" min = "-2" max = "2" interval = "80"/>
<module class = "Randomizer" name = "RandomFocusY" outputsize = "1" min = "1.5" max = "6" interval = "80"/>
<module class = "Randomizer" name = "RandomFocusZ" outputsize = "1" min = "1.5" max = "2" interval = "80"/>
<!-- Change -->
<module class="RotationConverter" name="RandomFocus" input_format = "xyz" output_format = "matrix" />
<connection sourcemodule = "RandomFocusZ" source = "OUTPUT" targetmodule = "RandomFocus" target = "INPUT" />
<connection sourcemodule = "RandomFocusY" source = "OUTPUT" targetmodule = "RandomFocus" target = "INPUT" />
<connection sourcemodule = "RandomFocusX" source = "OUTPUT" targetmodule = "RandomFocus" target = "INPUT" />
<!-- EXO -->
<module class = "Arbiter" name = "HighLevelFocusArbiter" no_of_inputs = "6"/>
<!-- ManualFocusPoint -->
<connection sourcemodule = "ManFocusPoint" source = "OUTPUT" targetmodule = "HighLevelFocusArbiter" target = "INPUT_1" />
<connection sourcemodule = "ManFocusPointValue" source = "OUTPUT" targetmodule = "HighLevelFocusArbiter" target = "VALUE_1" />
<!-- MarkerTracker (Left) -->
<connection sourcemodule = "Detectors" source = "L_MARKER_EGO" targetmodule = "HighLevelFocusArbiter" target = "INPUT_2" /> <!-- Should be EXO -->
<connection sourcemodule = "MarkerTrackerValue" source = "OUTPUT" targetmodule = "HighLevelFocusArbiter" target = "VALUE_2" />
<!-- ChangeDetector (Left) -->
<connection sourcemodule = "Detectors" source = "L_CHANGE_WORLD" targetmodule = "HighLevelFocusArbiter" target = "INPUT_3" />
<connection sourcemodule = "ChangeSubtractV" source = "OUTPUT" targetmodule = "HighLevelFocusArbiter" target = "VALUE_3" />
<!-- Random Focus points -->
<connection sourcemodule = "RandomFocus" source = "OUTPUT" targetmodule = "HighLevelFocusArbiter" target = "INPUT_4" />
<connection sourcemodule = "RandomFocusPointValue" source = "OUTPUT" targetmodule = "HighLevelFocusArbiter" target = "VALUE_4" />
<!-- FaceDetector (Left) -->
<connection sourcemodule = "Detectors" source = "L_FACE_WORLD" targetmodule = "HighLevelFocusArbiter" target = "INPUT_5" />
<connection sourcemodule = "Detectors" source = "L_FACE_CONF" targetmodule = "HighLevelFocusArbiter" target = "VALUE_5" />
<view name="Focus Point">
<table name = "ManFocusPoint" module="ManFocusPointValue" source = "OUTPUT" min = "-1" max = "1" x="0" y="0" decimals ="5"/>
<table name = "Marker" module="MarkerTrackerValue" source = "OUTPUT" min = "-1" max = "1" x="1" y="0" decimals ="5"/>
<table name = "Change" module="ChangeSubtractV" source = "OUTPUT" min = "-1" max = "1" x="2" y="0" decimals ="5"/>
<table name = "Random" module="RandomFocusPointValue" source = "OUTPUT" min = "-1" max = "1" x="3" y="0" decimals ="5"/>
<table name = "Face" module="Detectors" source = "L_FACE_CONF" min = "-1" max = "1" x="4" y="0" decimals ="5"/>
</view>
<!-- This should be moved to population code and use amplitude instead -->
<module class = "Constant" name = "ManFocusPointValue" data = "0.00001"/>
<module class = "Constant" name = "MarkerTrackerValue" data = "0.00002"/>
<_module class = "Constant" name = "ChangeDetectorValue" data = "0.9"/>
<module class = "Constant" name = "RandomFocusPointValue" data = "0.001"/>
<_module class = "Constant" name = "FaceDetectionValue" data = "0.2"/>
<!-- If the robot is moving. Disable Change detector -->
<module class="Mean" name="MotorSpeed"/>
<connection sourcemodule = "Servos" source = "FEEDBACK_POSITION" targetmodule = "MotorSpeed" target = "INPUT" />
<module class = "Threshold" name = "MotorSpeedT" type = "binary" threshold = "0.1" />
<connection sourcemodule = "MotorSpeed" source = "OUTPUT" targetmodule = "MotorSpeedT" target = "INPUT" />
<module class = "Subtract" name = "ChangeSubtractV"/>
<connection sourcemodule = "Detectors" source = "L_CHANGE_CONF" targetmodule = "ChangeSubtractV" target = "INPUT1" />
<connection sourcemodule = "MotorSpeedT" source = "OUTPUT" targetmodule = "ChangeSubtractV" target = "INPUT2" />
<!-- ************************ -->
<!-- Motor control -->
<!-- ********************************* -->
<!-- ********************************* -->
<!-- ********************************* -->
<!-- Servo paramters Format -->
<!-- BodyAngle1 -->
<!-- NeckTilt NeckPan LeftEye RightEye -->
<!-- LeftArm1 LeftArm2 LeftArm3 LeftArm4 LeftArm5 LeftHand -->
<!-- RightArm1 RightArm2 RightArm3 RightArm4 RightArm5 RightHand -->
<!-- LeftPupil RightPupil -->
<!-- External Motor control -->
<input name = "SERVO_ANGLES" targetmodule = "EXT_SERVO_ANGLE" target = "INPUT"/>
<input name = "SERVO_ANGLES_AMPLITUDE" targetmodule = "EXT_SERVO_ANGLE_A" target = "INPUT"/>
<!-- Dummy module -->
<module class = "Gate" name = "EXT_SERVO_ANGLE"/>
<module class = "Gate" name = "EXT_SERVO_ANGLE_A"/>
<module class = "PopulationCoder" name = "ExtServoAngleCode" min = "-400" max = "400" size = "@nrServosTotal"/>
<connection sourcemodule = "EXT_SERVO_ANGLE" source = "OUTPUT" targetmodule = "ExtServoAngleCode" target = "INPUT" />
<connection sourcemodule = "EXT_SERVO_ANGLE_A" source = "OUTPUT" targetmodule = "ExtServoAngleCode" target = "AMPLITUDE" />
<!-- Internal Motor control -->
<module class = "Constant" name = "INT_SERVO_ANGLE" data = "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 10 10" />
<module class = "Constant" name = "INT_SERVO_ANGLE_A" data = "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0" />
<module class = "PopulationCoder" name = "IntServoAngleCode" min = "-400" max = "400" size = "@nrServosTotal"/>
<connection sourcemodule = "INT_SERVO_ANGLE" source = "OUTPUT" targetmodule = "IntServoAngleCode" target = "INPUT" />
<connection sourcemodule = "INT_SERVO_ANGLE_A" source = "OUTPUT" targetmodule = "IntServoAngleCode" target = "AMPLITUDE" />
<view name="Manual Control" color="red, green, green, green, green, blue, blue, blue, blue, blue, blue, yellow, yellow, yellow, yellow, yellow, yellow, pink, pink">
<slider-horizontal title="Internal Amplitude" label="Servo Angles" module="INT_SERVO_ANGLE_A" parameter="data" count="20" x="10" y="50" width="150" height="450" show_title = "true" show_value = "true"/>
<slider-horizontal title="Internal Angles" label="Servo Angles" module="INT_SERVO_ANGLE" parameter="data" count="20" x="180" y="50" width="300" height="450" show_title = "true" min = "-180" max ="180" step ="5" labels = "BodyAngle1,NeckTilt,NeckPan,LeftEye,RightEye,LeftArm1,LeftArm2,LeftArm3,LeftArm4,LeftArm5,LeftHand,RightArm1,RightArm2,RightArm3,RightArm4,RightArm5,RightHand,LeftPupil,RightPupil" show_value = "true"/>
<text text="External Manual Control" x="500" y="50" width="300" height="100"/>
<table title="External Manual" module="EXT_SERVO_ANGLE" source="OUTPUT" x="500" y="100" width="1200" height="50" color="red, green, green, green, green, blue, blue, blue, blue, blue, blue, yellow, yellow, yellow, yellow, yellow, yellow, pink, pink" decimals="2"/>
<table title="Amplitude" module="EXT_SERVO_ANGLE_A" source="OUTPUT" x="500" y="150" width="1200" height="200" color="red, green, green, green, green, blue, blue, blue, blue, blue, blue, yellow, yellow, yellow, yellow, yellow, yellow, pink, pink" decimals="2"/>
<text text="Internal Manual Control" x="500" y="200" width="300" height="100"/>
<table title="External Manual" module="INT_SERVO_ANGLE" source="OUTPUT" x="500" y="250" width="1200" height="50" color="red, green, green, green, green, blue, blue, blue, blue, blue, blue, yellow, yellow, yellow, yellow, yellow, yellow, pink, pink" decimals="2"/>
<table title="Amplitude" module="INT_SERVO_ANGLE_A" source="OUTPUT" x="500" y="300" width="1200" height="200" color="red, green, green, green, green, blue, blue, blue, blue, blue, blue, yellow, yellow, yellow, yellow, yellow, yellow, pink, pink" decimals="0"/>
<text text="Output to servos" x="500" y="400" width="300" height="50"/>
<table title="Low level motor arbiter" module="GOAL_POSITION" source="OUTPUT" x="500" y="450" width="1200" height="300" decimals="0" color="red, green, green, green, green, blue, blue, blue, blue, blue, blue, yellow, yellow, yellow, yellow, yellow, yellow, pink, pink" />
<text text="Feedback from servos" x="500" y="500" width="300" height="50"/>
<table title="Feedback" module="Servos" source="FEEDBACK_POSITION" x="500" y="550" width="1200" height="300"decimals="1" color="red, green, green, green, green, blue, blue, blue, blue, blue, blue, yellow, yellow, yellow, yellow, yellow, yellow, pink, pink" />
</view>
<!-- This needs to be taken cared of sometime -->
<module class = "Constant" name = "SERVO_SPEED" data = "0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5" />
<module class = "Constant" name = "SERVO_TORQUE_LIMIT" data = " 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5" />
<module class = "Constant" name = "SERVO_TORQUE_ENABLE" data = " 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0" />
<!-- Motion recorder -->
<!-- ************************ -->
<!-- ************************ -->
<module class = "Constant" name = "RecordServo" data = "0 0 0 3 3 0 0 0 0 0 3 0 0 0 0 0 3 3 3" />
<connection sourcemodule = "RecordServo" source = "OUTPUT" targetmodule = "MotionRecorder" target = "MODE" />
<module
class = "MotionRecorder"
name = "MotionRecorder"
torque = "0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5"
filename = "motion.%d.mot"
smoothing_time = "10"
max_behaviors="100"
/>
<connection sourcemodule = "Servos" source = "FEEDBACK_POSITION" targetmodule = "MotionRecorder" target = "INPUT" />
<connection sourcemodule = "MotionRecorder" source = "ENABLE" targetmodule = "Servos" target = "TORQUE_ENABLE" />
<view name="Motion Recorder View">
<grid
x = "10"
y = "10"
width = "121"
height = "41"
source = "STATE"
module = "MotionRecorder"
class = "grid"
max = "7"
labels = "state"
labelWidth = "50"
fill = "custom"
colorTable = "yellow, black, red, green, purple, brownn, pink, maroon"
lineWidth = "1"
shape = "circle"
size = "1"
scales = "no"
/>
<grid
width = "121"
height = "41"
x="10"
y = "40"
source = "PLAYING"
module = "MotionRecorder"
class = "grid"
max = "1"
labels = "play"
labelWidth = "50"
fill = "custom"
colorTable = "white, red, green"
lineWidth = "1"
shape = "circle"
size = "1"
scales = "no"
/>
<plot module="MotionRecorder" source="OUTPUT" min="-360" max="360" color="red" select="0, 1" x="130" y="0" width="800" height="501" />
<bar-graph module="MotionRecorder" source="ENABLE" x="130" y="531" width="800" height="201" />
<table title="time" module="MotionRecorder" source="TIME" decimals="0" x="10" y="81" width="101" height="41" />
<button label = "Off" module="MotionRecorder" parameter="off" x="10" y="121" height="41" width="101" />
<button label = "Stop" module="MotionRecorder" parameter="stop" x="10" y="161" height="41" width="101" />
<button label = "Record" module="MotionRecorder" parameter="record" x="10" y="201" height="41" width="101" />
<button label = "Play" module="MotionRecorder" parameter="play" x="10" y="241" height="41" width="101" />
<button label = "Load" module="MotionRecorder" parameter="load" x="10" y="361" height="41" width="101" />
<button label = "Save" module="MotionRecorder" parameter="save" x="10" y="401" height="41" width="101" />
<drop-down-menu
title="motion"
list="cratch left crotch, scratch right hand, scratch right wrist, scratch right torso, scratch right chin, scratch right ear, scratch right eye, scratch right head back A, scratch right head back B, idle left -2 A, idle left -2 B, idle left -2 B, idle left -1 A, idle left -1 B, idle left -1 C, idle center 0 A, idle center 0 B, idle center 0 C, idle right +1 A, idle right +1 B, idle right +1 C, idle right +2 A, idle right +2 B, idle right +2 C,
look at hand left A, look at hand left B, look at hand left C, look at hand left D, look at hand left E,
look at hand right A, look at hand right B, look at hand right C, look at hand right D,look at hand right E,
look at table left -2, look at table left -1, look at table center 0, look at table right +1, look at table right +2,
look at child left -2, look at child left -1, look at child center 0, look at child right +1, look at child right +2,
look at EpiBlue A, look at EpiBlue B, look at EpiBlue C, look at Jetson A, look at Jetson B,
Clap hands A, Clap hands B, Clap hands C, Drop head A, Drop head B, Drop head C,
Wave left -2, Wave left -1, Wave center 0, Wave right +1, Wave right +2,
Reach left -2, Reach left -1, Reach center 0, Reach right +1, Reach right +2,
Peekaboo A, Peekaboo B, Peekaboo C,
Large movement A, Large movement B, Large movement C, Large movement D, Large movement E"
module="MotionRecorder" parameter="current_behavior" x="10" y="311" width="121" height="41" />
<switch label=" Rec on trig" module="MotionRecorder" parameter="record_on_trig" x="10" y="461" width="101" height="41" />
</view>
<module class = "Constant" name = "MotionRecPopAmplitude" data = "100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100" />
<module class = "PopulationCoder" name = "MotionRecPop" min = "-400" max = "400" size = "@nrServosTotal"/>
<connection sourcemodule = "MotionRecorder" source = "OUTPUT" targetmodule = "MotionRecPop" target = "INPUT" />
<connection sourcemodule = "MotionRecPopAmplitude" source = "OUTPUT" targetmodule = "MotionRecPop" target = "AMPLITUDE"/>
<!-- set torqueEnable to zero when recording -->
<!-- Head/Eyes to FocusPoint -->
<!-- ************************ -->
<!-- ************************ -->
<module class = "GazeController" name = "HLGazeCont" offset = "0 0 0 0" angle_unit = "degrees" A = "0.09" B = "0.011" C = "0.03" E ="0.04"/>
<!-- Focus point in -->
<_connection sourcemodule = "HighLevelFocusArbiter" source = "OUTPUT" targetmodule = "HLGazeCont" target = "INPUT"/>
<connection sourcemodule = "GazeControllFocusPoint" source = "MATRIX" targetmodule = "HLGazeCont" target = "INPUT"/>
<!-- Only one focus point -->
<!-- Multiply -->
<!-- Using trasform (inverse) -->
<module class="Transform" name="GazeControllFocusPoint" invert_1 ="true"/>
<connection sourcemodule = "HighLevelFocusArbiter" source = "OUTPUT" targetmodule = "GazeControllFocusPoint" target = "MATRIX_2" delay = "0"/>
<connection sourcemodule = "ExoID" source = "OUTPUT" targetmodule = "GazeControllFocusPoint" target = "OBJECT_ID_2" delay = "0"/>
<connection sourcemodule = "ExoID" source = "OUTPUT" targetmodule = "GazeControllFocusPoint" target = "FRAME_ID_2" delay = "0"/>
<connection sourcemodule = "Epi" source = "MATRIX" targetmodule = "GazeControllFocusPoint" target = "MATRIX_1" delay = "0"/>
<connection sourcemodule = "ExoID" source = "OUTPUT" targetmodule = "GazeControllFocusPoint" target = "OBJECT_ID_1" delay = "0"/>
<connection sourcemodule = "ExoID" source = "OUTPUT" targetmodule = "GazeControllFocusPoint" target = "FRAME_ID_1" delay = "0"/>
<view name="Check position">
<table title = "HighLevelFocusArbiter" module="HighLevelFocusArbiter" source = "OUTPUT" w = "4" h="1" x="0" y="0" />
<table title = "Epi" module="Epi" source = "MATRIX" w = "4" h="1" x="0" y="1" />
<table title = "GazeControllFocusPoint" module="GazeControllFocusPoint" source = "MATRIX" w = "4" h="1" x="0" y="2" />
</view>
<module class = "Constant" name = "GazePosPopAmplitude" data = "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0" />
<!-- Population coding -->
<module class = "PopulationCoder" name = "GazePosPop" min = "-400" max = "400" size = "@nrServosTotal"/>
<!-- This will be handle in LLArbiter with mixing is enable -->
<connection sourcemodule="AddP" source="OUTPUT" targetmodule="GazePosPop" target="INPUT" />
<connection sourcemodule="AddP" source="OUTPUT" targetmodule="GazePosPop" target="INPUT" />
<connection sourcemodule="AZeros" source="OUTPUT" targetmodule="GazePosPop" target="INPUT" />
<connection sourcemodule="AZeros" source="OUTPUT" targetmodule="GazePosPop" target="INPUT" />
<connection sourcemodule="HLGazeCont" source="OUTPUT" targetmodule="GazePosPop" target="INPUT" />
<connection sourcemodule="BZeros" source="OUTPUT" targetmodule="GazePosPop" target="INPUT" />
<connection sourcemodule="GazePosPopAmplitude" source="OUTPUT" targetmodule="GazePosPop" target="AMPLITUDE" />
<!-- ************************ -->
<!-- HIGH LEVEL -->
<!-- ********************************* -->
<!-- ********************************* -->
<!-- ********************************* -->
<module class = "Arbiter" name = "HighLevelMotorArbiter" no_of_inputs = "4"/>
<connection sourcemodule = "ExtServoAngleCode" source = "OUTPUT" targetmodule = "HighLevelMotorArbiter" target = "INPUT_1"/>
<connection sourcemodule = "IntServoAngleCode" source = "OUTPUT" targetmodule = "HighLevelMotorArbiter" target = "INPUT_2"/>
<connection sourcemodule = "GazePosPop" source = "OUTPUT" targetmodule = "HighLevelMotorArbiter" target = "INPUT_3"/>
<connection sourcemodule = "MotionRecPop" source = "OUTPUT" targetmodule = "HighLevelMotorArbiter" target = "INPUT_4"/>
<!-- LOW LEVEL -->
<!-- ********************************* -->
<!-- ********************************* -->
<!-- ********************************* -->
<!-- Sensors -->
<module class = "EpiVision" name = "Vision" />
<!-- Detectors -->
<module class = "EpiDetectors" name = "Detectors" />
<connection sourcemodule = "Vision" source = "LEFT_RED" targetmodule = "Detectors" target = "LEFT_RED" />
<connection sourcemodule = "Vision" source = "LEFT_GREEN" targetmodule = "Detectors" target = "LEFT_GREEN" />
<connection sourcemodule = "Vision" source = "LEFT_BLUE" targetmodule = "Detectors" target = "LEFT_BLUE" />
<connection sourcemodule = "Vision" source = "LEFT_INTENSITY" targetmodule = "Detectors" target = "LEFT_INTENSITY" />
<connection sourcemodule = "Vision" source = "RIGHT_RED" targetmodule = "Detectors" target = "RIGHT_RED" />
<connection sourcemodule = "Vision" source = "RIGHT_GREEN" targetmodule = "Detectors" target = "RIGHT_GREEN" />
<connection sourcemodule = "Vision" source = "RIGHT_BLUE" targetmodule = "Detectors" target = "RIGHT_BLUE" />
<connection sourcemodule = "Vision" source = "RIGHT_INTENSITY" targetmodule = "Detectors" target = "RIGHT_INTENSITY" />
<connection sourcemodule = "EgoID" source = "OUTPUT" targetmodule = "Detectors" target = "EGO_ID" />
<connection sourcemodule = "EgoFrameID" source = "OUTPUT" targetmodule = "Detectors" target = "EGO_FRAME_ID" />
<connection sourcemodule = "ExoID" source = "OUTPUT" targetmodule = "Detectors" target = "WORLD_ID" />
<connection sourcemodule = "ExoFrameID" source = "OUTPUT" targetmodule = "Detectors" target = "WORLD_FRAME_ID" />
<connection sourcemodule = "ForwardModel" source = "SENSOR_POS_EGO" targetmodule = "Detectors" target = "SENSORS_POS_EGO" />
<connection sourcemodule = "Epi" source = "MATRIX" targetmodule = "Detectors" target = "EPI_POS_WORLD" />
<!-- Actuators/Proprioception -->
<module class = "EpiServos" name = "Servos" />
<connection sourcemodule = "GOAL_POSITION" source = "OUTPUT" targetmodule = "Servos" target = "GOAL_POSITION" />
<connection sourcemodule = "SERVO_SPEED" source = "OUTPUT" targetmodule = "Servos" target = "MOVING_SPEED" />
<connection sourcemodule = "SERVO_TORQUE_LIMIT" source = "OUTPUT" targetmodule = "Servos" target = "TORQUE_LIMIT" />
<!-- Done by motion recorder -->
<_connection sourcemodule = "SERVO_TORQUE_ENABLE" source = "OUTPUT" targetmodule = "Servos" target = "TORQUE_ENABLE" />
<!-- This can be cleaned up now when we have include and variables -->
<module class = "ForwardModel/EpiForwardModel" name = "ForwardModel" />
<connection sourcemodule = "Servos" source = "FEEDBACK_POSITION" targetmodule = "ForwardModel" target = "BODY_FEEDBACK_POSITION" targetoffset = "@servosIndexBody" size = "@nrServosBody" />
<connection sourcemodule = "Servos" source = "FEEDBACK_POSITION" targetmodule = "ForwardModel" target = "HEAD_FEEDBACK_POSITION" targetoffset = "@servosIndexHead" size = "@nrServosHead" />
<connection sourcemodule = "Servos" source = "FEEDBACK_POSITION" targetmodule = "ForwardModel" target = "LEFT_ARM_FEEDBACK_POSITION" targetoffset = "@servosIndexLeftArm" size = "@nrServosLeftArm"/>
<connection sourcemodule = "Servos" source = "FEEDBACK_POSITION" targetmodule = "ForwardModel" target = "RIGHT_ARM_FEEDBACK_POSITION" targetoffset = "@servosIndexRightArm" size = "@nrServosRightArm"/>
<connection sourcemodule = "Servos" source = "FEEDBACK_POSITION" targetmodule = "ForwardModel" target = "PUPIL_FEEDBACK_POSITION" targetoffset = "@servosIndexPupil" size = "@nrServosPupil"/> ´
<!-- Behaviors -->
<!-- Light reflex etc -->
<module class="PupilControl" name="PupilControl"/>
<connection sourcemodule="Vision" source="LEFT_INTENSITY" targetmodule="PupilControl" target="PTA" />
<view name="Pupil">
<image title="Input" module="Vision" source="LEFT_INTENSITY" x="4" y="0" w="4" h="4" />
<plot title="Response Light" module="PupilControl" source="PTA_OUTPUT" x="0" y="0" w="4" />
<plot title="Response CG (Constriction)" module="PupilControl" source="CG_OUTPUT" x="0" y="1" w="4" min = "5" max="17" />
<plot title="Response SCG (Dilation)" module="PupilControl" source="SCG_OUTPUT" x="0" y="2" w="4" min = "5" max="17" />
</view>
<module class = "Constant" name = "PupilContAmplitudeAmplitude" data = "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0" />
<!-- Population coding -->
<module class = "PopulationCoder" name = "PupilContPop" min = "-400" max = "400" size = "@nrServosTotal"/>
<connection sourcemodule="PupilControl" source="CG_OUTPUT" targetmodule="PupilContPop" target="INPUT" />
<connection sourcemodule="PupilControl" source="CG_OUTPUT" targetmodule="PupilContPop" target="INPUT" />
<connection sourcemodule="AZeros" source="OUTPUT" targetmodule="PupilContPop" target="INPUT" />
<connection sourcemodule="AZeros" source="OUTPUT" targetmodule="PupilContPop" target="INPUT" />
<connection sourcemodule="HZeros" source="OUTPUT" targetmodule="PupilContPop" target="INPUT" />
<connection sourcemodule="BZeros" source="OUTPUT" targetmodule="PupilContPop" target="INPUT" />
<connection sourcemodule="PupilContAmplitudeAmplitude" source="OUTPUT" targetmodule="PupilContPop" target="AMPLITUDE" />
<!-- Special pupil behavior -->
<!-- Large pupil when looking at a face -->
<module class = "Threshold" name = "FaceDetected" type = "binary" threshold = "0.005" />
<connection sourcemodule="Detectors" source="L_FACE_IN_CENTER" targetmodule="FaceDetected" target="INPUT" />
<module class = "Constant" name = "ConstantPInv" outputsize = "1" data="1" />
<module class = "Subtract" name = "SubInv"/>
<connection sourcemodule="ConstantPInv" source="OUTPUT" targetmodule="SubInv" target="INPUT1" />
<connection sourcemodule="FaceDetected" source="OUTPUT" targetmodule="SubInv" target="INPUT2" />
<module
class = "SpectralTiming"
name = "SpectralTiming"
no_of_taps = "6"
decay ="0.9"
/>
<connection sourcemodule="FaceDetected" source="OUTPUT" targetmodule="SpectralTiming" target="INPUT" />
<module class = "Constant" name = "ConstantP" outputsize = "1" data="6" />
<module
class = "Multiply"
name = "MultiplyP"
/>
<connection sourcemodule="SpectralTiming" source="TRACE" targetmodule="MultiplyP" target="INPUT1" />
<connection sourcemodule="ConstantP" source="OUTPUT" targetmodule="MultiplyP" target="INPUT2" />
<module class = "Constant" name = "ConstantPOffset" outputsize = "1" data="12" />
<module class = "Add" name = "AddP"/>
<connection sourcemodule="MultiplyP" source="OUTPUT" targetmodule="AddP" target="INPUT1" />
<connection sourcemodule="ConstantPOffset" source="OUTPUT" targetmodule="AddP" target="INPUT2" />
<view name="View">
<plot module="FaceDetected" source="OUTPUT" max="1" colors="yellow" x="0" y="0" w="4" />
<plot module="SpectralTiming" source="TRACE" max="1" colors="yellow" x="0" y="1" w="4" />
<plot module="MultiplyP" source="OUTPUT" max="20" colors="yellow" x="0" y="2" w="4" />
<plot module="AddP" source="OUTPUT" max="20" colors="yellow" x="0" y="3" w="4" />
</view>
<!-- Low Level Motion mixer -->
<!-- ************************ -->
<!-- ************************ -->
<module class = "Arbiter" name = "LowLevelArbiter" no_of_inputs = "2"/>
<connection sourcemodule = "HighLevelMotorArbiter" source = "OUTPUT" targetmodule = "LowLevelArbiter" target = "INPUT_1" />
<connection sourcemodule = "PupilContPop" source = "OUTPUT" targetmodule = "LowLevelArbiter" target = "INPUT_2" />
<!-- Popalation decoder -->
<module class = "PopulationDecoder" name = "GOAL_POSITION" min = "-400" max = "400" size = "@nrServosTotal"/>
<connection sourcemodule = "LowLevelArbiter" source = "OUTPUT" targetmodule = "GOAL_POSITION" target = "INPUT" />
<!-- LAB -->
<!-- Table -->
<!-- <module class = "Constant" name = "TablePos" _data = "1 0 0 0.85; 0 1 0 0.60; 0 0 1 0; 0 0 0 1;"
data = "
1 0 0 0.85;
0 1 0 0.6;
0 0 1 0;
0 0 0 1;"/>
<module class = "Constant" name = "TableID" data = "10000"/>
<module class = "DataConverter" name = "ModelMatrixTab" output_size_x = "16" output_size_y = "10"/>
<connection sourcemodule = "TablePos" source = "OUTPUT" targetmodule = "ModelMatrixTab" target = "INPUT" />
<connection sourcemodule = "EGOToEXO" source = "MATRIX" targetmodule = "ModelMatrixTab" target = "INPUT" />
<module class = "DataConverter" name = "ModelIDTab" output_size_x = "10" output_size_y = "1"/>
<connection sourcemodule = "TableID" source = "OUTPUT" targetmodule = "ModelIDTab" target = "INPUT" />
<connection sourcemodule = "ForwardModel" source = "MODEL_ID" targetmodule = "ModelIDTab" target = "INPUT" />
<module class = "Constant" name = "FocusPointID" data = "203"/> -->
<!-- Coordinate must be converted to exocentric coordinate system before adding to list -->
<!-- <module class="Transform" name="EGOToEXO"/>
<connection sourcemodule = "Epi" source = "MATRIX" targetmodule = "EGOToEXO" target = "MATRIX_1" delay = "0"/>
<connection sourcemodule = "EgoID" source = "OUTPUT" targetmodule = "EGOToEXO" target = "OBJECT_ID_1" delay = "0"/>
<connection sourcemodule = "ExoID" source = "OUTPUT" targetmodule = "EGOToEXO" target = "FRAME_ID_1" delay = "0"/>
<connection sourcemodule = "ForwardModel" source = "MODEL_MATRIX" targetmodule = "EGOToEXO" target = "MATRIX_2" delay = "0"/>
<connection sourcemodule = "ForwardModel" source = "OBJECT_ID" targetmodule = "EGOToEXO" target = "OBJECT_ID_2" delay = "0"/>
<connection sourcemodule = "ForwardModel" source = "FRAME_ID" targetmodule = "EGOToEXO" target = "FRAME_ID_2" delay = "0"/> -->
<!-- Adding FocusPoint to 3D view -->
<!-- <module class = "DataConverter" name = "ModelMatrix" output_size_x = "16" output_size_y = "11"/>
<connection sourcemodule = "HighLevelFocusArbiter" source = "OUTPUT" targetmodule = "ModelMatrix" target = "INPUT" />
<connection sourcemodule = "ModelMatrixTab" source = "OUTPUT" targetmodule = "ModelMatrix" target = "INPUT" />
<module class = "DataConverter" name = "ModelID" output_size_x = "11" output_size_y = "1"/>
<connection sourcemodule = "FocusPointID" source = "OUTPUT" targetmodule = "ModelID" target = "INPUT" />
<connection sourcemodule = "ModelIDTab" source = "OUTPUT" targetmodule = "ModelID" target = "INPUT" /> -->
<!-- Sound -->
<module
class = "SoundOutput"
name = "SoundOutput"
sounds = "Sounds/ok2.mp3"
command = "mpg123"
/>
<!-- Connected to a button -->
<connection sourcemodule = "SoundTrigger" source = "OUTPUT" targetmodule = "SoundOutput" target = "INPUT" />
<module class = "Constant" name = "SoundTrigger" data = "0" />
<view name="Sound">
<object class="Button" module="SoundTrigger" parameter="data" x="0" y="0" />
</view>
<?include file="EpiLed.ikc" ?>
<!-- Misc -->
<!-- ********************************* -->
<!-- ********************************* -->
<!-- ********************************* -->
<!-- EXO: 100 -->
<!-- EPI/EGO: 200 -->
<!-- SENSOR: 300 -->
<!-- Id and frames used by transfromers modules -->
<module class = "Constant" name = "ExoID" data = "100"/>
<module class = "Constant" name = "ExoFrameID" data = "100"/>
<module class = "Constant" name = "EgoID" data = "200"/>
<module class = "Constant" name = "EgoFrameID" data = "200"/>
<!-- Used when adding different parts. See GazeController -->
<module class = "Constant" name = "AZeros" data = "0 0 0 0 0 0"/>
<module class = "Constant" name = "BZeros" data = "0"/>
<module class = "Constant" name = "HZeros" data = "0 0 0 0"/>
<module class = "Constant" name = "PZeros" data = "0 0"/>
<view name="3D View">
<canvas3d
x="10" y="10"
width="1000"
height="600"
title="Triangles"
model_mat_module = "MODEL_MATRIX"
model_mat_source = "OUTPUT"
model_id_module = "MODEL_ID"
model_id_source = "OUTPUT"
/>
</view>
</group>