_TriangulatePCL.py
Go to the documentation of this file.
00001 """autogenerated by genpy from triangulate_point_cloud/TriangulatePCLRequest.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 std_msgs.msg
00009 import sensor_msgs.msg
00010 
00011 class TriangulatePCLRequest(genpy.Message):
00012   _md5sum = "54a80efa9f266878f68875ef84938b67"
00013   _type = "triangulate_point_cloud/TriangulatePCLRequest"
00014   _has_header = False #flag to mark the presence of a Header object
00015   _full_text = """sensor_msgs/PointCloud points
00016 
00017 ================================================================================
00018 MSG: sensor_msgs/PointCloud
00019 # This message holds a collection of 3d points, plus optional additional
00020 # information about each point.
00021 
00022 # Time of sensor data acquisition, coordinate frame ID.
00023 Header header
00024 
00025 # Array of 3d points. Each Point32 should be interpreted as a 3d point
00026 # in the frame given in the header.
00027 geometry_msgs/Point32[] points
00028 
00029 # Each channel should have the same number of elements as points array,
00030 # and the data in each channel should correspond 1:1 with each point.
00031 # Channel names in common practice are listed in ChannelFloat32.msg.
00032 ChannelFloat32[] channels
00033 
00034 ================================================================================
00035 MSG: std_msgs/Header
00036 # Standard metadata for higher-level stamped data types.
00037 # This is generally used to communicate timestamped data 
00038 # in a particular coordinate frame.
00039 # 
00040 # sequence ID: consecutively increasing ID 
00041 uint32 seq
00042 #Two-integer timestamp that is expressed as:
00043 # * stamp.secs: seconds (stamp_secs) since epoch
00044 # * stamp.nsecs: nanoseconds since stamp_secs
00045 # time-handling sugar is provided by the client library
00046 time stamp
00047 #Frame this data is associated with
00048 # 0: no frame
00049 # 1: global frame
00050 string frame_id
00051 
00052 ================================================================================
00053 MSG: geometry_msgs/Point32
00054 # This contains the position of a point in free space(with 32 bits of precision).
00055 # It is recommeded to use Point wherever possible instead of Point32.  
00056 # 
00057 # This recommendation is to promote interoperability.  
00058 #
00059 # This message is designed to take up less space when sending
00060 # lots of points at once, as in the case of a PointCloud.  
00061 
00062 float32 x
00063 float32 y
00064 float32 z
00065 ================================================================================
00066 MSG: sensor_msgs/ChannelFloat32
00067 # This message is used by the PointCloud message to hold optional data
00068 # associated with each point in the cloud. The length of the values
00069 # array should be the same as the length of the points array in the
00070 # PointCloud, and each value should be associated with the corresponding
00071 # point.
00072 
00073 # Channel names in existing practice include:
00074 #   "u", "v" - row and column (respectively) in the left stereo image.
00075 #              This is opposite to usual conventions but remains for
00076 #              historical reasons. The newer PointCloud2 message has no
00077 #              such problem.
00078 #   "rgb" - For point clouds produced by color stereo cameras. uint8
00079 #           (R,G,B) values packed into the least significant 24 bits,
00080 #           in order.
00081 #   "intensity" - laser or pixel intensity.
00082 #   "distance"
00083 
00084 # The channel name should give semantics of the channel (e.g.
00085 # "intensity" instead of "value").
00086 string name
00087 
00088 # The values array should be 1-1 with the elements of the associated
00089 # PointCloud.
00090 float32[] values
00091 
00092 """
00093   __slots__ = ['points']
00094   _slot_types = ['sensor_msgs/PointCloud']
00095 
00096   def __init__(self, *args, **kwds):
00097     """
00098     Constructor. Any message fields that are implicitly/explicitly
00099     set to None will be assigned a default value. The recommend
00100     use is keyword arguments as this is more robust to future message
00101     changes.  You cannot mix in-order arguments and keyword arguments.
00102 
00103     The available fields are:
00104        points
00105 
00106     :param args: complete set of field values, in .msg order
00107     :param kwds: use keyword arguments corresponding to message field names
00108     to set specific fields.
00109     """
00110     if args or kwds:
00111       super(TriangulatePCLRequest, self).__init__(*args, **kwds)
00112       #message fields cannot be None, assign default values for those that are
00113       if self.points is None:
00114         self.points = sensor_msgs.msg.PointCloud()
00115     else:
00116       self.points = sensor_msgs.msg.PointCloud()
00117 
00118   def _get_types(self):
00119     """
00120     internal API method
00121     """
00122     return self._slot_types
00123 
00124   def serialize(self, buff):
00125     """
00126     serialize message into buffer
00127     :param buff: buffer, ``StringIO``
00128     """
00129     try:
00130       _x = self
00131       buff.write(_struct_3I.pack(_x.points.header.seq, _x.points.header.stamp.secs, _x.points.header.stamp.nsecs))
00132       _x = self.points.header.frame_id
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       length = len(self.points.points)
00139       buff.write(_struct_I.pack(length))
00140       for val1 in self.points.points:
00141         _x = val1
00142         buff.write(_struct_3f.pack(_x.x, _x.y, _x.z))
00143       length = len(self.points.channels)
00144       buff.write(_struct_I.pack(length))
00145       for val1 in self.points.channels:
00146         _x = val1.name
00147         length = len(_x)
00148         if python3 or type(_x) == unicode:
00149           _x = _x.encode('utf-8')
00150           length = len(_x)
00151         buff.write(struct.pack('<I%ss'%length, length, _x))
00152         length = len(val1.values)
00153         buff.write(_struct_I.pack(length))
00154         pattern = '<%sf'%length
00155         buff.write(struct.pack(pattern, *val1.values))
00156     except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00157     except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00158 
00159   def deserialize(self, str):
00160     """
00161     unpack serialized message in str into this message instance
00162     :param str: byte array of serialized message, ``str``
00163     """
00164     try:
00165       if self.points is None:
00166         self.points = sensor_msgs.msg.PointCloud()
00167       end = 0
00168       _x = self
00169       start = end
00170       end += 12
00171       (_x.points.header.seq, _x.points.header.stamp.secs, _x.points.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00172       start = end
00173       end += 4
00174       (length,) = _struct_I.unpack(str[start:end])
00175       start = end
00176       end += length
00177       if python3:
00178         self.points.header.frame_id = str[start:end].decode('utf-8')
00179       else:
00180         self.points.header.frame_id = str[start:end]
00181       start = end
00182       end += 4
00183       (length,) = _struct_I.unpack(str[start:end])
00184       self.points.points = []
00185       for i in range(0, length):
00186         val1 = geometry_msgs.msg.Point32()
00187         _x = val1
00188         start = end
00189         end += 12
00190         (_x.x, _x.y, _x.z,) = _struct_3f.unpack(str[start:end])
00191         self.points.points.append(val1)
00192       start = end
00193       end += 4
00194       (length,) = _struct_I.unpack(str[start:end])
00195       self.points.channels = []
00196       for i in range(0, length):
00197         val1 = sensor_msgs.msg.ChannelFloat32()
00198         start = end
00199         end += 4
00200         (length,) = _struct_I.unpack(str[start:end])
00201         start = end
00202         end += length
00203         if python3:
00204           val1.name = str[start:end].decode('utf-8')
00205         else:
00206           val1.name = str[start:end]
00207         start = end
00208         end += 4
00209         (length,) = _struct_I.unpack(str[start:end])
00210         pattern = '<%sf'%length
00211         start = end
00212         end += struct.calcsize(pattern)
00213         val1.values = struct.unpack(pattern, str[start:end])
00214         self.points.channels.append(val1)
00215       return self
00216     except struct.error as e:
00217       raise genpy.DeserializationError(e) #most likely buffer underfill
00218 
00219 
00220   def serialize_numpy(self, buff, numpy):
00221     """
00222     serialize message with numpy array types into buffer
00223     :param buff: buffer, ``StringIO``
00224     :param numpy: numpy python module
00225     """
00226     try:
00227       _x = self
00228       buff.write(_struct_3I.pack(_x.points.header.seq, _x.points.header.stamp.secs, _x.points.header.stamp.nsecs))
00229       _x = self.points.header.frame_id
00230       length = len(_x)
00231       if python3 or type(_x) == unicode:
00232         _x = _x.encode('utf-8')
00233         length = len(_x)
00234       buff.write(struct.pack('<I%ss'%length, length, _x))
00235       length = len(self.points.points)
00236       buff.write(_struct_I.pack(length))
00237       for val1 in self.points.points:
00238         _x = val1
00239         buff.write(_struct_3f.pack(_x.x, _x.y, _x.z))
00240       length = len(self.points.channels)
00241       buff.write(_struct_I.pack(length))
00242       for val1 in self.points.channels:
00243         _x = val1.name
00244         length = len(_x)
00245         if python3 or type(_x) == unicode:
00246           _x = _x.encode('utf-8')
00247           length = len(_x)
00248         buff.write(struct.pack('<I%ss'%length, length, _x))
00249         length = len(val1.values)
00250         buff.write(_struct_I.pack(length))
00251         pattern = '<%sf'%length
00252         buff.write(val1.values.tostring())
00253     except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00254     except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00255 
00256   def deserialize_numpy(self, str, numpy):
00257     """
00258     unpack serialized message in str into this message instance using numpy for array types
00259     :param str: byte array of serialized message, ``str``
00260     :param numpy: numpy python module
00261     """
00262     try:
00263       if self.points is None:
00264         self.points = sensor_msgs.msg.PointCloud()
00265       end = 0
00266       _x = self
00267       start = end
00268       end += 12
00269       (_x.points.header.seq, _x.points.header.stamp.secs, _x.points.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00270       start = end
00271       end += 4
00272       (length,) = _struct_I.unpack(str[start:end])
00273       start = end
00274       end += length
00275       if python3:
00276         self.points.header.frame_id = str[start:end].decode('utf-8')
00277       else:
00278         self.points.header.frame_id = str[start:end]
00279       start = end
00280       end += 4
00281       (length,) = _struct_I.unpack(str[start:end])
00282       self.points.points = []
00283       for i in range(0, length):
00284         val1 = geometry_msgs.msg.Point32()
00285         _x = val1
00286         start = end
00287         end += 12
00288         (_x.x, _x.y, _x.z,) = _struct_3f.unpack(str[start:end])
00289         self.points.points.append(val1)
00290       start = end
00291       end += 4
00292       (length,) = _struct_I.unpack(str[start:end])
00293       self.points.channels = []
00294       for i in range(0, length):
00295         val1 = sensor_msgs.msg.ChannelFloat32()
00296         start = end
00297         end += 4
00298         (length,) = _struct_I.unpack(str[start:end])
00299         start = end
00300         end += length
00301         if python3:
00302           val1.name = str[start:end].decode('utf-8')
00303         else:
00304           val1.name = str[start:end]
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         val1.values = numpy.frombuffer(str[start:end], dtype=numpy.float32, count=length)
00312         self.points.channels.append(val1)
00313       return self
00314     except struct.error as e:
00315       raise genpy.DeserializationError(e) #most likely buffer underfill
00316 
00317 _struct_I = genpy.struct_I
00318 _struct_3I = struct.Struct("<3I")
00319 _struct_3f = struct.Struct("<3f")
00320 """autogenerated by genpy from triangulate_point_cloud/TriangulatePCLResponse.msg. Do not edit."""
00321 import sys
00322 python3 = True if sys.hexversion > 0x03000000 else False
00323 import genpy
00324 import struct
00325 
00326 import geometry_msgs.msg
00327 import shape_msgs.msg
00328 
00329 class TriangulatePCLResponse(genpy.Message):
00330   _md5sum = "ce827a18ef79c9c2976446e8cd1972d2"
00331   _type = "triangulate_point_cloud/TriangulatePCLResponse"
00332   _has_header = False #flag to mark the presence of a Header object
00333   _full_text = """shape_msgs/Mesh mesh
00334 
00335 
00336 ================================================================================
00337 MSG: shape_msgs/Mesh
00338 # Definition of a mesh
00339 
00340 # list of triangles; the index values refer to positions in vertices[]
00341 MeshTriangle[] triangles
00342 
00343 # the actual vertices that make up the mesh
00344 geometry_msgs/Point[] vertices
00345 
00346 ================================================================================
00347 MSG: shape_msgs/MeshTriangle
00348 # Definition of a triangle's vertices
00349 uint32[3] vertex_indices
00350 
00351 ================================================================================
00352 MSG: geometry_msgs/Point
00353 # This contains the position of a point in free space
00354 float64 x
00355 float64 y
00356 float64 z
00357 
00358 """
00359   __slots__ = ['mesh']
00360   _slot_types = ['shape_msgs/Mesh']
00361 
00362   def __init__(self, *args, **kwds):
00363     """
00364     Constructor. Any message fields that are implicitly/explicitly
00365     set to None will be assigned a default value. The recommend
00366     use is keyword arguments as this is more robust to future message
00367     changes.  You cannot mix in-order arguments and keyword arguments.
00368 
00369     The available fields are:
00370        mesh
00371 
00372     :param args: complete set of field values, in .msg order
00373     :param kwds: use keyword arguments corresponding to message field names
00374     to set specific fields.
00375     """
00376     if args or kwds:
00377       super(TriangulatePCLResponse, self).__init__(*args, **kwds)
00378       #message fields cannot be None, assign default values for those that are
00379       if self.mesh is None:
00380         self.mesh = shape_msgs.msg.Mesh()
00381     else:
00382       self.mesh = shape_msgs.msg.Mesh()
00383 
00384   def _get_types(self):
00385     """
00386     internal API method
00387     """
00388     return self._slot_types
00389 
00390   def serialize(self, buff):
00391     """
00392     serialize message into buffer
00393     :param buff: buffer, ``StringIO``
00394     """
00395     try:
00396       length = len(self.mesh.triangles)
00397       buff.write(_struct_I.pack(length))
00398       for val1 in self.mesh.triangles:
00399         buff.write(_struct_3I.pack(*val1.vertex_indices))
00400       length = len(self.mesh.vertices)
00401       buff.write(_struct_I.pack(length))
00402       for val1 in self.mesh.vertices:
00403         _x = val1
00404         buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
00405     except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00406     except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00407 
00408   def deserialize(self, str):
00409     """
00410     unpack serialized message in str into this message instance
00411     :param str: byte array of serialized message, ``str``
00412     """
00413     try:
00414       if self.mesh is None:
00415         self.mesh = shape_msgs.msg.Mesh()
00416       end = 0
00417       start = end
00418       end += 4
00419       (length,) = _struct_I.unpack(str[start:end])
00420       self.mesh.triangles = []
00421       for i in range(0, length):
00422         val1 = shape_msgs.msg.MeshTriangle()
00423         start = end
00424         end += 12
00425         val1.vertex_indices = _struct_3I.unpack(str[start:end])
00426         self.mesh.triangles.append(val1)
00427       start = end
00428       end += 4
00429       (length,) = _struct_I.unpack(str[start:end])
00430       self.mesh.vertices = []
00431       for i in range(0, length):
00432         val1 = geometry_msgs.msg.Point()
00433         _x = val1
00434         start = end
00435         end += 24
00436         (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
00437         self.mesh.vertices.append(val1)
00438       return self
00439     except struct.error as e:
00440       raise genpy.DeserializationError(e) #most likely buffer underfill
00441 
00442 
00443   def serialize_numpy(self, buff, numpy):
00444     """
00445     serialize message with numpy array types into buffer
00446     :param buff: buffer, ``StringIO``
00447     :param numpy: numpy python module
00448     """
00449     try:
00450       length = len(self.mesh.triangles)
00451       buff.write(_struct_I.pack(length))
00452       for val1 in self.mesh.triangles:
00453         buff.write(val1.vertex_indices.tostring())
00454       length = len(self.mesh.vertices)
00455       buff.write(_struct_I.pack(length))
00456       for val1 in self.mesh.vertices:
00457         _x = val1
00458         buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
00459     except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00460     except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00461 
00462   def deserialize_numpy(self, str, numpy):
00463     """
00464     unpack serialized message in str into this message instance using numpy for array types
00465     :param str: byte array of serialized message, ``str``
00466     :param numpy: numpy python module
00467     """
00468     try:
00469       if self.mesh is None:
00470         self.mesh = shape_msgs.msg.Mesh()
00471       end = 0
00472       start = end
00473       end += 4
00474       (length,) = _struct_I.unpack(str[start:end])
00475       self.mesh.triangles = []
00476       for i in range(0, length):
00477         val1 = shape_msgs.msg.MeshTriangle()
00478         start = end
00479         end += 12
00480         val1.vertex_indices = numpy.frombuffer(str[start:end], dtype=numpy.uint32, count=3)
00481         self.mesh.triangles.append(val1)
00482       start = end
00483       end += 4
00484       (length,) = _struct_I.unpack(str[start:end])
00485       self.mesh.vertices = []
00486       for i in range(0, length):
00487         val1 = geometry_msgs.msg.Point()
00488         _x = val1
00489         start = end
00490         end += 24
00491         (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
00492         self.mesh.vertices.append(val1)
00493       return self
00494     except struct.error as e:
00495       raise genpy.DeserializationError(e) #most likely buffer underfill
00496 
00497 _struct_I = genpy.struct_I
00498 _struct_3I = struct.Struct("<3I")
00499 _struct_3d = struct.Struct("<3d")
00500 class TriangulatePCL(object):
00501   _type          = 'triangulate_point_cloud/TriangulatePCL'
00502   _md5sum = '68c672f244e02def2457a29af746bb55'
00503   _request_class  = TriangulatePCLRequest
00504   _response_class = TriangulatePCLResponse


triangulate_point_cloud
Author(s): Lorenz Moesenlechner
autogenerated on Sat Apr 26 2014 10:07:58