-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDoNarovnanéPozice.py
31 lines (27 loc) · 1011 Bytes
/
DoNarovnanéPozice.py
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
class MyClass(GeneratedClass):
def __init__(self):
try: # disable autoBind
GeneratedClass.__init__(self, False)
except TypeError: # if NAOqi < 1.14
GeneratedClass.__init__( self )
def onLoad(self):
self.postureProxy = None
try:
self.postureProxy = ALProxy("ALRobotPosture")
except:
self.logger.error("Module 'ALRobotPosture' not found.")
def onUnload(self):
if(self.postureProxy != None):
self.postureProxy.stopMove()
def onInput_onStart(self):
if(self.postureProxy != None):
result = self.postureProxy.goToPosture("StandInit", 0.8)
if(result):
self.success()
else:
self.logger.error("Posture StandInit is not a part of the standard posture library or robot cannot reach the posture")
self.failure()
else:
self.failure()
def onInput_onStop(self):
self.onUnload()