mirror of
https://github.com/osrf/gazebo_models.git
synced 2025-09-15 12:58:56 +08:00
Updating the model database server
This commit is contained in:
parent
482b65f16c
commit
8160b65e6c
@ -1,7 +1,22 @@
|
|||||||
<?xml version="1.0" ?>
|
<?xml version="1.0" ?>
|
||||||
<models>
|
<models>
|
||||||
<model>turtlebot</model>
|
<model>
|
||||||
<model>willowgarage</model>
|
<name>Turtle Bot</name>
|
||||||
<model>kinect</model>
|
<path>turtlebot</path>
|
||||||
<model>pioneer2dx</model>
|
</model>
|
||||||
|
|
||||||
|
<model>
|
||||||
|
<name>Willow Garage</name>
|
||||||
|
<path>willowgarage</path>
|
||||||
|
</model>
|
||||||
|
|
||||||
|
<model>
|
||||||
|
<name>Kinect</name>
|
||||||
|
<path>kinect</path>
|
||||||
|
</model>
|
||||||
|
|
||||||
|
<model>
|
||||||
|
<name>Pioneer2 DX</name>
|
||||||
|
<path>pioneer2dx</path>
|
||||||
|
</model>
|
||||||
</models>
|
</models>
|
||||||
|
|||||||
@ -8,10 +8,10 @@ from xml.dom import minidom
|
|||||||
import request_pb2
|
import request_pb2
|
||||||
|
|
||||||
TCP_IP = '127.0.0.1'
|
TCP_IP = '127.0.0.1'
|
||||||
TCP_PORT = 50199
|
TCP_PORT = 50198
|
||||||
BUFFER_SIZE = 1024
|
BUFFER_SIZE = 1024
|
||||||
|
|
||||||
models = []
|
models = {}
|
||||||
|
|
||||||
#################################################
|
#################################################
|
||||||
# Read the main manifest file
|
# Read the main manifest file
|
||||||
@ -20,10 +20,9 @@ def read_manifest():
|
|||||||
model_list = xmldoc.getElementsByTagName("model")
|
model_list = xmldoc.getElementsByTagName("model")
|
||||||
|
|
||||||
for model in model_list:
|
for model in model_list:
|
||||||
model_name = model.childNodes[0].data
|
model_name = model.getElementsByTagName("name")[0].childNodes[0].data
|
||||||
models.append(model_name)
|
model_path = model.getElementsByTagName("path")[0].childNodes[0].data
|
||||||
|
models[model_name] = model_path
|
||||||
|
|
||||||
|
|
||||||
read_manifest()
|
read_manifest()
|
||||||
|
|
||||||
@ -52,8 +51,8 @@ while 1:
|
|||||||
|
|
||||||
model_list_msg = request_pb2.ModelList()
|
model_list_msg = request_pb2.ModelList()
|
||||||
response.type = model_list_msg.DESCRIPTOR.full_name
|
response.type = model_list_msg.DESCRIPTOR.full_name
|
||||||
for m in models:
|
for key in models:
|
||||||
model_list_msg.model.append(m)
|
model_list_msg.model.append(key)
|
||||||
response.data = model_list_msg.SerializeToString()
|
response.data = model_list_msg.SerializeToString()
|
||||||
|
|
||||||
print "Response Size:", len(response.SerializeToString())
|
print "Response Size:", len(response.SerializeToString())
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user