_PclToImg.py
Go to the documentation of this file.
00001 """autogenerated by genpy from iri_perception_msgs/PclToImgRequest.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 import sensor_msgs.msg
00009 
00010 class PclToImgRequest(genpy.Message):
00011   _md5sum = "56680b720436a8fbd002ea7abe6966e1"
00012   _type = "iri_perception_msgs/PclToImgRequest"
00013   _has_header = False #flag to mark the presence of a Header object
00014   _full_text = """
00015 sensor_msgs/PointCloud2 pointcloud
00016 
00017 ================================================================================
00018 MSG: sensor_msgs/PointCloud2
00019 # This message holds a collection of N-dimensional points, which may
00020 # contain additional information such as normals, intensity, etc. The
00021 # point data is stored as a binary blob, its layout described by the
00022 # contents of the "fields" array.
00023 
00024 # The point cloud data may be organized 2d (image-like) or 1d
00025 # (unordered). Point clouds organized as 2d images may be produced by
00026 # camera depth sensors such as stereo or time-of-flight.
00027 
00028 # Time of sensor data acquisition, and the coordinate frame ID (for 3d
00029 # points).
00030 Header header
00031 
00032 # 2D structure of the point cloud. If the cloud is unordered, height is
00033 # 1 and width is the length of the point cloud.
00034 uint32 height
00035 uint32 width
00036 
00037 # Describes the channels and their layout in the binary data blob.
00038 PointField[] fields
00039 
00040 bool    is_bigendian # Is this data bigendian?
00041 uint32  point_step   # Length of a point in bytes
00042 uint32  row_step     # Length of a row in bytes
00043 uint8[] data         # Actual point data, size is (row_step*height)
00044 
00045 bool is_dense        # True if there are no invalid points
00046 
00047 ================================================================================
00048 MSG: std_msgs/Header
00049 # Standard metadata for higher-level stamped data types.
00050 # This is generally used to communicate timestamped data 
00051 # in a particular coordinate frame.
00052 # 
00053 # sequence ID: consecutively increasing ID 
00054 uint32 seq
00055 #Two-integer timestamp that is expressed as:
00056 # * stamp.secs: seconds (stamp_secs) since epoch
00057 # * stamp.nsecs: nanoseconds since stamp_secs
00058 # time-handling sugar is provided by the client library
00059 time stamp
00060 #Frame this data is associated with
00061 # 0: no frame
00062 # 1: global frame
00063 string frame_id
00064 
00065 ================================================================================
00066 MSG: sensor_msgs/PointField
00067 # This message holds the description of one point entry in the
00068 # PointCloud2 message format.
00069 uint8 INT8    = 1
00070 uint8 UINT8   = 2
00071 uint8 INT16   = 3
00072 uint8 UINT16  = 4
00073 uint8 INT32   = 5
00074 uint8 UINT32  = 6
00075 uint8 FLOAT32 = 7
00076 uint8 FLOAT64 = 8
00077 
00078 string name      # Name of field
00079 uint32 offset    # Offset from start of point struct
00080 uint8  datatype  # Datatype enumeration, see above
00081 uint32 count     # How many elements in the field
00082 
00083 """
00084   __slots__ = ['pointcloud']
00085   _slot_types = ['sensor_msgs/PointCloud2']
00086 
00087   def __init__(self, *args, **kwds):
00088     """
00089     Constructor. Any message fields that are implicitly/explicitly
00090     set to None will be assigned a default value. The recommend
00091     use is keyword arguments as this is more robust to future message
00092     changes.  You cannot mix in-order arguments and keyword arguments.
00093 
00094     The available fields are:
00095        pointcloud
00096 
00097     :param args: complete set of field values, in .msg order
00098     :param kwds: use keyword arguments corresponding to message field names
00099     to set specific fields.
00100     """
00101     if args or kwds:
00102       super(PclToImgRequest, self).__init__(*args, **kwds)
00103       #message fields cannot be None, assign default values for those that are
00104       if self.pointcloud is None:
00105         self.pointcloud = sensor_msgs.msg.PointCloud2()
00106     else:
00107       self.pointcloud = sensor_msgs.msg.PointCloud2()
00108 
00109   def _get_types(self):
00110     """
00111     internal API method
00112     """
00113     return self._slot_types
00114 
00115   def serialize(self, buff):
00116     """
00117     serialize message into buffer
00118     :param buff: buffer, ``StringIO``
00119     """
00120     try:
00121       _x = self
00122       buff.write(_struct_3I.pack(_x.pointcloud.header.seq, _x.pointcloud.header.stamp.secs, _x.pointcloud.header.stamp.nsecs))
00123       _x = self.pointcloud.header.frame_id
00124       length = len(_x)
00125       if python3 or type(_x) == unicode:
00126         _x = _x.encode('utf-8')
00127         length = len(_x)
00128       buff.write(struct.pack('<I%ss'%length, length, _x))
00129       _x = self
00130       buff.write(_struct_2I.pack(_x.pointcloud.height, _x.pointcloud.width))
00131       length = len(self.pointcloud.fields)
00132       buff.write(_struct_I.pack(length))
00133       for val1 in self.pointcloud.fields:
00134         _x = val1.name
00135         length = len(_x)
00136         if python3 or type(_x) == unicode:
00137           _x = _x.encode('utf-8')
00138           length = len(_x)
00139         buff.write(struct.pack('<I%ss'%length, length, _x))
00140         _x = val1
00141         buff.write(_struct_IBI.pack(_x.offset, _x.datatype, _x.count))
00142       _x = self
00143       buff.write(_struct_B2I.pack(_x.pointcloud.is_bigendian, _x.pointcloud.point_step, _x.pointcloud.row_step))
00144       _x = self.pointcloud.data
00145       length = len(_x)
00146       # - if encoded as a list instead, serialize as bytes instead of string
00147       if type(_x) in [list, tuple]:
00148         buff.write(struct.pack('<I%sB'%length, length, *_x))
00149       else:
00150         buff.write(struct.pack('<I%ss'%length, length, _x))
00151       buff.write(_struct_B.pack(self.pointcloud.is_dense))
00152     except struct.error as se: self._check_types(se)
00153     except TypeError as te: self._check_types(te)
00154 
00155   def deserialize(self, str):
00156     """
00157     unpack serialized message in str into this message instance
00158     :param str: byte array of serialized message, ``str``
00159     """
00160     try:
00161       if self.pointcloud is None:
00162         self.pointcloud = sensor_msgs.msg.PointCloud2()
00163       end = 0
00164       _x = self
00165       start = end
00166       end += 12
00167       (_x.pointcloud.header.seq, _x.pointcloud.header.stamp.secs, _x.pointcloud.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00168       start = end
00169       end += 4
00170       (length,) = _struct_I.unpack(str[start:end])
00171       start = end
00172       end += length
00173       if python3:
00174         self.pointcloud.header.frame_id = str[start:end].decode('utf-8')
00175       else:
00176         self.pointcloud.header.frame_id = str[start:end]
00177       _x = self
00178       start = end
00179       end += 8
00180       (_x.pointcloud.height, _x.pointcloud.width,) = _struct_2I.unpack(str[start:end])
00181       start = end
00182       end += 4
00183       (length,) = _struct_I.unpack(str[start:end])
00184       self.pointcloud.fields = []
00185       for i in range(0, length):
00186         val1 = sensor_msgs.msg.PointField()
00187         start = end
00188         end += 4
00189         (length,) = _struct_I.unpack(str[start:end])
00190         start = end
00191         end += length
00192         if python3:
00193           val1.name = str[start:end].decode('utf-8')
00194         else:
00195           val1.name = str[start:end]
00196         _x = val1
00197         start = end
00198         end += 9
00199         (_x.offset, _x.datatype, _x.count,) = _struct_IBI.unpack(str[start:end])
00200         self.pointcloud.fields.append(val1)
00201       _x = self
00202       start = end
00203       end += 9
00204       (_x.pointcloud.is_bigendian, _x.pointcloud.point_step, _x.pointcloud.row_step,) = _struct_B2I.unpack(str[start:end])
00205       self.pointcloud.is_bigendian = bool(self.pointcloud.is_bigendian)
00206       start = end
00207       end += 4
00208       (length,) = _struct_I.unpack(str[start:end])
00209       start = end
00210       end += length
00211       if python3:
00212         self.pointcloud.data = str[start:end].decode('utf-8')
00213       else:
00214         self.pointcloud.data = str[start:end]
00215       start = end
00216       end += 1
00217       (self.pointcloud.is_dense,) = _struct_B.unpack(str[start:end])
00218       self.pointcloud.is_dense = bool(self.pointcloud.is_dense)
00219       return self
00220     except struct.error as e:
00221       raise genpy.DeserializationError(e) #most likely buffer underfill
00222 
00223 
00224   def serialize_numpy(self, buff, numpy):
00225     """
00226     serialize message with numpy array types into buffer
00227     :param buff: buffer, ``StringIO``
00228     :param numpy: numpy python module
00229     """
00230     try:
00231       _x = self
00232       buff.write(_struct_3I.pack(_x.pointcloud.header.seq, _x.pointcloud.header.stamp.secs, _x.pointcloud.header.stamp.nsecs))
00233       _x = self.pointcloud.header.frame_id
00234       length = len(_x)
00235       if python3 or type(_x) == unicode:
00236         _x = _x.encode('utf-8')
00237         length = len(_x)
00238       buff.write(struct.pack('<I%ss'%length, length, _x))
00239       _x = self
00240       buff.write(_struct_2I.pack(_x.pointcloud.height, _x.pointcloud.width))
00241       length = len(self.pointcloud.fields)
00242       buff.write(_struct_I.pack(length))
00243       for val1 in self.pointcloud.fields:
00244         _x = val1.name
00245         length = len(_x)
00246         if python3 or type(_x) == unicode:
00247           _x = _x.encode('utf-8')
00248           length = len(_x)
00249         buff.write(struct.pack('<I%ss'%length, length, _x))
00250         _x = val1
00251         buff.write(_struct_IBI.pack(_x.offset, _x.datatype, _x.count))
00252       _x = self
00253       buff.write(_struct_B2I.pack(_x.pointcloud.is_bigendian, _x.pointcloud.point_step, _x.pointcloud.row_step))
00254       _x = self.pointcloud.data
00255       length = len(_x)
00256       # - if encoded as a list instead, serialize as bytes instead of string
00257       if type(_x) in [list, tuple]:
00258         buff.write(struct.pack('<I%sB'%length, length, *_x))
00259       else:
00260         buff.write(struct.pack('<I%ss'%length, length, _x))
00261       buff.write(_struct_B.pack(self.pointcloud.is_dense))
00262     except struct.error as se: self._check_types(se)
00263     except TypeError as te: self._check_types(te)
00264 
00265   def deserialize_numpy(self, str, numpy):
00266     """
00267     unpack serialized message in str into this message instance using numpy for array types
00268     :param str: byte array of serialized message, ``str``
00269     :param numpy: numpy python module
00270     """
00271     try:
00272       if self.pointcloud is None:
00273         self.pointcloud = sensor_msgs.msg.PointCloud2()
00274       end = 0
00275       _x = self
00276       start = end
00277       end += 12
00278       (_x.pointcloud.header.seq, _x.pointcloud.header.stamp.secs, _x.pointcloud.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00279       start = end
00280       end += 4
00281       (length,) = _struct_I.unpack(str[start:end])
00282       start = end
00283       end += length
00284       if python3:
00285         self.pointcloud.header.frame_id = str[start:end].decode('utf-8')
00286       else:
00287         self.pointcloud.header.frame_id = str[start:end]
00288       _x = self
00289       start = end
00290       end += 8
00291       (_x.pointcloud.height, _x.pointcloud.width,) = _struct_2I.unpack(str[start:end])
00292       start = end
00293       end += 4
00294       (length,) = _struct_I.unpack(str[start:end])
00295       self.pointcloud.fields = []
00296       for i in range(0, length):
00297         val1 = sensor_msgs.msg.PointField()
00298         start = end
00299         end += 4
00300         (length,) = _struct_I.unpack(str[start:end])
00301         start = end
00302         end += length
00303         if python3:
00304           val1.name = str[start:end].decode('utf-8')
00305         else:
00306           val1.name = str[start:end]
00307         _x = val1
00308         start = end
00309         end += 9
00310         (_x.offset, _x.datatype, _x.count,) = _struct_IBI.unpack(str[start:end])
00311         self.pointcloud.fields.append(val1)
00312       _x = self
00313       start = end
00314       end += 9
00315       (_x.pointcloud.is_bigendian, _x.pointcloud.point_step, _x.pointcloud.row_step,) = _struct_B2I.unpack(str[start:end])
00316       self.pointcloud.is_bigendian = bool(self.pointcloud.is_bigendian)
00317       start = end
00318       end += 4
00319       (length,) = _struct_I.unpack(str[start:end])
00320       start = end
00321       end += length
00322       if python3:
00323         self.pointcloud.data = str[start:end].decode('utf-8')
00324       else:
00325         self.pointcloud.data = str[start:end]
00326       start = end
00327       end += 1
00328       (self.pointcloud.is_dense,) = _struct_B.unpack(str[start:end])
00329       self.pointcloud.is_dense = bool(self.pointcloud.is_dense)
00330       return self
00331     except struct.error as e:
00332       raise genpy.DeserializationError(e) #most likely buffer underfill
00333 
00334 _struct_I = genpy.struct_I
00335 _struct_IBI = struct.Struct("<IBI")
00336 _struct_3I = struct.Struct("<3I")
00337 _struct_B = struct.Struct("<B")
00338 _struct_2I = struct.Struct("<2I")
00339 _struct_B2I = struct.Struct("<B2I")
00340 """autogenerated by genpy from iri_perception_msgs/PclToImgResponse.msg. Do not edit."""
00341 import sys
00342 python3 = True if sys.hexversion > 0x03000000 else False
00343 import genpy
00344 import struct
00345 
00346 import std_msgs.msg
00347 import sensor_msgs.msg
00348 
00349 class PclToImgResponse(genpy.Message):
00350   _md5sum = "b13d2865c5af2a64e6e30ab1b56e1dd5"
00351   _type = "iri_perception_msgs/PclToImgResponse"
00352   _has_header = False #flag to mark the presence of a Header object
00353   _full_text = """
00354 sensor_msgs/Image image
00355 
00356 
00357 ================================================================================
00358 MSG: sensor_msgs/Image
00359 # This message contains an uncompressed image
00360 # (0, 0) is at top-left corner of image
00361 #
00362 
00363 Header header        # Header timestamp should be acquisition time of image
00364                      # Header frame_id should be optical frame of camera
00365                      # origin of frame should be optical center of cameara
00366                      # +x should point to the right in the image
00367                      # +y should point down in the image
00368                      # +z should point into to plane of the image
00369                      # If the frame_id here and the frame_id of the CameraInfo
00370                      # message associated with the image conflict
00371                      # the behavior is undefined
00372 
00373 uint32 height         # image height, that is, number of rows
00374 uint32 width          # image width, that is, number of columns
00375 
00376 # The legal values for encoding are in file src/image_encodings.cpp
00377 # If you want to standardize a new string format, join
00378 # ros-users@lists.sourceforge.net and send an email proposing a new encoding.
00379 
00380 string encoding       # Encoding of pixels -- channel meaning, ordering, size
00381                       # taken from the list of strings in src/image_encodings.cpp
00382 
00383 uint8 is_bigendian    # is this data bigendian?
00384 uint32 step           # Full row length in bytes
00385 uint8[] data          # actual matrix data, size is (step * rows)
00386 
00387 ================================================================================
00388 MSG: std_msgs/Header
00389 # Standard metadata for higher-level stamped data types.
00390 # This is generally used to communicate timestamped data 
00391 # in a particular coordinate frame.
00392 # 
00393 # sequence ID: consecutively increasing ID 
00394 uint32 seq
00395 #Two-integer timestamp that is expressed as:
00396 # * stamp.secs: seconds (stamp_secs) since epoch
00397 # * stamp.nsecs: nanoseconds since stamp_secs
00398 # time-handling sugar is provided by the client library
00399 time stamp
00400 #Frame this data is associated with
00401 # 0: no frame
00402 # 1: global frame
00403 string frame_id
00404 
00405 """
00406   __slots__ = ['image']
00407   _slot_types = ['sensor_msgs/Image']
00408 
00409   def __init__(self, *args, **kwds):
00410     """
00411     Constructor. Any message fields that are implicitly/explicitly
00412     set to None will be assigned a default value. The recommend
00413     use is keyword arguments as this is more robust to future message
00414     changes.  You cannot mix in-order arguments and keyword arguments.
00415 
00416     The available fields are:
00417        image
00418 
00419     :param args: complete set of field values, in .msg order
00420     :param kwds: use keyword arguments corresponding to message field names
00421     to set specific fields.
00422     """
00423     if args or kwds:
00424       super(PclToImgResponse, self).__init__(*args, **kwds)
00425       #message fields cannot be None, assign default values for those that are
00426       if self.image is None:
00427         self.image = sensor_msgs.msg.Image()
00428     else:
00429       self.image = sensor_msgs.msg.Image()
00430 
00431   def _get_types(self):
00432     """
00433     internal API method
00434     """
00435     return self._slot_types
00436 
00437   def serialize(self, buff):
00438     """
00439     serialize message into buffer
00440     :param buff: buffer, ``StringIO``
00441     """
00442     try:
00443       _x = self
00444       buff.write(_struct_3I.pack(_x.image.header.seq, _x.image.header.stamp.secs, _x.image.header.stamp.nsecs))
00445       _x = self.image.header.frame_id
00446       length = len(_x)
00447       if python3 or type(_x) == unicode:
00448         _x = _x.encode('utf-8')
00449         length = len(_x)
00450       buff.write(struct.pack('<I%ss'%length, length, _x))
00451       _x = self
00452       buff.write(_struct_2I.pack(_x.image.height, _x.image.width))
00453       _x = self.image.encoding
00454       length = len(_x)
00455       if python3 or type(_x) == unicode:
00456         _x = _x.encode('utf-8')
00457         length = len(_x)
00458       buff.write(struct.pack('<I%ss'%length, length, _x))
00459       _x = self
00460       buff.write(_struct_BI.pack(_x.image.is_bigendian, _x.image.step))
00461       _x = self.image.data
00462       length = len(_x)
00463       # - if encoded as a list instead, serialize as bytes instead of string
00464       if type(_x) in [list, tuple]:
00465         buff.write(struct.pack('<I%sB'%length, length, *_x))
00466       else:
00467         buff.write(struct.pack('<I%ss'%length, length, _x))
00468     except struct.error as se: self._check_types(se)
00469     except TypeError as te: self._check_types(te)
00470 
00471   def deserialize(self, str):
00472     """
00473     unpack serialized message in str into this message instance
00474     :param str: byte array of serialized message, ``str``
00475     """
00476     try:
00477       if self.image is None:
00478         self.image = sensor_msgs.msg.Image()
00479       end = 0
00480       _x = self
00481       start = end
00482       end += 12
00483       (_x.image.header.seq, _x.image.header.stamp.secs, _x.image.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00484       start = end
00485       end += 4
00486       (length,) = _struct_I.unpack(str[start:end])
00487       start = end
00488       end += length
00489       if python3:
00490         self.image.header.frame_id = str[start:end].decode('utf-8')
00491       else:
00492         self.image.header.frame_id = str[start:end]
00493       _x = self
00494       start = end
00495       end += 8
00496       (_x.image.height, _x.image.width,) = _struct_2I.unpack(str[start:end])
00497       start = end
00498       end += 4
00499       (length,) = _struct_I.unpack(str[start:end])
00500       start = end
00501       end += length
00502       if python3:
00503         self.image.encoding = str[start:end].decode('utf-8')
00504       else:
00505         self.image.encoding = str[start:end]
00506       _x = self
00507       start = end
00508       end += 5
00509       (_x.image.is_bigendian, _x.image.step,) = _struct_BI.unpack(str[start:end])
00510       start = end
00511       end += 4
00512       (length,) = _struct_I.unpack(str[start:end])
00513       start = end
00514       end += length
00515       if python3:
00516         self.image.data = str[start:end].decode('utf-8')
00517       else:
00518         self.image.data = str[start:end]
00519       return self
00520     except struct.error as e:
00521       raise genpy.DeserializationError(e) #most likely buffer underfill
00522 
00523 
00524   def serialize_numpy(self, buff, numpy):
00525     """
00526     serialize message with numpy array types into buffer
00527     :param buff: buffer, ``StringIO``
00528     :param numpy: numpy python module
00529     """
00530     try:
00531       _x = self
00532       buff.write(_struct_3I.pack(_x.image.header.seq, _x.image.header.stamp.secs, _x.image.header.stamp.nsecs))
00533       _x = self.image.header.frame_id
00534       length = len(_x)
00535       if python3 or type(_x) == unicode:
00536         _x = _x.encode('utf-8')
00537         length = len(_x)
00538       buff.write(struct.pack('<I%ss'%length, length, _x))
00539       _x = self
00540       buff.write(_struct_2I.pack(_x.image.height, _x.image.width))
00541       _x = self.image.encoding
00542       length = len(_x)
00543       if python3 or type(_x) == unicode:
00544         _x = _x.encode('utf-8')
00545         length = len(_x)
00546       buff.write(struct.pack('<I%ss'%length, length, _x))
00547       _x = self
00548       buff.write(_struct_BI.pack(_x.image.is_bigendian, _x.image.step))
00549       _x = self.image.data
00550       length = len(_x)
00551       # - if encoded as a list instead, serialize as bytes instead of string
00552       if type(_x) in [list, tuple]:
00553         buff.write(struct.pack('<I%sB'%length, length, *_x))
00554       else:
00555         buff.write(struct.pack('<I%ss'%length, length, _x))
00556     except struct.error as se: self._check_types(se)
00557     except TypeError as te: self._check_types(te)
00558 
00559   def deserialize_numpy(self, str, numpy):
00560     """
00561     unpack serialized message in str into this message instance using numpy for array types
00562     :param str: byte array of serialized message, ``str``
00563     :param numpy: numpy python module
00564     """
00565     try:
00566       if self.image is None:
00567         self.image = sensor_msgs.msg.Image()
00568       end = 0
00569       _x = self
00570       start = end
00571       end += 12
00572       (_x.image.header.seq, _x.image.header.stamp.secs, _x.image.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00573       start = end
00574       end += 4
00575       (length,) = _struct_I.unpack(str[start:end])
00576       start = end
00577       end += length
00578       if python3:
00579         self.image.header.frame_id = str[start:end].decode('utf-8')
00580       else:
00581         self.image.header.frame_id = str[start:end]
00582       _x = self
00583       start = end
00584       end += 8
00585       (_x.image.height, _x.image.width,) = _struct_2I.unpack(str[start:end])
00586       start = end
00587       end += 4
00588       (length,) = _struct_I.unpack(str[start:end])
00589       start = end
00590       end += length
00591       if python3:
00592         self.image.encoding = str[start:end].decode('utf-8')
00593       else:
00594         self.image.encoding = str[start:end]
00595       _x = self
00596       start = end
00597       end += 5
00598       (_x.image.is_bigendian, _x.image.step,) = _struct_BI.unpack(str[start:end])
00599       start = end
00600       end += 4
00601       (length,) = _struct_I.unpack(str[start:end])
00602       start = end
00603       end += length
00604       if python3:
00605         self.image.data = str[start:end].decode('utf-8')
00606       else:
00607         self.image.data = str[start:end]
00608       return self
00609     except struct.error as e:
00610       raise genpy.DeserializationError(e) #most likely buffer underfill
00611 
00612 _struct_I = genpy.struct_I
00613 _struct_3I = struct.Struct("<3I")
00614 _struct_2I = struct.Struct("<2I")
00615 _struct_BI = struct.Struct("<BI")
00616 class PclToImg(object):
00617   _type          = 'iri_perception_msgs/PclToImg'
00618   _md5sum = '1036a14b8c4c20601506406b1e3a4ca1'
00619   _request_class  = PclToImgRequest
00620   _response_class = PclToImgResponse


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