Revision 70c54617 client/python/hlrc_client/RobotAnimation.py
| client/python/hlrc_client/RobotAnimation.py | ||
|---|---|---|
| 36 | 36 |
EYEBROWS_LOWER = 7 |
| 37 | 37 |
|
| 38 | 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 |
|
|
| 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): |
|
| 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) |
|
| 39 |
self.value = v |
|
| 40 |
self.time_ms = 1000 |
|
| 41 |
self.repetitions = 1 |
|
| 42 |
self.scale = 1.0 |
|
| 65 | 43 |
|
| 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" |
|
| 66 | 61 |
|
| 62 |
def __str__(self): |
|
| 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) |
|
Also available in: Unified diff