_TiltLaserSnapshotResult.py
Go to the documentation of this file.
00001 """autogenerated by genpy from pr2_laser_snapshotter/TiltLaserSnapshotResult.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 TiltLaserSnapshotResult(genpy.Message):
00012   _md5sum = "4217b28a903e4ad7869a83b3653110ff"
00013   _type = "pr2_laser_snapshotter/TiltLaserSnapshotResult"
00014   _has_header = False #flag to mark the presence of a Header object
00015   _full_text = """# ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ======
00016 sensor_msgs/PointCloud cloud
00017 
00018 ================================================================================
00019 MSG: sensor_msgs/PointCloud
00020 # This message holds a collection of 3d points, plus optional additional
00021 # information about each point.
00022 
00023 # Time of sensor data acquisition, coordinate frame ID.
00024 Header header
00025 
00026 # Array of 3d points. Each Point32 should be interpreted as a 3d point
00027 # in the frame given in the header.
00028 geometry_msgs/Point32[] points
00029 
00030 # Each channel should have the same number of elements as points array,
00031 # and the data in each channel should correspond 1:1 with each point.
00032 # Channel names in common practice are listed in ChannelFloat32.msg.
00033 ChannelFloat32[] channels
00034 
00035 ================================================================================
00036 MSG: std_msgs/Header
00037 # Standard metadata for higher-level stamped data types.
00038 # This is generally used to communicate timestamped data 
00039 # in a particular coordinate frame.
00040 # 
00041 # sequence ID: consecutively increasing ID 
00042 uint32 seq
00043 #Two-integer timestamp that is expressed as:
00044 # * stamp.secs: seconds (stamp_secs) since epoch
00045 # * stamp.nsecs: nanoseconds since stamp_secs
00046 # time-handling sugar is provided by the client library
00047 time stamp
00048 #Frame this data is associated with
00049 # 0: no frame
00050 # 1: global frame
00051 string frame_id
00052 
00053 ================================================================================
00054 MSG: geometry_msgs/Point32
00055 # This contains the position of a point in free space(with 32 bits of precision).
00056 # It is recommeded to use Point wherever possible instead of Point32.  
00057 # 
00058 # This recommendation is to promote interoperability.  
00059 #
00060 # This message is designed to take up less space when sending
00061 # lots of points at once, as in the case of a PointCloud.  
00062 
00063 float32 x
00064 float32 y
00065 float32 z
00066 ================================================================================
00067 MSG: sensor_msgs/ChannelFloat32
00068 # This message is used by the PointCloud message to hold optional data
00069 # associated with each point in the cloud. The length of the values
00070 # array should be the same as the length of the points array in the
00071 # PointCloud, and each value should be associated with the corresponding
00072 # point.
00073 
00074 # Channel names in existing practice include:
00075 #   "u", "v" - row and column (respectively) in the left stereo image.
00076 #              This is opposite to usual conventions but remains for
00077 #              historical reasons. The newer PointCloud2 message has no
00078 #              such problem.
00079 #   "rgb" - For point clouds produced by color stereo cameras. uint8
00080 #           (R,G,B) values packed into the least significant 24 bits,
00081 #           in order.
00082 #   "intensity" - laser or pixel intensity.
00083 #   "distance"
00084 
00085 # The channel name should give semantics of the channel (e.g.
00086 # "intensity" instead of "value").
00087 string name
00088 
00089 # The values array should be 1-1 with the elements of the associated
00090 # PointCloud.
00091 float32[] values
00092 
00093 """
00094   __slots__ = ['cloud']
00095   _slot_types = ['sensor_msgs/PointCloud']
00096 
00097   def __init__(self, *args, **kwds):
00098     """
00099     Constructor. Any message fields that are implicitly/explicitly
00100     set to None will be assigned a default value. The recommend
00101     use is keyword arguments as this is more robust to future message
00102     changes.  You cannot mix in-order arguments and keyword arguments.
00103 
00104     The available fields are:
00105        cloud
00106 
00107     :param args: complete set of field values, in .msg order
00108     :param kwds: use keyword arguments corresponding to message field names
00109     to set specific fields.
00110     """
00111     if args or kwds:
00112       super(TiltLaserSnapshotResult, self).__init__(*args, **kwds)
00113       #message fields cannot be None, assign default values for those that are
00114       if self.cloud is None:
00115         self.cloud = sensor_msgs.msg.PointCloud()
00116     else:
00117       self.cloud = sensor_msgs.msg.PointCloud()
00118 
00119   def _get_types(self):
00120     """
00121     internal API method
00122     """
00123     return self._slot_types
00124 
00125   def serialize(self, buff):
00126     """
00127     serialize message into buffer
00128     :param buff: buffer, ``StringIO``
00129     """
00130     try:
00131       _x = self
00132       buff.write(_struct_3I.pack(_x.cloud.header.seq, _x.cloud.header.stamp.secs, _x.cloud.header.stamp.nsecs))
00133       _x = self.cloud.header.frame_id
00134       length = len(_x)
00135       if python3 or type(_x) == unicode:
00136         _x = _x.encode('utf-8')
00137         length = len(_x)
00138       buff.write(struct.pack('<I%ss'%length, length, _x))
00139       length = len(self.cloud.points)
00140       buff.write(_struct_I.pack(length))
00141       for val1 in self.cloud.points:
00142         _x = val1
00143         buff.write(_struct_3f.pack(_x.x, _x.y, _x.z))
00144       length = len(self.cloud.channels)
00145       buff.write(_struct_I.pack(length))
00146       for val1 in self.cloud.channels:
00147         _x = val1.name
00148         length = len(_x)
00149         if python3 or type(_x) == unicode:
00150           _x = _x.encode('utf-8')
00151           length = len(_x)
00152         buff.write(struct.pack('<I%ss'%length, length, _x))
00153         length = len(val1.values)
00154         buff.write(_struct_I.pack(length))
00155         pattern = '<%sf'%length
00156         buff.write(struct.pack(pattern, *val1.values))
00157     except struct.error as se: self._check_types(se)
00158     except TypeError as te: self._check_types(te)
00159 
00160   def deserialize(self, str):
00161     """
00162     unpack serialized message in str into this message instance
00163     :param str: byte array of serialized message, ``str``
00164     """
00165     try:
00166       if self.cloud is None:
00167         self.cloud = sensor_msgs.msg.PointCloud()
00168       end = 0
00169       _x = self
00170       start = end
00171       end += 12
00172       (_x.cloud.header.seq, _x.cloud.header.stamp.secs, _x.cloud.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00173       start = end
00174       end += 4
00175       (length,) = _struct_I.unpack(str[start:end])
00176       start = end
00177       end += length
00178       if python3:
00179         self.cloud.header.frame_id = str[start:end].decode('utf-8')
00180       else:
00181         self.cloud.header.frame_id = str[start:end]
00182       start = end
00183       end += 4
00184       (length,) = _struct_I.unpack(str[start:end])
00185       self.cloud.points = []
00186       for i in range(0, length):
00187         val1 = geometry_msgs.msg.Point32()
00188         _x = val1
00189         start = end
00190         end += 12
00191         (_x.x, _x.y, _x.z,) = _struct_3f.unpack(str[start:end])
00192         self.cloud.points.append(val1)
00193       start = end
00194       end += 4
00195       (length,) = _struct_I.unpack(str[start:end])
00196       self.cloud.channels = []
00197       for i in range(0, length):
00198         val1 = sensor_msgs.msg.ChannelFloat32()
00199         start = end
00200         end += 4
00201         (length,) = _struct_I.unpack(str[start:end])
00202         start = end
00203         end += length
00204         if python3:
00205           val1.name = str[start:end].decode('utf-8')
00206         else:
00207           val1.name = str[start:end]
00208         start = end
00209         end += 4
00210         (length,) = _struct_I.unpack(str[start:end])
00211         pattern = '<%sf'%length
00212         start = end
00213         end += struct.calcsize(pattern)
00214         val1.values = struct.unpack(pattern, str[start:end])
00215         self.cloud.channels.append(val1)
00216       return self
00217     except struct.error as e:
00218       raise genpy.DeserializationError(e) #most likely buffer underfill
00219 
00220 
00221   def serialize_numpy(self, buff, numpy):
00222     """
00223     serialize message with numpy array types into buffer
00224     :param buff: buffer, ``StringIO``
00225     :param numpy: numpy python module
00226     """
00227     try:
00228       _x = self
00229       buff.write(_struct_3I.pack(_x.cloud.header.seq, _x.cloud.header.stamp.secs, _x.cloud.header.stamp.nsecs))
00230       _x = self.cloud.header.frame_id
00231       length = len(_x)
00232       if python3 or type(_x) == unicode:
00233         _x = _x.encode('utf-8')
00234         length = len(_x)
00235       buff.write(struct.pack('<I%ss'%length, length, _x))
00236       length = len(self.cloud.points)
00237       buff.write(_struct_I.pack(length))
00238       for val1 in self.cloud.points:
00239         _x = val1
00240         buff.write(_struct_3f.pack(_x.x, _x.y, _x.z))
00241       length = len(self.cloud.channels)
00242       buff.write(_struct_I.pack(length))
00243       for val1 in self.cloud.channels:
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         length = len(val1.values)
00251         buff.write(_struct_I.pack(length))
00252         pattern = '<%sf'%length
00253         buff.write(val1.values.tostring())
00254     except struct.error as se: self._check_types(se)
00255     except TypeError as te: self._check_types(te)
00256 
00257   def deserialize_numpy(self, str, numpy):
00258     """
00259     unpack serialized message in str into this message instance using numpy for array types
00260     :param str: byte array of serialized message, ``str``
00261     :param numpy: numpy python module
00262     """
00263     try:
00264       if self.cloud is None:
00265         self.cloud = sensor_msgs.msg.PointCloud()
00266       end = 0
00267       _x = self
00268       start = end
00269       end += 12
00270       (_x.cloud.header.seq, _x.cloud.header.stamp.secs, _x.cloud.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00271       start = end
00272       end += 4
00273       (length,) = _struct_I.unpack(str[start:end])
00274       start = end
00275       end += length
00276       if python3:
00277         self.cloud.header.frame_id = str[start:end].decode('utf-8')
00278       else:
00279         self.cloud.header.frame_id = str[start:end]
00280       start = end
00281       end += 4
00282       (length,) = _struct_I.unpack(str[start:end])
00283       self.cloud.points = []
00284       for i in range(0, length):
00285         val1 = geometry_msgs.msg.Point32()
00286         _x = val1
00287         start = end
00288         end += 12
00289         (_x.x, _x.y, _x.z,) = _struct_3f.unpack(str[start:end])
00290         self.cloud.points.append(val1)
00291       start = end
00292       end += 4
00293       (length,) = _struct_I.unpack(str[start:end])
00294       self.cloud.channels = []
00295       for i in range(0, length):
00296         val1 = sensor_msgs.msg.ChannelFloat32()
00297         start = end
00298         end += 4
00299         (length,) = _struct_I.unpack(str[start:end])
00300         start = end
00301         end += length
00302         if python3:
00303           val1.name = str[start:end].decode('utf-8')
00304         else:
00305           val1.name = str[start:end]
00306         start = end
00307         end += 4
00308         (length,) = _struct_I.unpack(str[start:end])
00309         pattern = '<%sf'%length
00310         start = end
00311         end += struct.calcsize(pattern)
00312         val1.values = numpy.frombuffer(str[start:end], dtype=numpy.float32, count=length)
00313         self.cloud.channels.append(val1)
00314       return self
00315     except struct.error as e:
00316       raise genpy.DeserializationError(e) #most likely buffer underfill
00317 
00318 _struct_I = genpy.struct_I
00319 _struct_3I = struct.Struct("<3I")
00320 _struct_3f = struct.Struct("<3f")


pr2_laser_snapshotter
Author(s): Vijay Pradeep
autogenerated on Wed Dec 11 2013 14:17:19