Revision 4f2f4ba3 client/python/hlrc_client/MiddlewareRSB.py
client/python/hlrc_client/MiddlewareRSB.py | ||
---|---|---|
99 | 99 |
rsb_em.emotion = self.convert_emotiontype_to_rsbval(emotion.value) |
100 | 100 |
rsb_em.duration = int(emotion.time_ms) |
101 | 101 |
|
102 |
# with rsb.createRemoteServer(self.base_scope + '/HeadAnimationset') as server:
|
|
102 |
# with rsb.createRemoteServer(self.base_scope + '/{current,default}Emotion') as server:
|
|
103 | 103 |
self.logger.debug("calling the emotion rpc (%s)..." % ("BLOCKING" if blocking else "NON-BLOCKING")) |
104 | 104 |
|
105 | 105 |
if (blocking): |
106 | 106 |
#blocking rpc call: |
107 |
#if (em_type == EmotionExpression.TYPE_DEFAULT):
|
|
108 |
# result = server.defaultEmotion(rsb_em)
|
|
109 |
#else:
|
|
110 |
result = self.server.emotion(rsb_em)
|
|
107 |
if (em_type == EmotionExpression.TYPE_DEFAULT): |
|
108 |
result = self.server.defaultEmotion(rsb_em)
|
|
109 |
else: |
|
110 |
result = self.server.currentEmotion(rsb_em)
|
|
111 | 111 |
self.logger.debug("server reply: '%s'" % result) |
112 | 112 |
else: |
113 |
#if (em_type == EmotionExpression.TYPE_DEFAULT):
|
|
114 |
# future = server.defaultEmotion.async(rsb_em)
|
|
115 |
#else:
|
|
116 |
future = self.server.emotion.async(rsb_em)
|
|
113 |
if (em_type == EmotionExpression.TYPE_DEFAULT): |
|
114 |
future = self.server.defaultEmotion.async(rsb_em)
|
|
115 |
else: |
|
116 |
future = self.server.currentEmotion.async(rsb_em)
|
|
117 | 117 |
self.logger.debug("server reply: '%s'" % future) |
118 | 118 |
#we could block here for a incoming result with a timeout in s |
119 | 119 |
#print '> server reply: "%s"' % future.get(timeout = 10); |
Also available in: Unified diff