Revision 02fc76ae
| client/python/hlrc_client/Middleware.py | ||
|---|---|---|
| 70 | 70 |
def die_virtual(self, funcname): |
| 71 | 71 |
raise NotImplementedError(funcname + "() is virtual, must be overwritten") |
| 72 | 72 |
|
| 73 |
def is_running(self): |
|
| 74 |
self.die_virtual(sys._getframe().f_code.co_name) |
|
| 75 |
|
|
| 73 | 76 |
def init_middleware(self): |
| 74 | 77 |
self.die_virtual(sys._getframe().f_code.co_name) |
| 75 | 78 |
|
| client/python/hlrc_client/MiddlewareROS.py | ||
|---|---|---|
| 88 | 88 |
|
| 89 | 89 |
self.logger.info("MiddlewareROS initialised")
|
| 90 | 90 |
|
| 91 |
####################################################################### |
|
| 92 |
def is_running(self): |
|
| 93 |
return not rospy.is_shutdown() |
|
| 91 | 94 |
|
| 92 | 95 |
####################################################################### |
| 93 | 96 |
def publish_emotion(self, em_type, emotion, blocking): |
| client/python/hlrc_client/MiddlewareRSB.py | ||
|---|---|---|
| 229 | 229 |
#print '> server reply: "%s"' % future.get(timeout = 10); |
| 230 | 230 |
|
| 231 | 231 |
self.logger.debug("speech rpc done")
|
| 232 |
####################################################################### |
|
| 233 |
def is_running(self): |
|
| 234 |
return True |
|
| 232 | 235 |
|
| 233 | 236 |
####################################################################### |
| 234 | 237 |
# some helpers |
| client/python/hlrc_client/RobotController.py | ||
|---|---|---|
| 79 | 79 |
""" |
| 80 | 80 |
self.logger.debug("destructor of RobotController called")
|
| 81 | 81 |
|
| 82 |
def is_running(self): |
|
| 83 |
return self.middleware.is_running() |
|
| 84 |
|
|
| 82 | 85 |
def config_logger(self, level): |
| 83 | 86 |
"""initialise a nice logger formatting |
| 84 | 87 |
:param level: log level |
| client/python/test.py | ||
|---|---|---|
| 47 | 47 |
m.opening_center = 15.0 |
| 48 | 48 |
r.set_mouth_target(m) |
| 49 | 49 |
|
| 50 |
while(True):
|
|
| 50 |
while(r.is_running()):
|
|
| 51 | 51 |
g.timestamp = time.time() |
| 52 | 52 |
g.pan = g.pan + 5.0; |
| 53 | 53 |
if (g.pan > 20.0): |
| 54 | 54 |
g.pan = -20.0 |
| 55 | 55 |
r.set_gaze_target(g) |
| 56 | 56 |
time.sleep(1) |
| 57 |
#e = RobotAnimation() |
|
| 58 |
#print e |
|
Also available in: Unified diff