00001 """autogenerated by genpy from annotation_srvs/TriangleMeshToNameRequest.msg. Do not edit."""
00002 import sys
00003 python3 = True if sys.hexversion > 0x03000000 else False
00004 import genpy
00005 import struct
00006
00007 import geometry_msgs.msg
00008 import triangle_mesh_msgs.msg
00009 import std_msgs.msg
00010
00011 class TriangleMeshToNameRequest(genpy.Message):
00012 _md5sum = "c9fa2982cc45237506b1b8c8a4d4623c"
00013 _type = "annotation_srvs/TriangleMeshToNameRequest"
00014 _has_header = False
00015 _full_text = """
00016
00017 triangle_mesh_msgs/TriangleMesh mesh
00018
00019 ================================================================================
00020 MSG: triangle_mesh_msgs/TriangleMesh
00021 Header header
00022 geometry_msgs/Point32[] points
00023 geometry_msgs/Point32[] normals
00024 float32[] intensities
00025 triangle_mesh_msgs/Triangle[] triangles
00026 string sending_node
00027
00028 ================================================================================
00029 MSG: std_msgs/Header
00030 # Standard metadata for higher-level stamped data types.
00031 # This is generally used to communicate timestamped data
00032 # in a particular coordinate frame.
00033 #
00034 # sequence ID: consecutively increasing ID
00035 uint32 seq
00036 #Two-integer timestamp that is expressed as:
00037 # * stamp.secs: seconds (stamp_secs) since epoch
00038 # * stamp.nsecs: nanoseconds since stamp_secs
00039 # time-handling sugar is provided by the client library
00040 time stamp
00041 #Frame this data is associated with
00042 # 0: no frame
00043 # 1: global frame
00044 string frame_id
00045
00046 ================================================================================
00047 MSG: geometry_msgs/Point32
00048 # This contains the position of a point in free space(with 32 bits of precision).
00049 # It is recommeded to use Point wherever possible instead of Point32.
00050 #
00051 # This recommendation is to promote interoperability.
00052 #
00053 # This message is designed to take up less space when sending
00054 # lots of points at once, as in the case of a PointCloud.
00055
00056 float32 x
00057 float32 y
00058 float32 z
00059 ================================================================================
00060 MSG: triangle_mesh_msgs/Triangle
00061 int32 i
00062 int32 j
00063 int32 k
00064
00065
00066
00067 """
00068 __slots__ = ['mesh']
00069 _slot_types = ['triangle_mesh_msgs/TriangleMesh']
00070
00071 def __init__(self, *args, **kwds):
00072 """
00073 Constructor. Any message fields that are implicitly/explicitly
00074 set to None will be assigned a default value. The recommend
00075 use is keyword arguments as this is more robust to future message
00076 changes. You cannot mix in-order arguments and keyword arguments.
00077
00078 The available fields are:
00079 mesh
00080
00081 :param args: complete set of field values, in .msg order
00082 :param kwds: use keyword arguments corresponding to message field names
00083 to set specific fields.
00084 """
00085 if args or kwds:
00086 super(TriangleMeshToNameRequest, self).__init__(*args, **kwds)
00087
00088 if self.mesh is None:
00089 self.mesh = triangle_mesh_msgs.msg.TriangleMesh()
00090 else:
00091 self.mesh = triangle_mesh_msgs.msg.TriangleMesh()
00092
00093 def _get_types(self):
00094 """
00095 internal API method
00096 """
00097 return self._slot_types
00098
00099 def serialize(self, buff):
00100 """
00101 serialize message into buffer
00102 :param buff: buffer, ``StringIO``
00103 """
00104 try:
00105 _x = self
00106 buff.write(_struct_3I.pack(_x.mesh.header.seq, _x.mesh.header.stamp.secs, _x.mesh.header.stamp.nsecs))
00107 _x = self.mesh.header.frame_id
00108 length = len(_x)
00109 if python3 or type(_x) == unicode:
00110 _x = _x.encode('utf-8')
00111 length = len(_x)
00112 buff.write(struct.pack('<I%ss'%length, length, _x))
00113 length = len(self.mesh.points)
00114 buff.write(_struct_I.pack(length))
00115 for val1 in self.mesh.points:
00116 _x = val1
00117 buff.write(_struct_3f.pack(_x.x, _x.y, _x.z))
00118 length = len(self.mesh.normals)
00119 buff.write(_struct_I.pack(length))
00120 for val1 in self.mesh.normals:
00121 _x = val1
00122 buff.write(_struct_3f.pack(_x.x, _x.y, _x.z))
00123 length = len(self.mesh.intensities)
00124 buff.write(_struct_I.pack(length))
00125 pattern = '<%sf'%length
00126 buff.write(struct.pack(pattern, *self.mesh.intensities))
00127 length = len(self.mesh.triangles)
00128 buff.write(_struct_I.pack(length))
00129 for val1 in self.mesh.triangles:
00130 _x = val1
00131 buff.write(_struct_3i.pack(_x.i, _x.j, _x.k))
00132 _x = self.mesh.sending_node
00133 length = len(_x)
00134 if python3 or type(_x) == unicode:
00135 _x = _x.encode('utf-8')
00136 length = len(_x)
00137 buff.write(struct.pack('<I%ss'%length, length, _x))
00138 except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00139 except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00140
00141 def deserialize(self, str):
00142 """
00143 unpack serialized message in str into this message instance
00144 :param str: byte array of serialized message, ``str``
00145 """
00146 try:
00147 if self.mesh is None:
00148 self.mesh = triangle_mesh_msgs.msg.TriangleMesh()
00149 end = 0
00150 _x = self
00151 start = end
00152 end += 12
00153 (_x.mesh.header.seq, _x.mesh.header.stamp.secs, _x.mesh.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00154 start = end
00155 end += 4
00156 (length,) = _struct_I.unpack(str[start:end])
00157 start = end
00158 end += length
00159 if python3:
00160 self.mesh.header.frame_id = str[start:end].decode('utf-8')
00161 else:
00162 self.mesh.header.frame_id = str[start:end]
00163 start = end
00164 end += 4
00165 (length,) = _struct_I.unpack(str[start:end])
00166 self.mesh.points = []
00167 for i in range(0, length):
00168 val1 = geometry_msgs.msg.Point32()
00169 _x = val1
00170 start = end
00171 end += 12
00172 (_x.x, _x.y, _x.z,) = _struct_3f.unpack(str[start:end])
00173 self.mesh.points.append(val1)
00174 start = end
00175 end += 4
00176 (length,) = _struct_I.unpack(str[start:end])
00177 self.mesh.normals = []
00178 for i in range(0, length):
00179 val1 = geometry_msgs.msg.Point32()
00180 _x = val1
00181 start = end
00182 end += 12
00183 (_x.x, _x.y, _x.z,) = _struct_3f.unpack(str[start:end])
00184 self.mesh.normals.append(val1)
00185 start = end
00186 end += 4
00187 (length,) = _struct_I.unpack(str[start:end])
00188 pattern = '<%sf'%length
00189 start = end
00190 end += struct.calcsize(pattern)
00191 self.mesh.intensities = struct.unpack(pattern, str[start:end])
00192 start = end
00193 end += 4
00194 (length,) = _struct_I.unpack(str[start:end])
00195 self.mesh.triangles = []
00196 for i in range(0, length):
00197 val1 = triangle_mesh_msgs.msg.Triangle()
00198 _x = val1
00199 start = end
00200 end += 12
00201 (_x.i, _x.j, _x.k,) = _struct_3i.unpack(str[start:end])
00202 self.mesh.triangles.append(val1)
00203 start = end
00204 end += 4
00205 (length,) = _struct_I.unpack(str[start:end])
00206 start = end
00207 end += length
00208 if python3:
00209 self.mesh.sending_node = str[start:end].decode('utf-8')
00210 else:
00211 self.mesh.sending_node = str[start:end]
00212 return self
00213 except struct.error as e:
00214 raise genpy.DeserializationError(e)
00215
00216
00217 def serialize_numpy(self, buff, numpy):
00218 """
00219 serialize message with numpy array types into buffer
00220 :param buff: buffer, ``StringIO``
00221 :param numpy: numpy python module
00222 """
00223 try:
00224 _x = self
00225 buff.write(_struct_3I.pack(_x.mesh.header.seq, _x.mesh.header.stamp.secs, _x.mesh.header.stamp.nsecs))
00226 _x = self.mesh.header.frame_id
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.mesh.points)
00233 buff.write(_struct_I.pack(length))
00234 for val1 in self.mesh.points:
00235 _x = val1
00236 buff.write(_struct_3f.pack(_x.x, _x.y, _x.z))
00237 length = len(self.mesh.normals)
00238 buff.write(_struct_I.pack(length))
00239 for val1 in self.mesh.normals:
00240 _x = val1
00241 buff.write(_struct_3f.pack(_x.x, _x.y, _x.z))
00242 length = len(self.mesh.intensities)
00243 buff.write(_struct_I.pack(length))
00244 pattern = '<%sf'%length
00245 buff.write(self.mesh.intensities.tostring())
00246 length = len(self.mesh.triangles)
00247 buff.write(_struct_I.pack(length))
00248 for val1 in self.mesh.triangles:
00249 _x = val1
00250 buff.write(_struct_3i.pack(_x.i, _x.j, _x.k))
00251 _x = self.mesh.sending_node
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 except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00258 except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00259
00260 def deserialize_numpy(self, str, numpy):
00261 """
00262 unpack serialized message in str into this message instance using numpy for array types
00263 :param str: byte array of serialized message, ``str``
00264 :param numpy: numpy python module
00265 """
00266 try:
00267 if self.mesh is None:
00268 self.mesh = triangle_mesh_msgs.msg.TriangleMesh()
00269 end = 0
00270 _x = self
00271 start = end
00272 end += 12
00273 (_x.mesh.header.seq, _x.mesh.header.stamp.secs, _x.mesh.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00274 start = end
00275 end += 4
00276 (length,) = _struct_I.unpack(str[start:end])
00277 start = end
00278 end += length
00279 if python3:
00280 self.mesh.header.frame_id = str[start:end].decode('utf-8')
00281 else:
00282 self.mesh.header.frame_id = str[start:end]
00283 start = end
00284 end += 4
00285 (length,) = _struct_I.unpack(str[start:end])
00286 self.mesh.points = []
00287 for i in range(0, length):
00288 val1 = geometry_msgs.msg.Point32()
00289 _x = val1
00290 start = end
00291 end += 12
00292 (_x.x, _x.y, _x.z,) = _struct_3f.unpack(str[start:end])
00293 self.mesh.points.append(val1)
00294 start = end
00295 end += 4
00296 (length,) = _struct_I.unpack(str[start:end])
00297 self.mesh.normals = []
00298 for i in range(0, length):
00299 val1 = geometry_msgs.msg.Point32()
00300 _x = val1
00301 start = end
00302 end += 12
00303 (_x.x, _x.y, _x.z,) = _struct_3f.unpack(str[start:end])
00304 self.mesh.normals.append(val1)
00305 start = end
00306 end += 4
00307 (length,) = _struct_I.unpack(str[start:end])
00308 pattern = '<%sf'%length
00309 start = end
00310 end += struct.calcsize(pattern)
00311 self.mesh.intensities = numpy.frombuffer(str[start:end], dtype=numpy.float32, count=length)
00312 start = end
00313 end += 4
00314 (length,) = _struct_I.unpack(str[start:end])
00315 self.mesh.triangles = []
00316 for i in range(0, length):
00317 val1 = triangle_mesh_msgs.msg.Triangle()
00318 _x = val1
00319 start = end
00320 end += 12
00321 (_x.i, _x.j, _x.k,) = _struct_3i.unpack(str[start:end])
00322 self.mesh.triangles.append(val1)
00323 start = end
00324 end += 4
00325 (length,) = _struct_I.unpack(str[start:end])
00326 start = end
00327 end += length
00328 if python3:
00329 self.mesh.sending_node = str[start:end].decode('utf-8')
00330 else:
00331 self.mesh.sending_node = str[start:end]
00332 return self
00333 except struct.error as e:
00334 raise genpy.DeserializationError(e)
00335
00336 _struct_I = genpy.struct_I
00337 _struct_3I = struct.Struct("<3I")
00338 _struct_3f = struct.Struct("<3f")
00339 _struct_3i = struct.Struct("<3i")
00340 """autogenerated by genpy from annotation_srvs/TriangleMeshToNameResponse.msg. Do not edit."""
00341 import sys
00342 python3 = True if sys.hexversion > 0x03000000 else False
00343 import genpy
00344 import struct
00345
00346
00347 class TriangleMeshToNameResponse(genpy.Message):
00348 _md5sum = "c1f3d28f1b044c871e6eff2e9fc3c667"
00349 _type = "annotation_srvs/TriangleMeshToNameResponse"
00350 _has_header = False
00351 _full_text = """string name
00352
00353 """
00354 __slots__ = ['name']
00355 _slot_types = ['string']
00356
00357 def __init__(self, *args, **kwds):
00358 """
00359 Constructor. Any message fields that are implicitly/explicitly
00360 set to None will be assigned a default value. The recommend
00361 use is keyword arguments as this is more robust to future message
00362 changes. You cannot mix in-order arguments and keyword arguments.
00363
00364 The available fields are:
00365 name
00366
00367 :param args: complete set of field values, in .msg order
00368 :param kwds: use keyword arguments corresponding to message field names
00369 to set specific fields.
00370 """
00371 if args or kwds:
00372 super(TriangleMeshToNameResponse, self).__init__(*args, **kwds)
00373
00374 if self.name is None:
00375 self.name = ''
00376 else:
00377 self.name = ''
00378
00379 def _get_types(self):
00380 """
00381 internal API method
00382 """
00383 return self._slot_types
00384
00385 def serialize(self, buff):
00386 """
00387 serialize message into buffer
00388 :param buff: buffer, ``StringIO``
00389 """
00390 try:
00391 _x = self.name
00392 length = len(_x)
00393 if python3 or type(_x) == unicode:
00394 _x = _x.encode('utf-8')
00395 length = len(_x)
00396 buff.write(struct.pack('<I%ss'%length, length, _x))
00397 except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00398 except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00399
00400 def deserialize(self, str):
00401 """
00402 unpack serialized message in str into this message instance
00403 :param str: byte array of serialized message, ``str``
00404 """
00405 try:
00406 end = 0
00407 start = end
00408 end += 4
00409 (length,) = _struct_I.unpack(str[start:end])
00410 start = end
00411 end += length
00412 if python3:
00413 self.name = str[start:end].decode('utf-8')
00414 else:
00415 self.name = str[start:end]
00416 return self
00417 except struct.error as e:
00418 raise genpy.DeserializationError(e)
00419
00420
00421 def serialize_numpy(self, buff, numpy):
00422 """
00423 serialize message with numpy array types into buffer
00424 :param buff: buffer, ``StringIO``
00425 :param numpy: numpy python module
00426 """
00427 try:
00428 _x = self.name
00429 length = len(_x)
00430 if python3 or type(_x) == unicode:
00431 _x = _x.encode('utf-8')
00432 length = len(_x)
00433 buff.write(struct.pack('<I%ss'%length, length, _x))
00434 except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00435 except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00436
00437 def deserialize_numpy(self, str, numpy):
00438 """
00439 unpack serialized message in str into this message instance using numpy for array types
00440 :param str: byte array of serialized message, ``str``
00441 :param numpy: numpy python module
00442 """
00443 try:
00444 end = 0
00445 start = end
00446 end += 4
00447 (length,) = _struct_I.unpack(str[start:end])
00448 start = end
00449 end += length
00450 if python3:
00451 self.name = str[start:end].decode('utf-8')
00452 else:
00453 self.name = str[start:end]
00454 return self
00455 except struct.error as e:
00456 raise genpy.DeserializationError(e)
00457
00458 _struct_I = genpy.struct_I
00459 class TriangleMeshToName(object):
00460 _type = 'annotation_srvs/TriangleMeshToName'
00461 _md5sum = '962f6681d8f3f343ad5f5edeffbd3870'
00462 _request_class = TriangleMeshToNameRequest
00463 _response_class = TriangleMeshToNameResponse