_GetMesh.py
Go to the documentation of this file.
00001 """autogenerated by genpy from srs_object_database_msgs/GetMeshRequest.msg. Do not edit."""
00002 import sys
00003 python3 = True if sys.hexversion > 0x03000000 else False
00004 import genpy
00005 import struct
00006 
00007 
00008 class GetMeshRequest(genpy.Message):
00009   _md5sum = "80afe6caba30c992d2e7ff6ff0e0d51e"
00010   _type = "srs_object_database_msgs/GetMeshRequest"
00011   _has_header = False #flag to mark the presence of a Header object
00012   _full_text = """
00013 
00014 
00015 
00016 int32[] model_ids
00017 
00018 
00019 
00020 """
00021   __slots__ = ['model_ids']
00022   _slot_types = ['int32[]']
00023 
00024   def __init__(self, *args, **kwds):
00025     """
00026     Constructor. Any message fields that are implicitly/explicitly
00027     set to None will be assigned a default value. The recommend
00028     use is keyword arguments as this is more robust to future message
00029     changes.  You cannot mix in-order arguments and keyword arguments.
00030 
00031     The available fields are:
00032        model_ids
00033 
00034     :param args: complete set of field values, in .msg order
00035     :param kwds: use keyword arguments corresponding to message field names
00036     to set specific fields.
00037     """
00038     if args or kwds:
00039       super(GetMeshRequest, self).__init__(*args, **kwds)
00040       #message fields cannot be None, assign default values for those that are
00041       if self.model_ids is None:
00042         self.model_ids = []
00043     else:
00044       self.model_ids = []
00045 
00046   def _get_types(self):
00047     """
00048     internal API method
00049     """
00050     return self._slot_types
00051 
00052   def serialize(self, buff):
00053     """
00054     serialize message into buffer
00055     :param buff: buffer, ``StringIO``
00056     """
00057     try:
00058       length = len(self.model_ids)
00059       buff.write(_struct_I.pack(length))
00060       pattern = '<%si'%length
00061       buff.write(struct.pack(pattern, *self.model_ids))
00062     except struct.error as se: self._check_types(se)
00063     except TypeError as te: self._check_types(te)
00064 
00065   def deserialize(self, str):
00066     """
00067     unpack serialized message in str into this message instance
00068     :param str: byte array of serialized message, ``str``
00069     """
00070     try:
00071       end = 0
00072       start = end
00073       end += 4
00074       (length,) = _struct_I.unpack(str[start:end])
00075       pattern = '<%si'%length
00076       start = end
00077       end += struct.calcsize(pattern)
00078       self.model_ids = struct.unpack(pattern, str[start:end])
00079       return self
00080     except struct.error as e:
00081       raise genpy.DeserializationError(e) #most likely buffer underfill
00082 
00083 
00084   def serialize_numpy(self, buff, numpy):
00085     """
00086     serialize message with numpy array types into buffer
00087     :param buff: buffer, ``StringIO``
00088     :param numpy: numpy python module
00089     """
00090     try:
00091       length = len(self.model_ids)
00092       buff.write(_struct_I.pack(length))
00093       pattern = '<%si'%length
00094       buff.write(self.model_ids.tostring())
00095     except struct.error as se: self._check_types(se)
00096     except TypeError as te: self._check_types(te)
00097 
00098   def deserialize_numpy(self, str, numpy):
00099     """
00100     unpack serialized message in str into this message instance using numpy for array types
00101     :param str: byte array of serialized message, ``str``
00102     :param numpy: numpy python module
00103     """
00104     try:
00105       end = 0
00106       start = end
00107       end += 4
00108       (length,) = _struct_I.unpack(str[start:end])
00109       pattern = '<%si'%length
00110       start = end
00111       end += struct.calcsize(pattern)
00112       self.model_ids = numpy.frombuffer(str[start:end], dtype=numpy.int32, count=length)
00113       return self
00114     except struct.error as e:
00115       raise genpy.DeserializationError(e) #most likely buffer underfill
00116 
00117 _struct_I = genpy.struct_I
00118 """autogenerated by genpy from srs_object_database_msgs/GetMeshResponse.msg. Do not edit."""
00119 import sys
00120 python3 = True if sys.hexversion > 0x03000000 else False
00121 import genpy
00122 import struct
00123 
00124 import arm_navigation_msgs.msg
00125 import srs_object_database_msgs.msg
00126 import geometry_msgs.msg
00127 
00128 class GetMeshResponse(genpy.Message):
00129   _md5sum = "859f0c9f87bd71b652ef91870aa5a727"
00130   _type = "srs_object_database_msgs/GetMeshResponse"
00131   _has_header = False #flag to mark the presence of a Header object
00132   _full_text = """
00133 string return_response
00134 srs_object_database_msgs/mesh[] msg
00135 
00136 
00137 ================================================================================
00138 MSG: srs_object_database_msgs/mesh
00139 int32 objectId
00140 arm_navigation_msgs/Shape mesh
00141 string type
00142 uint8[] data
00143 ================================================================================
00144 MSG: arm_navigation_msgs/Shape
00145 byte SPHERE=0
00146 byte BOX=1
00147 byte CYLINDER=2
00148 byte MESH=3
00149 
00150 byte type
00151 
00152 
00153 #### define sphere, box, cylinder ####
00154 # the origin of each shape is considered at the shape's center
00155 
00156 # for sphere
00157 # radius := dimensions[0]
00158 
00159 # for cylinder
00160 # radius := dimensions[0]
00161 # length := dimensions[1]
00162 # the length is along the Z axis
00163 
00164 # for box
00165 # size_x := dimensions[0]
00166 # size_y := dimensions[1]
00167 # size_z := dimensions[2]
00168 float64[] dimensions
00169 
00170 
00171 #### define mesh ####
00172 
00173 # list of triangles; triangle k is defined by tre vertices located
00174 # at indices triangles[3k], triangles[3k+1], triangles[3k+2]
00175 int32[] triangles
00176 geometry_msgs/Point[] vertices
00177 
00178 ================================================================================
00179 MSG: geometry_msgs/Point
00180 # This contains the position of a point in free space
00181 float64 x
00182 float64 y
00183 float64 z
00184 
00185 """
00186   __slots__ = ['return_response','msg']
00187   _slot_types = ['string','srs_object_database_msgs/mesh[]']
00188 
00189   def __init__(self, *args, **kwds):
00190     """
00191     Constructor. Any message fields that are implicitly/explicitly
00192     set to None will be assigned a default value. The recommend
00193     use is keyword arguments as this is more robust to future message
00194     changes.  You cannot mix in-order arguments and keyword arguments.
00195 
00196     The available fields are:
00197        return_response,msg
00198 
00199     :param args: complete set of field values, in .msg order
00200     :param kwds: use keyword arguments corresponding to message field names
00201     to set specific fields.
00202     """
00203     if args or kwds:
00204       super(GetMeshResponse, self).__init__(*args, **kwds)
00205       #message fields cannot be None, assign default values for those that are
00206       if self.return_response is None:
00207         self.return_response = ''
00208       if self.msg is None:
00209         self.msg = []
00210     else:
00211       self.return_response = ''
00212       self.msg = []
00213 
00214   def _get_types(self):
00215     """
00216     internal API method
00217     """
00218     return self._slot_types
00219 
00220   def serialize(self, buff):
00221     """
00222     serialize message into buffer
00223     :param buff: buffer, ``StringIO``
00224     """
00225     try:
00226       _x = self.return_response
00227       length = len(_x)
00228       if python3 or type(_x) == unicode:
00229         _x = _x.encode('utf-8')
00230         length = len(_x)
00231       buff.write(struct.pack('<I%ss'%length, length, _x))
00232       length = len(self.msg)
00233       buff.write(_struct_I.pack(length))
00234       for val1 in self.msg:
00235         buff.write(_struct_i.pack(val1.objectId))
00236         _v1 = val1.mesh
00237         buff.write(_struct_b.pack(_v1.type))
00238         length = len(_v1.dimensions)
00239         buff.write(_struct_I.pack(length))
00240         pattern = '<%sd'%length
00241         buff.write(struct.pack(pattern, *_v1.dimensions))
00242         length = len(_v1.triangles)
00243         buff.write(_struct_I.pack(length))
00244         pattern = '<%si'%length
00245         buff.write(struct.pack(pattern, *_v1.triangles))
00246         length = len(_v1.vertices)
00247         buff.write(_struct_I.pack(length))
00248         for val3 in _v1.vertices:
00249           _x = val3
00250           buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
00251         _x = val1.type
00252         length = len(_x)
00253         if python3 or type(_x) == unicode:
00254           _x = _x.encode('utf-8')
00255           length = len(_x)
00256         buff.write(struct.pack('<I%ss'%length, length, _x))
00257         _x = val1.data
00258         length = len(_x)
00259         # - if encoded as a list instead, serialize as bytes instead of string
00260         if type(_x) in [list, tuple]:
00261           buff.write(struct.pack('<I%sB'%length, length, *_x))
00262         else:
00263           buff.write(struct.pack('<I%ss'%length, length, _x))
00264     except struct.error as se: self._check_types(se)
00265     except TypeError as te: self._check_types(te)
00266 
00267   def deserialize(self, str):
00268     """
00269     unpack serialized message in str into this message instance
00270     :param str: byte array of serialized message, ``str``
00271     """
00272     try:
00273       if self.msg is None:
00274         self.msg = None
00275       end = 0
00276       start = end
00277       end += 4
00278       (length,) = _struct_I.unpack(str[start:end])
00279       start = end
00280       end += length
00281       if python3:
00282         self.return_response = str[start:end].decode('utf-8')
00283       else:
00284         self.return_response = str[start:end]
00285       start = end
00286       end += 4
00287       (length,) = _struct_I.unpack(str[start:end])
00288       self.msg = []
00289       for i in range(0, length):
00290         val1 = srs_object_database_msgs.msg.mesh()
00291         start = end
00292         end += 4
00293         (val1.objectId,) = _struct_i.unpack(str[start:end])
00294         _v2 = val1.mesh
00295         start = end
00296         end += 1
00297         (_v2.type,) = _struct_b.unpack(str[start:end])
00298         start = end
00299         end += 4
00300         (length,) = _struct_I.unpack(str[start:end])
00301         pattern = '<%sd'%length
00302         start = end
00303         end += struct.calcsize(pattern)
00304         _v2.dimensions = struct.unpack(pattern, str[start:end])
00305         start = end
00306         end += 4
00307         (length,) = _struct_I.unpack(str[start:end])
00308         pattern = '<%si'%length
00309         start = end
00310         end += struct.calcsize(pattern)
00311         _v2.triangles = struct.unpack(pattern, str[start:end])
00312         start = end
00313         end += 4
00314         (length,) = _struct_I.unpack(str[start:end])
00315         _v2.vertices = []
00316         for i in range(0, length):
00317           val3 = geometry_msgs.msg.Point()
00318           _x = val3
00319           start = end
00320           end += 24
00321           (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
00322           _v2.vertices.append(val3)
00323         start = end
00324         end += 4
00325         (length,) = _struct_I.unpack(str[start:end])
00326         start = end
00327         end += length
00328         if python3:
00329           val1.type = str[start:end].decode('utf-8')
00330         else:
00331           val1.type = str[start:end]
00332         start = end
00333         end += 4
00334         (length,) = _struct_I.unpack(str[start:end])
00335         start = end
00336         end += length
00337         if python3:
00338           val1.data = str[start:end].decode('utf-8')
00339         else:
00340           val1.data = str[start:end]
00341         self.msg.append(val1)
00342       return self
00343     except struct.error as e:
00344       raise genpy.DeserializationError(e) #most likely buffer underfill
00345 
00346 
00347   def serialize_numpy(self, buff, numpy):
00348     """
00349     serialize message with numpy array types into buffer
00350     :param buff: buffer, ``StringIO``
00351     :param numpy: numpy python module
00352     """
00353     try:
00354       _x = self.return_response
00355       length = len(_x)
00356       if python3 or type(_x) == unicode:
00357         _x = _x.encode('utf-8')
00358         length = len(_x)
00359       buff.write(struct.pack('<I%ss'%length, length, _x))
00360       length = len(self.msg)
00361       buff.write(_struct_I.pack(length))
00362       for val1 in self.msg:
00363         buff.write(_struct_i.pack(val1.objectId))
00364         _v3 = val1.mesh
00365         buff.write(_struct_b.pack(_v3.type))
00366         length = len(_v3.dimensions)
00367         buff.write(_struct_I.pack(length))
00368         pattern = '<%sd'%length
00369         buff.write(_v3.dimensions.tostring())
00370         length = len(_v3.triangles)
00371         buff.write(_struct_I.pack(length))
00372         pattern = '<%si'%length
00373         buff.write(_v3.triangles.tostring())
00374         length = len(_v3.vertices)
00375         buff.write(_struct_I.pack(length))
00376         for val3 in _v3.vertices:
00377           _x = val3
00378           buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
00379         _x = val1.type
00380         length = len(_x)
00381         if python3 or type(_x) == unicode:
00382           _x = _x.encode('utf-8')
00383           length = len(_x)
00384         buff.write(struct.pack('<I%ss'%length, length, _x))
00385         _x = val1.data
00386         length = len(_x)
00387         # - if encoded as a list instead, serialize as bytes instead of string
00388         if type(_x) in [list, tuple]:
00389           buff.write(struct.pack('<I%sB'%length, length, *_x))
00390         else:
00391           buff.write(struct.pack('<I%ss'%length, length, _x))
00392     except struct.error as se: self._check_types(se)
00393     except TypeError as te: self._check_types(te)
00394 
00395   def deserialize_numpy(self, str, numpy):
00396     """
00397     unpack serialized message in str into this message instance using numpy for array types
00398     :param str: byte array of serialized message, ``str``
00399     :param numpy: numpy python module
00400     """
00401     try:
00402       if self.msg is None:
00403         self.msg = None
00404       end = 0
00405       start = end
00406       end += 4
00407       (length,) = _struct_I.unpack(str[start:end])
00408       start = end
00409       end += length
00410       if python3:
00411         self.return_response = str[start:end].decode('utf-8')
00412       else:
00413         self.return_response = str[start:end]
00414       start = end
00415       end += 4
00416       (length,) = _struct_I.unpack(str[start:end])
00417       self.msg = []
00418       for i in range(0, length):
00419         val1 = srs_object_database_msgs.msg.mesh()
00420         start = end
00421         end += 4
00422         (val1.objectId,) = _struct_i.unpack(str[start:end])
00423         _v4 = val1.mesh
00424         start = end
00425         end += 1
00426         (_v4.type,) = _struct_b.unpack(str[start:end])
00427         start = end
00428         end += 4
00429         (length,) = _struct_I.unpack(str[start:end])
00430         pattern = '<%sd'%length
00431         start = end
00432         end += struct.calcsize(pattern)
00433         _v4.dimensions = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
00434         start = end
00435         end += 4
00436         (length,) = _struct_I.unpack(str[start:end])
00437         pattern = '<%si'%length
00438         start = end
00439         end += struct.calcsize(pattern)
00440         _v4.triangles = numpy.frombuffer(str[start:end], dtype=numpy.int32, count=length)
00441         start = end
00442         end += 4
00443         (length,) = _struct_I.unpack(str[start:end])
00444         _v4.vertices = []
00445         for i in range(0, length):
00446           val3 = geometry_msgs.msg.Point()
00447           _x = val3
00448           start = end
00449           end += 24
00450           (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
00451           _v4.vertices.append(val3)
00452         start = end
00453         end += 4
00454         (length,) = _struct_I.unpack(str[start:end])
00455         start = end
00456         end += length
00457         if python3:
00458           val1.type = str[start:end].decode('utf-8')
00459         else:
00460           val1.type = str[start:end]
00461         start = end
00462         end += 4
00463         (length,) = _struct_I.unpack(str[start:end])
00464         start = end
00465         end += length
00466         if python3:
00467           val1.data = str[start:end].decode('utf-8')
00468         else:
00469           val1.data = str[start:end]
00470         self.msg.append(val1)
00471       return self
00472     except struct.error as e:
00473       raise genpy.DeserializationError(e) #most likely buffer underfill
00474 
00475 _struct_I = genpy.struct_I
00476 _struct_i = struct.Struct("<i")
00477 _struct_b = struct.Struct("<b")
00478 _struct_3d = struct.Struct("<3d")
00479 class GetMesh(object):
00480   _type          = 'srs_object_database_msgs/GetMesh'
00481   _md5sum = 'a3772ee4f5f8006daae5f01f0b3dbee3'
00482   _request_class  = GetMeshRequest
00483   _response_class = GetMeshResponse


srs_object_database_msgs
Author(s): Georg Arbeiter
autogenerated on Sun Jan 5 2014 11:36:25