00001 """autogenerated by genpy from triangle_mesh_msgs/TriangleMesh.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 TriangleMesh(genpy.Message):
00012 _md5sum = "2cd8125b80abf942af5656b65994fe56"
00013 _type = "triangle_mesh_msgs/TriangleMesh"
00014 _has_header = True
00015 _full_text = """Header header
00016 geometry_msgs/Point32[] points
00017 geometry_msgs/Point32[] normals
00018 float32[] intensities
00019 triangle_mesh_msgs/Triangle[] triangles
00020 string sending_node
00021
00022 ================================================================================
00023 MSG: std_msgs/Header
00024 # Standard metadata for higher-level stamped data types.
00025 # This is generally used to communicate timestamped data
00026 # in a particular coordinate frame.
00027 #
00028 # sequence ID: consecutively increasing ID
00029 uint32 seq
00030 #Two-integer timestamp that is expressed as:
00031 # * stamp.secs: seconds (stamp_secs) since epoch
00032 # * stamp.nsecs: nanoseconds since stamp_secs
00033 # time-handling sugar is provided by the client library
00034 time stamp
00035 #Frame this data is associated with
00036 # 0: no frame
00037 # 1: global frame
00038 string frame_id
00039
00040 ================================================================================
00041 MSG: geometry_msgs/Point32
00042 # This contains the position of a point in free space(with 32 bits of precision).
00043 # It is recommeded to use Point wherever possible instead of Point32.
00044 #
00045 # This recommendation is to promote interoperability.
00046 #
00047 # This message is designed to take up less space when sending
00048 # lots of points at once, as in the case of a PointCloud.
00049
00050 float32 x
00051 float32 y
00052 float32 z
00053 ================================================================================
00054 MSG: triangle_mesh_msgs/Triangle
00055 int32 i
00056 int32 j
00057 int32 k
00058
00059
00060
00061 """
00062 __slots__ = ['header','points','normals','intensities','triangles','sending_node']
00063 _slot_types = ['std_msgs/Header','geometry_msgs/Point32[]','geometry_msgs/Point32[]','float32[]','triangle_mesh_msgs/Triangle[]','string']
00064
00065 def __init__(self, *args, **kwds):
00066 """
00067 Constructor. Any message fields that are implicitly/explicitly
00068 set to None will be assigned a default value. The recommend
00069 use is keyword arguments as this is more robust to future message
00070 changes. You cannot mix in-order arguments and keyword arguments.
00071
00072 The available fields are:
00073 header,points,normals,intensities,triangles,sending_node
00074
00075 :param args: complete set of field values, in .msg order
00076 :param kwds: use keyword arguments corresponding to message field names
00077 to set specific fields.
00078 """
00079 if args or kwds:
00080 super(TriangleMesh, self).__init__(*args, **kwds)
00081
00082 if self.header is None:
00083 self.header = std_msgs.msg.Header()
00084 if self.points is None:
00085 self.points = []
00086 if self.normals is None:
00087 self.normals = []
00088 if self.intensities is None:
00089 self.intensities = []
00090 if self.triangles is None:
00091 self.triangles = []
00092 if self.sending_node is None:
00093 self.sending_node = ''
00094 else:
00095 self.header = std_msgs.msg.Header()
00096 self.points = []
00097 self.normals = []
00098 self.intensities = []
00099 self.triangles = []
00100 self.sending_node = ''
00101
00102 def _get_types(self):
00103 """
00104 internal API method
00105 """
00106 return self._slot_types
00107
00108 def serialize(self, buff):
00109 """
00110 serialize message into buffer
00111 :param buff: buffer, ``StringIO``
00112 """
00113 try:
00114 _x = self
00115 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00116 _x = self.header.frame_id
00117 length = len(_x)
00118 if python3 or type(_x) == unicode:
00119 _x = _x.encode('utf-8')
00120 length = len(_x)
00121 buff.write(struct.pack('<I%ss'%length, length, _x))
00122 length = len(self.points)
00123 buff.write(_struct_I.pack(length))
00124 for val1 in self.points:
00125 _x = val1
00126 buff.write(_struct_3f.pack(_x.x, _x.y, _x.z))
00127 length = len(self.normals)
00128 buff.write(_struct_I.pack(length))
00129 for val1 in self.normals:
00130 _x = val1
00131 buff.write(_struct_3f.pack(_x.x, _x.y, _x.z))
00132 length = len(self.intensities)
00133 buff.write(_struct_I.pack(length))
00134 pattern = '<%sf'%length
00135 buff.write(struct.pack(pattern, *self.intensities))
00136 length = len(self.triangles)
00137 buff.write(_struct_I.pack(length))
00138 for val1 in self.triangles:
00139 _x = val1
00140 buff.write(_struct_3i.pack(_x.i, _x.j, _x.k))
00141 _x = self.sending_node
00142 length = len(_x)
00143 if python3 or type(_x) == unicode:
00144 _x = _x.encode('utf-8')
00145 length = len(_x)
00146 buff.write(struct.pack('<I%ss'%length, length, _x))
00147 except struct.error as se: self._check_types(se)
00148 except TypeError as te: self._check_types(te)
00149
00150 def deserialize(self, str):
00151 """
00152 unpack serialized message in str into this message instance
00153 :param str: byte array of serialized message, ``str``
00154 """
00155 try:
00156 if self.header is None:
00157 self.header = std_msgs.msg.Header()
00158 if self.points is None:
00159 self.points = None
00160 if self.normals is None:
00161 self.normals = None
00162 if self.triangles is None:
00163 self.triangles = None
00164 end = 0
00165 _x = self
00166 start = end
00167 end += 12
00168 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00169 start = end
00170 end += 4
00171 (length,) = _struct_I.unpack(str[start:end])
00172 start = end
00173 end += length
00174 if python3:
00175 self.header.frame_id = str[start:end].decode('utf-8')
00176 else:
00177 self.header.frame_id = str[start:end]
00178 start = end
00179 end += 4
00180 (length,) = _struct_I.unpack(str[start:end])
00181 self.points = []
00182 for i in range(0, length):
00183 val1 = geometry_msgs.msg.Point32()
00184 _x = val1
00185 start = end
00186 end += 12
00187 (_x.x, _x.y, _x.z,) = _struct_3f.unpack(str[start:end])
00188 self.points.append(val1)
00189 start = end
00190 end += 4
00191 (length,) = _struct_I.unpack(str[start:end])
00192 self.normals = []
00193 for i in range(0, length):
00194 val1 = geometry_msgs.msg.Point32()
00195 _x = val1
00196 start = end
00197 end += 12
00198 (_x.x, _x.y, _x.z,) = _struct_3f.unpack(str[start:end])
00199 self.normals.append(val1)
00200 start = end
00201 end += 4
00202 (length,) = _struct_I.unpack(str[start:end])
00203 pattern = '<%sf'%length
00204 start = end
00205 end += struct.calcsize(pattern)
00206 self.intensities = struct.unpack(pattern, str[start:end])
00207 start = end
00208 end += 4
00209 (length,) = _struct_I.unpack(str[start:end])
00210 self.triangles = []
00211 for i in range(0, length):
00212 val1 = triangle_mesh_msgs.msg.Triangle()
00213 _x = val1
00214 start = end
00215 end += 12
00216 (_x.i, _x.j, _x.k,) = _struct_3i.unpack(str[start:end])
00217 self.triangles.append(val1)
00218 start = end
00219 end += 4
00220 (length,) = _struct_I.unpack(str[start:end])
00221 start = end
00222 end += length
00223 if python3:
00224 self.sending_node = str[start:end].decode('utf-8')
00225 else:
00226 self.sending_node = str[start:end]
00227 return self
00228 except struct.error as e:
00229 raise genpy.DeserializationError(e)
00230
00231
00232 def serialize_numpy(self, buff, numpy):
00233 """
00234 serialize message with numpy array types into buffer
00235 :param buff: buffer, ``StringIO``
00236 :param numpy: numpy python module
00237 """
00238 try:
00239 _x = self
00240 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00241 _x = self.header.frame_id
00242 length = len(_x)
00243 if python3 or type(_x) == unicode:
00244 _x = _x.encode('utf-8')
00245 length = len(_x)
00246 buff.write(struct.pack('<I%ss'%length, length, _x))
00247 length = len(self.points)
00248 buff.write(_struct_I.pack(length))
00249 for val1 in self.points:
00250 _x = val1
00251 buff.write(_struct_3f.pack(_x.x, _x.y, _x.z))
00252 length = len(self.normals)
00253 buff.write(_struct_I.pack(length))
00254 for val1 in self.normals:
00255 _x = val1
00256 buff.write(_struct_3f.pack(_x.x, _x.y, _x.z))
00257 length = len(self.intensities)
00258 buff.write(_struct_I.pack(length))
00259 pattern = '<%sf'%length
00260 buff.write(self.intensities.tostring())
00261 length = len(self.triangles)
00262 buff.write(_struct_I.pack(length))
00263 for val1 in self.triangles:
00264 _x = val1
00265 buff.write(_struct_3i.pack(_x.i, _x.j, _x.k))
00266 _x = self.sending_node
00267 length = len(_x)
00268 if python3 or type(_x) == unicode:
00269 _x = _x.encode('utf-8')
00270 length = len(_x)
00271 buff.write(struct.pack('<I%ss'%length, length, _x))
00272 except struct.error as se: self._check_types(se)
00273 except TypeError as te: self._check_types(te)
00274
00275 def deserialize_numpy(self, str, numpy):
00276 """
00277 unpack serialized message in str into this message instance using numpy for array types
00278 :param str: byte array of serialized message, ``str``
00279 :param numpy: numpy python module
00280 """
00281 try:
00282 if self.header is None:
00283 self.header = std_msgs.msg.Header()
00284 if self.points is None:
00285 self.points = None
00286 if self.normals is None:
00287 self.normals = None
00288 if self.triangles is None:
00289 self.triangles = None
00290 end = 0
00291 _x = self
00292 start = end
00293 end += 12
00294 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00295 start = end
00296 end += 4
00297 (length,) = _struct_I.unpack(str[start:end])
00298 start = end
00299 end += length
00300 if python3:
00301 self.header.frame_id = str[start:end].decode('utf-8')
00302 else:
00303 self.header.frame_id = str[start:end]
00304 start = end
00305 end += 4
00306 (length,) = _struct_I.unpack(str[start:end])
00307 self.points = []
00308 for i in range(0, length):
00309 val1 = geometry_msgs.msg.Point32()
00310 _x = val1
00311 start = end
00312 end += 12
00313 (_x.x, _x.y, _x.z,) = _struct_3f.unpack(str[start:end])
00314 self.points.append(val1)
00315 start = end
00316 end += 4
00317 (length,) = _struct_I.unpack(str[start:end])
00318 self.normals = []
00319 for i in range(0, length):
00320 val1 = geometry_msgs.msg.Point32()
00321 _x = val1
00322 start = end
00323 end += 12
00324 (_x.x, _x.y, _x.z,) = _struct_3f.unpack(str[start:end])
00325 self.normals.append(val1)
00326 start = end
00327 end += 4
00328 (length,) = _struct_I.unpack(str[start:end])
00329 pattern = '<%sf'%length
00330 start = end
00331 end += struct.calcsize(pattern)
00332 self.intensities = numpy.frombuffer(str[start:end], dtype=numpy.float32, count=length)
00333 start = end
00334 end += 4
00335 (length,) = _struct_I.unpack(str[start:end])
00336 self.triangles = []
00337 for i in range(0, length):
00338 val1 = triangle_mesh_msgs.msg.Triangle()
00339 _x = val1
00340 start = end
00341 end += 12
00342 (_x.i, _x.j, _x.k,) = _struct_3i.unpack(str[start:end])
00343 self.triangles.append(val1)
00344 start = end
00345 end += 4
00346 (length,) = _struct_I.unpack(str[start:end])
00347 start = end
00348 end += length
00349 if python3:
00350 self.sending_node = str[start:end].decode('utf-8')
00351 else:
00352 self.sending_node = str[start:end]
00353 return self
00354 except struct.error as e:
00355 raise genpy.DeserializationError(e)
00356
00357 _struct_I = genpy.struct_I
00358 _struct_3I = struct.Struct("<3I")
00359 _struct_3f = struct.Struct("<3f")
00360 _struct_3i = struct.Struct("<3i")