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