_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         val1.data = str[start:end]
00338         self.msg.append(val1)
00339       return self
00340     except struct.error as e:
00341       raise genpy.DeserializationError(e) #most likely buffer underfill
00342 
00343 
00344   def serialize_numpy(self, buff, numpy):
00345     """
00346     serialize message with numpy array types into buffer
00347     :param buff: buffer, ``StringIO``
00348     :param numpy: numpy python module
00349     """
00350     try:
00351       _x = self.return_response
00352       length = len(_x)
00353       if python3 or type(_x) == unicode:
00354         _x = _x.encode('utf-8')
00355         length = len(_x)
00356       buff.write(struct.pack('<I%ss'%length, length, _x))
00357       length = len(self.msg)
00358       buff.write(_struct_I.pack(length))
00359       for val1 in self.msg:
00360         buff.write(_struct_i.pack(val1.objectId))
00361         _v3 = val1.mesh
00362         buff.write(_struct_b.pack(_v3.type))
00363         length = len(_v3.dimensions)
00364         buff.write(_struct_I.pack(length))
00365         pattern = '<%sd'%length
00366         buff.write(_v3.dimensions.tostring())
00367         length = len(_v3.triangles)
00368         buff.write(_struct_I.pack(length))
00369         pattern = '<%si'%length
00370         buff.write(_v3.triangles.tostring())
00371         length = len(_v3.vertices)
00372         buff.write(_struct_I.pack(length))
00373         for val3 in _v3.vertices:
00374           _x = val3
00375           buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
00376         _x = val1.type
00377         length = len(_x)
00378         if python3 or type(_x) == unicode:
00379           _x = _x.encode('utf-8')
00380           length = len(_x)
00381         buff.write(struct.pack('<I%ss'%length, length, _x))
00382         _x = val1.data
00383         length = len(_x)
00384         # - if encoded as a list instead, serialize as bytes instead of string
00385         if type(_x) in [list, tuple]:
00386           buff.write(struct.pack('<I%sB'%length, length, *_x))
00387         else:
00388           buff.write(struct.pack('<I%ss'%length, length, _x))
00389     except struct.error as se: self._check_types(se)
00390     except TypeError as te: self._check_types(te)
00391 
00392   def deserialize_numpy(self, str, numpy):
00393     """
00394     unpack serialized message in str into this message instance using numpy for array types
00395     :param str: byte array of serialized message, ``str``
00396     :param numpy: numpy python module
00397     """
00398     try:
00399       if self.msg is None:
00400         self.msg = None
00401       end = 0
00402       start = end
00403       end += 4
00404       (length,) = _struct_I.unpack(str[start:end])
00405       start = end
00406       end += length
00407       if python3:
00408         self.return_response = str[start:end].decode('utf-8')
00409       else:
00410         self.return_response = str[start:end]
00411       start = end
00412       end += 4
00413       (length,) = _struct_I.unpack(str[start:end])
00414       self.msg = []
00415       for i in range(0, length):
00416         val1 = srs_object_database_msgs.msg.mesh()
00417         start = end
00418         end += 4
00419         (val1.objectId,) = _struct_i.unpack(str[start:end])
00420         _v4 = val1.mesh
00421         start = end
00422         end += 1
00423         (_v4.type,) = _struct_b.unpack(str[start:end])
00424         start = end
00425         end += 4
00426         (length,) = _struct_I.unpack(str[start:end])
00427         pattern = '<%sd'%length
00428         start = end
00429         end += struct.calcsize(pattern)
00430         _v4.dimensions = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
00431         start = end
00432         end += 4
00433         (length,) = _struct_I.unpack(str[start:end])
00434         pattern = '<%si'%length
00435         start = end
00436         end += struct.calcsize(pattern)
00437         _v4.triangles = numpy.frombuffer(str[start:end], dtype=numpy.int32, count=length)
00438         start = end
00439         end += 4
00440         (length,) = _struct_I.unpack(str[start:end])
00441         _v4.vertices = []
00442         for i in range(0, length):
00443           val3 = geometry_msgs.msg.Point()
00444           _x = val3
00445           start = end
00446           end += 24
00447           (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
00448           _v4.vertices.append(val3)
00449         start = end
00450         end += 4
00451         (length,) = _struct_I.unpack(str[start:end])
00452         start = end
00453         end += length
00454         if python3:
00455           val1.type = str[start:end].decode('utf-8')
00456         else:
00457           val1.type = str[start:end]
00458         start = end
00459         end += 4
00460         (length,) = _struct_I.unpack(str[start:end])
00461         start = end
00462         end += length
00463         val1.data = str[start:end]
00464         self.msg.append(val1)
00465       return self
00466     except struct.error as e:
00467       raise genpy.DeserializationError(e) #most likely buffer underfill
00468 
00469 _struct_I = genpy.struct_I
00470 _struct_i = struct.Struct("<i")
00471 _struct_b = struct.Struct("<b")
00472 _struct_3d = struct.Struct("<3d")
00473 class GetMesh(object):
00474   _type          = 'srs_object_database_msgs/GetMesh'
00475   _md5sum = 'a3772ee4f5f8006daae5f01f0b3dbee3'
00476   _request_class  = GetMeshRequest
00477   _response_class = GetMeshResponse


srs_object_database_msgs
Author(s): Georg Arbeiter
autogenerated on Wed Nov 27 2013 14:14:38