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


laser_assembler
Author(s): Vijay Pradeep
autogenerated on Mon Oct 6 2014 01:43:03