本文整理匯總了Python中roslib.load_manifest方法的典型用法代碼示例。如果您正苦於以下問題:Python roslib.load_manifest方法的具體用法?Python roslib.load_manifest怎麽用?Python roslib.load_manifest使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類roslib
的用法示例。
在下文中一共展示了roslib.load_manifest方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: run
# 需要導入模塊: import roslib [as 別名]
# 或者: from roslib import load_manifest [as 別名]
def run(self):
self.topic_type = wait_topic_ready(self.topic_name, self.url)
#print str(self.topic_type)+" self.topic_type"
if not self.topic_type:
rospy.logerr('Type of topic %s are not equal in the remote and local sides', self.topic_name)
return
topic_type_module, topic_type_name = tuple(self.topic_type.split('/'))
try:
roslib.load_manifest(topic_type_module)
msg_module = import_module(topic_type_module + '.msg')
self.rostype = getattr(msg_module, topic_type_name)
if self.test:
self.publisher = rospy.Publisher(self.topic_name + '_rb', self.rostype, queue_size = self.queue_size)
else:
self.publisher = rospy.Publisher(self.topic_name, self.rostype, queue_size = self.queue_size)
self.ws = websocket.WebSocketApp(self.url, on_message = self.on_message, on_error = self.on_error, on_close = self.on_close, on_open = self.on_open)
rospy.loginfo('Create connection to Rosbridge server %s for subscribed topic %s successfully', self.url, self.topic_name)
self.ws.run_forever()
except ResourceNotFound, e:
rospy.logerr('Proxy for subscribed topic %s init falied. Reason: Could not find the required resource: %s', self.topic_name, str(e))