_GetPointCloud2.py
Go to the documentation of this file.
00001 """autogenerated by genpy from iri_perception_msgs/GetPointCloud2Request.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 GetPointCloud2Request(genpy.Message):
00010   _md5sum = "da4ede05762bddf2e818de794fef9cff"
00011   _type = "iri_perception_msgs/GetPointCloud2Request"
00012   _has_header = False #flag to mark the presence of a Header object
00013   _full_text = """
00014 std_msgs/String topic
00015 
00016 ================================================================================
00017 MSG: std_msgs/String
00018 string data
00019 
00020 """
00021   __slots__ = ['topic']
00022   _slot_types = ['std_msgs/String']
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        topic
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(GetPointCloud2Request, self).__init__(*args, **kwds)
00040       #message fields cannot be None, assign default values for those that are
00041       if self.topic is None:
00042         self.topic = std_msgs.msg.String()
00043     else:
00044       self.topic = std_msgs.msg.String()
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       _x = self.topic.data
00059       length = len(_x)
00060       if python3 or type(_x) == unicode:
00061         _x = _x.encode('utf-8')
00062         length = len(_x)
00063       buff.write(struct.pack('<I%ss'%length, length, _x))
00064     except struct.error as se: self._check_types(se)
00065     except TypeError as te: self._check_types(te)
00066 
00067   def deserialize(self, str):
00068     """
00069     unpack serialized message in str into this message instance
00070     :param str: byte array of serialized message, ``str``
00071     """
00072     try:
00073       if self.topic is None:
00074         self.topic = std_msgs.msg.String()
00075       end = 0
00076       start = end
00077       end += 4
00078       (length,) = _struct_I.unpack(str[start:end])
00079       start = end
00080       end += length
00081       if python3:
00082         self.topic.data = str[start:end].decode('utf-8')
00083       else:
00084         self.topic.data = str[start:end]
00085       return self
00086     except struct.error as e:
00087       raise genpy.DeserializationError(e) #most likely buffer underfill
00088 
00089 
00090   def serialize_numpy(self, buff, numpy):
00091     """
00092     serialize message with numpy array types into buffer
00093     :param buff: buffer, ``StringIO``
00094     :param numpy: numpy python module
00095     """
00096     try:
00097       _x = self.topic.data
00098       length = len(_x)
00099       if python3 or type(_x) == unicode:
00100         _x = _x.encode('utf-8')
00101         length = len(_x)
00102       buff.write(struct.pack('<I%ss'%length, length, _x))
00103     except struct.error as se: self._check_types(se)
00104     except TypeError as te: self._check_types(te)
00105 
00106   def deserialize_numpy(self, str, numpy):
00107     """
00108     unpack serialized message in str into this message instance using numpy for array types
00109     :param str: byte array of serialized message, ``str``
00110     :param numpy: numpy python module
00111     """
00112     try:
00113       if self.topic is None:
00114         self.topic = std_msgs.msg.String()
00115       end = 0
00116       start = end
00117       end += 4
00118       (length,) = _struct_I.unpack(str[start:end])
00119       start = end
00120       end += length
00121       if python3:
00122         self.topic.data = str[start:end].decode('utf-8')
00123       else:
00124         self.topic.data = str[start:end]
00125       return self
00126     except struct.error as e:
00127       raise genpy.DeserializationError(e) #most likely buffer underfill
00128 
00129 _struct_I = genpy.struct_I
00130 """autogenerated by genpy from iri_perception_msgs/GetPointCloud2Response.msg. Do not edit."""
00131 import sys
00132 python3 = True if sys.hexversion > 0x03000000 else False
00133 import genpy
00134 import struct
00135 
00136 import std_msgs.msg
00137 import sensor_msgs.msg
00138 
00139 class GetPointCloud2Response(genpy.Message):
00140   _md5sum = "56680b720436a8fbd002ea7abe6966e1"
00141   _type = "iri_perception_msgs/GetPointCloud2Response"
00142   _has_header = False #flag to mark the presence of a Header object
00143   _full_text = """
00144 sensor_msgs/PointCloud2 pointcloud
00145 
00146 
00147 ================================================================================
00148 MSG: sensor_msgs/PointCloud2
00149 # This message holds a collection of N-dimensional points, which may
00150 # contain additional information such as normals, intensity, etc. The
00151 # point data is stored as a binary blob, its layout described by the
00152 # contents of the "fields" array.
00153 
00154 # The point cloud data may be organized 2d (image-like) or 1d
00155 # (unordered). Point clouds organized as 2d images may be produced by
00156 # camera depth sensors such as stereo or time-of-flight.
00157 
00158 # Time of sensor data acquisition, and the coordinate frame ID (for 3d
00159 # points).
00160 Header header
00161 
00162 # 2D structure of the point cloud. If the cloud is unordered, height is
00163 # 1 and width is the length of the point cloud.
00164 uint32 height
00165 uint32 width
00166 
00167 # Describes the channels and their layout in the binary data blob.
00168 PointField[] fields
00169 
00170 bool    is_bigendian # Is this data bigendian?
00171 uint32  point_step   # Length of a point in bytes
00172 uint32  row_step     # Length of a row in bytes
00173 uint8[] data         # Actual point data, size is (row_step*height)
00174 
00175 bool is_dense        # True if there are no invalid points
00176 
00177 ================================================================================
00178 MSG: std_msgs/Header
00179 # Standard metadata for higher-level stamped data types.
00180 # This is generally used to communicate timestamped data 
00181 # in a particular coordinate frame.
00182 # 
00183 # sequence ID: consecutively increasing ID 
00184 uint32 seq
00185 #Two-integer timestamp that is expressed as:
00186 # * stamp.secs: seconds (stamp_secs) since epoch
00187 # * stamp.nsecs: nanoseconds since stamp_secs
00188 # time-handling sugar is provided by the client library
00189 time stamp
00190 #Frame this data is associated with
00191 # 0: no frame
00192 # 1: global frame
00193 string frame_id
00194 
00195 ================================================================================
00196 MSG: sensor_msgs/PointField
00197 # This message holds the description of one point entry in the
00198 # PointCloud2 message format.
00199 uint8 INT8    = 1
00200 uint8 UINT8   = 2
00201 uint8 INT16   = 3
00202 uint8 UINT16  = 4
00203 uint8 INT32   = 5
00204 uint8 UINT32  = 6
00205 uint8 FLOAT32 = 7
00206 uint8 FLOAT64 = 8
00207 
00208 string name      # Name of field
00209 uint32 offset    # Offset from start of point struct
00210 uint8  datatype  # Datatype enumeration, see above
00211 uint32 count     # How many elements in the field
00212 
00213 """
00214   __slots__ = ['pointcloud']
00215   _slot_types = ['sensor_msgs/PointCloud2']
00216 
00217   def __init__(self, *args, **kwds):
00218     """
00219     Constructor. Any message fields that are implicitly/explicitly
00220     set to None will be assigned a default value. The recommend
00221     use is keyword arguments as this is more robust to future message
00222     changes.  You cannot mix in-order arguments and keyword arguments.
00223 
00224     The available fields are:
00225        pointcloud
00226 
00227     :param args: complete set of field values, in .msg order
00228     :param kwds: use keyword arguments corresponding to message field names
00229     to set specific fields.
00230     """
00231     if args or kwds:
00232       super(GetPointCloud2Response, self).__init__(*args, **kwds)
00233       #message fields cannot be None, assign default values for those that are
00234       if self.pointcloud is None:
00235         self.pointcloud = sensor_msgs.msg.PointCloud2()
00236     else:
00237       self.pointcloud = sensor_msgs.msg.PointCloud2()
00238 
00239   def _get_types(self):
00240     """
00241     internal API method
00242     """
00243     return self._slot_types
00244 
00245   def serialize(self, buff):
00246     """
00247     serialize message into buffer
00248     :param buff: buffer, ``StringIO``
00249     """
00250     try:
00251       _x = self
00252       buff.write(_struct_3I.pack(_x.pointcloud.header.seq, _x.pointcloud.header.stamp.secs, _x.pointcloud.header.stamp.nsecs))
00253       _x = self.pointcloud.header.frame_id
00254       length = len(_x)
00255       if python3 or type(_x) == unicode:
00256         _x = _x.encode('utf-8')
00257         length = len(_x)
00258       buff.write(struct.pack('<I%ss'%length, length, _x))
00259       _x = self
00260       buff.write(_struct_2I.pack(_x.pointcloud.height, _x.pointcloud.width))
00261       length = len(self.pointcloud.fields)
00262       buff.write(_struct_I.pack(length))
00263       for val1 in self.pointcloud.fields:
00264         _x = val1.name
00265         length = len(_x)
00266         if python3 or type(_x) == unicode:
00267           _x = _x.encode('utf-8')
00268           length = len(_x)
00269         buff.write(struct.pack('<I%ss'%length, length, _x))
00270         _x = val1
00271         buff.write(_struct_IBI.pack(_x.offset, _x.datatype, _x.count))
00272       _x = self
00273       buff.write(_struct_B2I.pack(_x.pointcloud.is_bigendian, _x.pointcloud.point_step, _x.pointcloud.row_step))
00274       _x = self.pointcloud.data
00275       length = len(_x)
00276       # - if encoded as a list instead, serialize as bytes instead of string
00277       if type(_x) in [list, tuple]:
00278         buff.write(struct.pack('<I%sB'%length, length, *_x))
00279       else:
00280         buff.write(struct.pack('<I%ss'%length, length, _x))
00281       buff.write(_struct_B.pack(self.pointcloud.is_dense))
00282     except struct.error as se: self._check_types(se)
00283     except TypeError as te: self._check_types(te)
00284 
00285   def deserialize(self, str):
00286     """
00287     unpack serialized message in str into this message instance
00288     :param str: byte array of serialized message, ``str``
00289     """
00290     try:
00291       if self.pointcloud is None:
00292         self.pointcloud = sensor_msgs.msg.PointCloud2()
00293       end = 0
00294       _x = self
00295       start = end
00296       end += 12
00297       (_x.pointcloud.header.seq, _x.pointcloud.header.stamp.secs, _x.pointcloud.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00298       start = end
00299       end += 4
00300       (length,) = _struct_I.unpack(str[start:end])
00301       start = end
00302       end += length
00303       if python3:
00304         self.pointcloud.header.frame_id = str[start:end].decode('utf-8')
00305       else:
00306         self.pointcloud.header.frame_id = str[start:end]
00307       _x = self
00308       start = end
00309       end += 8
00310       (_x.pointcloud.height, _x.pointcloud.width,) = _struct_2I.unpack(str[start:end])
00311       start = end
00312       end += 4
00313       (length,) = _struct_I.unpack(str[start:end])
00314       self.pointcloud.fields = []
00315       for i in range(0, length):
00316         val1 = sensor_msgs.msg.PointField()
00317         start = end
00318         end += 4
00319         (length,) = _struct_I.unpack(str[start:end])
00320         start = end
00321         end += length
00322         if python3:
00323           val1.name = str[start:end].decode('utf-8')
00324         else:
00325           val1.name = str[start:end]
00326         _x = val1
00327         start = end
00328         end += 9
00329         (_x.offset, _x.datatype, _x.count,) = _struct_IBI.unpack(str[start:end])
00330         self.pointcloud.fields.append(val1)
00331       _x = self
00332       start = end
00333       end += 9
00334       (_x.pointcloud.is_bigendian, _x.pointcloud.point_step, _x.pointcloud.row_step,) = _struct_B2I.unpack(str[start:end])
00335       self.pointcloud.is_bigendian = bool(self.pointcloud.is_bigendian)
00336       start = end
00337       end += 4
00338       (length,) = _struct_I.unpack(str[start:end])
00339       start = end
00340       end += length
00341       if python3:
00342         self.pointcloud.data = str[start:end].decode('utf-8')
00343       else:
00344         self.pointcloud.data = str[start:end]
00345       start = end
00346       end += 1
00347       (self.pointcloud.is_dense,) = _struct_B.unpack(str[start:end])
00348       self.pointcloud.is_dense = bool(self.pointcloud.is_dense)
00349       return self
00350     except struct.error as e:
00351       raise genpy.DeserializationError(e) #most likely buffer underfill
00352 
00353 
00354   def serialize_numpy(self, buff, numpy):
00355     """
00356     serialize message with numpy array types into buffer
00357     :param buff: buffer, ``StringIO``
00358     :param numpy: numpy python module
00359     """
00360     try:
00361       _x = self
00362       buff.write(_struct_3I.pack(_x.pointcloud.header.seq, _x.pointcloud.header.stamp.secs, _x.pointcloud.header.stamp.nsecs))
00363       _x = self.pointcloud.header.frame_id
00364       length = len(_x)
00365       if python3 or type(_x) == unicode:
00366         _x = _x.encode('utf-8')
00367         length = len(_x)
00368       buff.write(struct.pack('<I%ss'%length, length, _x))
00369       _x = self
00370       buff.write(_struct_2I.pack(_x.pointcloud.height, _x.pointcloud.width))
00371       length = len(self.pointcloud.fields)
00372       buff.write(_struct_I.pack(length))
00373       for val1 in self.pointcloud.fields:
00374         _x = val1.name
00375         length = len(_x)
00376         if python3 or type(_x) == unicode:
00377           _x = _x.encode('utf-8')
00378           length = len(_x)
00379         buff.write(struct.pack('<I%ss'%length, length, _x))
00380         _x = val1
00381         buff.write(_struct_IBI.pack(_x.offset, _x.datatype, _x.count))
00382       _x = self
00383       buff.write(_struct_B2I.pack(_x.pointcloud.is_bigendian, _x.pointcloud.point_step, _x.pointcloud.row_step))
00384       _x = self.pointcloud.data
00385       length = len(_x)
00386       # - if encoded as a list instead, serialize as bytes instead of string
00387       if type(_x) in [list, tuple]:
00388         buff.write(struct.pack('<I%sB'%length, length, *_x))
00389       else:
00390         buff.write(struct.pack('<I%ss'%length, length, _x))
00391       buff.write(_struct_B.pack(self.pointcloud.is_dense))
00392     except struct.error as se: self._check_types(se)
00393     except TypeError as te: self._check_types(te)
00394 
00395   def deserialize_numpy(self, str, numpy):
00396     """
00397     unpack serialized message in str into this message instance using numpy for array types
00398     :param str: byte array of serialized message, ``str``
00399     :param numpy: numpy python module
00400     """
00401     try:
00402       if self.pointcloud is None:
00403         self.pointcloud = sensor_msgs.msg.PointCloud2()
00404       end = 0
00405       _x = self
00406       start = end
00407       end += 12
00408       (_x.pointcloud.header.seq, _x.pointcloud.header.stamp.secs, _x.pointcloud.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00409       start = end
00410       end += 4
00411       (length,) = _struct_I.unpack(str[start:end])
00412       start = end
00413       end += length
00414       if python3:
00415         self.pointcloud.header.frame_id = str[start:end].decode('utf-8')
00416       else:
00417         self.pointcloud.header.frame_id = str[start:end]
00418       _x = self
00419       start = end
00420       end += 8
00421       (_x.pointcloud.height, _x.pointcloud.width,) = _struct_2I.unpack(str[start:end])
00422       start = end
00423       end += 4
00424       (length,) = _struct_I.unpack(str[start:end])
00425       self.pointcloud.fields = []
00426       for i in range(0, length):
00427         val1 = sensor_msgs.msg.PointField()
00428         start = end
00429         end += 4
00430         (length,) = _struct_I.unpack(str[start:end])
00431         start = end
00432         end += length
00433         if python3:
00434           val1.name = str[start:end].decode('utf-8')
00435         else:
00436           val1.name = str[start:end]
00437         _x = val1
00438         start = end
00439         end += 9
00440         (_x.offset, _x.datatype, _x.count,) = _struct_IBI.unpack(str[start:end])
00441         self.pointcloud.fields.append(val1)
00442       _x = self
00443       start = end
00444       end += 9
00445       (_x.pointcloud.is_bigendian, _x.pointcloud.point_step, _x.pointcloud.row_step,) = _struct_B2I.unpack(str[start:end])
00446       self.pointcloud.is_bigendian = bool(self.pointcloud.is_bigendian)
00447       start = end
00448       end += 4
00449       (length,) = _struct_I.unpack(str[start:end])
00450       start = end
00451       end += length
00452       if python3:
00453         self.pointcloud.data = str[start:end].decode('utf-8')
00454       else:
00455         self.pointcloud.data = str[start:end]
00456       start = end
00457       end += 1
00458       (self.pointcloud.is_dense,) = _struct_B.unpack(str[start:end])
00459       self.pointcloud.is_dense = bool(self.pointcloud.is_dense)
00460       return self
00461     except struct.error as e:
00462       raise genpy.DeserializationError(e) #most likely buffer underfill
00463 
00464 _struct_I = genpy.struct_I
00465 _struct_IBI = struct.Struct("<IBI")
00466 _struct_3I = struct.Struct("<3I")
00467 _struct_B = struct.Struct("<B")
00468 _struct_2I = struct.Struct("<2I")
00469 _struct_B2I = struct.Struct("<B2I")
00470 class GetPointCloud2(object):
00471   _type          = 'iri_perception_msgs/GetPointCloud2'
00472   _md5sum = '01c7edcac8d431f096918c8b3289b2c2'
00473   _request_class  = GetPointCloud2Request
00474   _response_class = GetPointCloud2Response


iri_perception_msgs
Author(s):
autogenerated on Fri Dec 6 2013 20:02:15