Revision 3877047d client/python/hlrc_client/RobotAnimation.py
client/python/hlrc_client/RobotAnimation.py | ||
---|---|---|
26 | 26 |
""" |
27 | 27 |
|
28 | 28 |
class RobotAnimation: |
29 |
IDLE = 0
|
|
30 |
HEAD_NOD = 1
|
|
31 |
HEAD_SHAKE = 2
|
|
32 |
EYEBLINK_L = 3
|
|
33 |
EYEBLINK_R = 4
|
|
34 |
EYEBLINK_BOTH = 5
|
|
35 |
EYEBROWS_RAISE = 6
|
|
36 |
EYEBROWS_LOWER = 7
|
|
29 |
IDLE = 0
|
|
30 |
HEAD_NOD = 1
|
|
31 |
HEAD_SHAKE = 2
|
|
32 |
EYEBLINK_L = 3
|
|
33 |
EYEBLINK_R = 4
|
|
34 |
EYEBLINK_BOTH = 5
|
|
35 |
EYEBROWS_RAISE = 6
|
|
36 |
EYEBROWS_LOWER = 7
|
|
37 | 37 |
|
38 |
def __init__(self, v = IDLE):
|
|
39 |
self.value = v
|
|
40 |
self.time_ms = 1000
|
|
41 |
self.repetitions = 1
|
|
42 |
self.scale = 1.0
|
|
38 |
def __init__(self, v = IDLE):
|
|
39 |
self.value = v |
|
40 |
self.time_ms = 1000 |
|
41 |
self.repetitions = 1 |
|
42 |
self.scale = 1.0 |
|
43 | 43 |
|
44 | 44 |
def value_as_str(self): |
45 |
if (self.value == RobotAnimation.IDLE):
|
|
46 |
return "idle"
|
|
47 |
elif (self.value == RobotAnimation.HEAD_NOD):
|
|
48 |
return "head nod"
|
|
49 |
elif (self.value == RobotAnimation.HEAD_SHAKE):
|
|
50 |
return "head shake"
|
|
51 |
elif (self.value == RobotAnimation.EYEBLINK_L):
|
|
52 |
return "eyeblink l"
|
|
53 |
elif (self.value == RobotAnimation.EYEBLINK_R):
|
|
54 |
return "eyeblink r"
|
|
55 |
elif (self.value == RobotAnimation.EYEBROWS_RAISE):
|
|
56 |
return "eyebrows raise"
|
|
57 |
elif (self.value == RobotAnimation.EYEBROWS_LOWER):
|
|
58 |
return "eyebrows lower"
|
|
59 |
else:
|
|
60 |
return "INVALID ANIMATION TYPE"
|
|
61 |
|
|
62 |
def __str__(self): |
|
45 |
if (self.value == RobotAnimation.IDLE):
|
|
46 |
return "idle" |
|
47 |
elif (self.value == RobotAnimation.HEAD_NOD):
|
|
48 |
return "head nod" |
|
49 |
elif (self.value == RobotAnimation.HEAD_SHAKE):
|
|
50 |
return "head shake" |
|
51 |
elif (self.value == RobotAnimation.EYEBLINK_L):
|
|
52 |
return "eyeblink l" |
|
53 |
elif (self.value == RobotAnimation.EYEBLINK_R):
|
|
54 |
return "eyeblink r" |
|
55 |
elif (self.value == RobotAnimation.EYEBROWS_RAISE):
|
|
56 |
return "eyebrows raise" |
|
57 |
elif (self.value == RobotAnimation.EYEBROWS_LOWER):
|
|
58 |
return "eyebrows lower" |
|
59 |
else:
|
|
60 |
return "INVALID ANIMATION TYPE" |
|
61 |
|
|
62 |
def __str__(self):
|
|
63 | 63 |
return "RobotAnimation = { value='%s', time_ms=%d repetitions=%d scale=%6.2f }" % \ |
64 |
(self.value_as_str(), self.time_ms, self.repetitions, self.scale)
|
|
64 |
(self.value_as_str(), self.time_ms, self.repetitions, self.scale)
|
|
65 | 65 |
|
66 | 66 |
|
Also available in: Unified diff