You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<?xml version="1.0" encoding="UTF-8" ?><ChoregrapheProject xmlns="http://www.aldebaran-robotics.com/schema/choregraphe/project.xsd" xar_version="3"><Box name="root" id="-1" localization="8" tooltip="Root box of Choregraphe's behavior. Highest level possible." x="0" y="0"><bitmap>media/images/box/root.png</bitmap><script language="4"><content><![CDATA[]]></content></script><Input name="onLoad" type="1" type_size="1" nature="0" inner="1" tooltip="Signal sent when diagram is loaded." id="1" /><Input name="onStart" type="1" type_size="1" nature="2" inner="0" tooltip="Box behavior starts when a signal is received on this input." id="2" /><Input name="onStop" type="1" type_size="1" nature="3" inner="0" tooltip="Box behavior stops when a signal is received on this input." id="3" /><Output name="onStopped" type="1" type_size="1" nature="1" inner="0" tooltip="Signal sent when box behavior is finished." id="4" /><Timeline enable="0"><BehaviorLayer name="behavior_layer1"><BehaviorKeyframe name="keyframe1" index="1"><Diagram><Box name="ChangeValue" id="1" localization="8" tooltip="" x="150" y="52"><bitmap>media/images/box/box-python-script.png</bitmap><script language="4"><content><![CDATA[class MyClass(GeneratedClass):
2
+
def __init__(self):
3
+
GeneratedClass.__init__(self)
4
+
5
+
def onLoad(self):
6
+
#put initialization code here
7
+
pass
8
+
9
+
def onUnload(self):
10
+
#put clean-up code here
11
+
pass
12
+
13
+
def onInput_onStart(self):
14
+
global myValue
15
+
myValue=100
16
+
17
+
18
+
def onInput_onStop(self):
19
+
self.onUnload() #it is recommended to reuse the clean-up as the box is stopped
20
+
self.onStopped() #activate the output of the box]]></content></script><Inputname="onLoad"type="1"type_size="1"nature="0"inner="1"tooltip="Signal sent when diagram is loaded."id="1" /><Inputname="onStart"type="1"type_size="1"nature="2"inner="0"tooltip="Box behavior starts when a signal is received on this input."id="2" /><Inputname="onStop"type="1"type_size="1"nature="3"inner="0"tooltip="Box behavior stops when a signal is received on this input."id="3" /><Outputname="onStopped"type="1"type_size="1"nature="1"inner="0"tooltip="Signal sent when box behavior is finished."id="4" /></Box><Boxname="GetValue"id="2"localization="8"tooltip=""x="368"y="84"><bitmap>media/images/box/box-python-script.png</bitmap><scriptlanguage="4"><content><![CDATA[class MyClass(GeneratedClass):
21
+
def __init__(self):
22
+
GeneratedClass.__init__(self)
23
+
24
+
def onLoad(self):
25
+
#put initialization code here
26
+
pass
27
+
28
+
def onUnload(self):
29
+
#put clean-up code here
30
+
pass
31
+
32
+
def onInput_onStart(self):
33
+
global myValue
34
+
35
+
if myValue == 100:
36
+
pass
37
+
else:
38
+
pass
39
+
40
+
def onInput_onStop(self):
41
+
self.onUnload() #it is recommended to reuse the clean-up as the box is stopped
42
+
self.onStopped() #activate the output of the box]]></content></script><Inputname="onLoad"type="1"type_size="1"nature="0"inner="1"tooltip="Signal sent when diagram is loaded."id="1" /><Inputname="onStart"type="1"type_size="1"nature="2"inner="0"tooltip="Box behavior starts when a signal is received on this input."id="2" /><Inputname="onStop"type="1"type_size="1"nature="3"inner="0"tooltip="Box behavior stops when a signal is received on this input."id="3" /><Outputname="onStopped"type="1"type_size="1"nature="1"inner="0"tooltip="Signal sent when box behavior is finished."id="4" /></Box></Diagram></BehaviorKeyframe></BehaviorLayer></Timeline></Box></ChoregrapheProject>
0 commit comments