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


pr2_clutter_helper
Author(s): Jason Okerman, Advisors: Prof. Charlie Kemp and Jim Regh, Lab: Healthcare Robotics Lab at Georgia Tech
autogenerated on Wed Nov 27 2013 11:53:06