_DenseLaserSnapshot.py
Go to the documentation of this file.
00001 """autogenerated by genpy from calibration_msgs/DenseLaserSnapshot.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 import std_msgs.msg
00009 
00010 class DenseLaserSnapshot(genpy.Message):
00011   _md5sum = "deb2810d3530db3484f886a81243195d"
00012   _type = "calibration_msgs/DenseLaserSnapshot"
00013   _has_header = True #flag to mark the presence of a Header object
00014   _full_text = """# Provides all the state & sensor information for
00015 # a single sweep of laser attached to some mechanism.
00016 # Most likely, this will be used with PR2's tilting laser mechanism
00017 Header header
00018 
00019 # Store the laser intrinsics. This is very similar to the
00020 # intrinsics commonly stored in 
00021 float32 angle_min        # start angle of the scan [rad]
00022 float32 angle_max        # end angle of the scan [rad]
00023 float32 angle_increment  # angular distance between measurements [rad]
00024 float32 time_increment   # time between measurements [seconds]
00025 float32 range_min        # minimum range value [m]
00026 float32 range_max        # maximum range value [m]
00027 
00028 # Define the size of the binary data
00029 uint32 readings_per_scan    # (Width)
00030 uint32 num_scans            # (Height)
00031 
00032 # 2D Arrays storing laser data.
00033 # We can think of each type data as being a single channel image.
00034 # Each row of the image has data from a single scan, and scans are
00035 # concatenated to form the entire 'image'.
00036 float32[] ranges            # (Image data)
00037 float32[] intensities       # (Image data)
00038 
00039 # Store the start time of each scan
00040 time[] scan_start
00041 
00042 ================================================================================
00043 MSG: std_msgs/Header
00044 # Standard metadata for higher-level stamped data types.
00045 # This is generally used to communicate timestamped data 
00046 # in a particular coordinate frame.
00047 # 
00048 # sequence ID: consecutively increasing ID 
00049 uint32 seq
00050 #Two-integer timestamp that is expressed as:
00051 # * stamp.secs: seconds (stamp_secs) since epoch
00052 # * stamp.nsecs: nanoseconds since stamp_secs
00053 # time-handling sugar is provided by the client library
00054 time stamp
00055 #Frame this data is associated with
00056 # 0: no frame
00057 # 1: global frame
00058 string frame_id
00059 
00060 """
00061   __slots__ = ['header','angle_min','angle_max','angle_increment','time_increment','range_min','range_max','readings_per_scan','num_scans','ranges','intensities','scan_start']
00062   _slot_types = ['std_msgs/Header','float32','float32','float32','float32','float32','float32','uint32','uint32','float32[]','float32[]','time[]']
00063 
00064   def __init__(self, *args, **kwds):
00065     """
00066     Constructor. Any message fields that are implicitly/explicitly
00067     set to None will be assigned a default value. The recommend
00068     use is keyword arguments as this is more robust to future message
00069     changes.  You cannot mix in-order arguments and keyword arguments.
00070 
00071     The available fields are:
00072        header,angle_min,angle_max,angle_increment,time_increment,range_min,range_max,readings_per_scan,num_scans,ranges,intensities,scan_start
00073 
00074     :param args: complete set of field values, in .msg order
00075     :param kwds: use keyword arguments corresponding to message field names
00076     to set specific fields.
00077     """
00078     if args or kwds:
00079       super(DenseLaserSnapshot, self).__init__(*args, **kwds)
00080       #message fields cannot be None, assign default values for those that are
00081       if self.header is None:
00082         self.header = std_msgs.msg.Header()
00083       if self.angle_min is None:
00084         self.angle_min = 0.
00085       if self.angle_max is None:
00086         self.angle_max = 0.
00087       if self.angle_increment is None:
00088         self.angle_increment = 0.
00089       if self.time_increment is None:
00090         self.time_increment = 0.
00091       if self.range_min is None:
00092         self.range_min = 0.
00093       if self.range_max is None:
00094         self.range_max = 0.
00095       if self.readings_per_scan is None:
00096         self.readings_per_scan = 0
00097       if self.num_scans is None:
00098         self.num_scans = 0
00099       if self.ranges is None:
00100         self.ranges = []
00101       if self.intensities is None:
00102         self.intensities = []
00103       if self.scan_start is None:
00104         self.scan_start = []
00105     else:
00106       self.header = std_msgs.msg.Header()
00107       self.angle_min = 0.
00108       self.angle_max = 0.
00109       self.angle_increment = 0.
00110       self.time_increment = 0.
00111       self.range_min = 0.
00112       self.range_max = 0.
00113       self.readings_per_scan = 0
00114       self.num_scans = 0
00115       self.ranges = []
00116       self.intensities = []
00117       self.scan_start = []
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.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00133       _x = self.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       _x = self
00140       buff.write(_struct_6f2I.pack(_x.angle_min, _x.angle_max, _x.angle_increment, _x.time_increment, _x.range_min, _x.range_max, _x.readings_per_scan, _x.num_scans))
00141       length = len(self.ranges)
00142       buff.write(_struct_I.pack(length))
00143       pattern = '<%sf'%length
00144       buff.write(struct.pack(pattern, *self.ranges))
00145       length = len(self.intensities)
00146       buff.write(_struct_I.pack(length))
00147       pattern = '<%sf'%length
00148       buff.write(struct.pack(pattern, *self.intensities))
00149       length = len(self.scan_start)
00150       buff.write(_struct_I.pack(length))
00151       for val1 in self.scan_start:
00152         _x = val1
00153         buff.write(_struct_2I.pack(_x.secs, _x.nsecs))
00154     except struct.error as se: self._check_types(se)
00155     except TypeError as te: self._check_types(te)
00156 
00157   def deserialize(self, str):
00158     """
00159     unpack serialized message in str into this message instance
00160     :param str: byte array of serialized message, ``str``
00161     """
00162     try:
00163       if self.header is None:
00164         self.header = std_msgs.msg.Header()
00165       if self.scan_start is None:
00166         self.scan_start = None
00167       end = 0
00168       _x = self
00169       start = end
00170       end += 12
00171       (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00172       start = end
00173       end += 4
00174       (length,) = _struct_I.unpack(str[start:end])
00175       start = end
00176       end += length
00177       if python3:
00178         self.header.frame_id = str[start:end].decode('utf-8')
00179       else:
00180         self.header.frame_id = str[start:end]
00181       _x = self
00182       start = end
00183       end += 32
00184       (_x.angle_min, _x.angle_max, _x.angle_increment, _x.time_increment, _x.range_min, _x.range_max, _x.readings_per_scan, _x.num_scans,) = _struct_6f2I.unpack(str[start:end])
00185       start = end
00186       end += 4
00187       (length,) = _struct_I.unpack(str[start:end])
00188       pattern = '<%sf'%length
00189       start = end
00190       end += struct.calcsize(pattern)
00191       self.ranges = struct.unpack(pattern, str[start:end])
00192       start = end
00193       end += 4
00194       (length,) = _struct_I.unpack(str[start:end])
00195       pattern = '<%sf'%length
00196       start = end
00197       end += struct.calcsize(pattern)
00198       self.intensities = struct.unpack(pattern, str[start:end])
00199       start = end
00200       end += 4
00201       (length,) = _struct_I.unpack(str[start:end])
00202       self.scan_start = []
00203       for i in range(0, length):
00204         val1 = genpy.Time()
00205         _x = val1
00206         start = end
00207         end += 8
00208         (_x.secs, _x.nsecs,) = _struct_2I.unpack(str[start:end])
00209         self.scan_start.append(val1)
00210       return self
00211     except struct.error as e:
00212       raise genpy.DeserializationError(e) #most likely buffer underfill
00213 
00214 
00215   def serialize_numpy(self, buff, numpy):
00216     """
00217     serialize message with numpy array types into buffer
00218     :param buff: buffer, ``StringIO``
00219     :param numpy: numpy python module
00220     """
00221     try:
00222       _x = self
00223       buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00224       _x = self.header.frame_id
00225       length = len(_x)
00226       if python3 or type(_x) == unicode:
00227         _x = _x.encode('utf-8')
00228         length = len(_x)
00229       buff.write(struct.pack('<I%ss'%length, length, _x))
00230       _x = self
00231       buff.write(_struct_6f2I.pack(_x.angle_min, _x.angle_max, _x.angle_increment, _x.time_increment, _x.range_min, _x.range_max, _x.readings_per_scan, _x.num_scans))
00232       length = len(self.ranges)
00233       buff.write(_struct_I.pack(length))
00234       pattern = '<%sf'%length
00235       buff.write(self.ranges.tostring())
00236       length = len(self.intensities)
00237       buff.write(_struct_I.pack(length))
00238       pattern = '<%sf'%length
00239       buff.write(self.intensities.tostring())
00240       length = len(self.scan_start)
00241       buff.write(_struct_I.pack(length))
00242       for val1 in self.scan_start:
00243         _x = val1
00244         buff.write(_struct_2I.pack(_x.secs, _x.nsecs))
00245     except struct.error as se: self._check_types(se)
00246     except TypeError as te: self._check_types(te)
00247 
00248   def deserialize_numpy(self, str, numpy):
00249     """
00250     unpack serialized message in str into this message instance using numpy for array types
00251     :param str: byte array of serialized message, ``str``
00252     :param numpy: numpy python module
00253     """
00254     try:
00255       if self.header is None:
00256         self.header = std_msgs.msg.Header()
00257       if self.scan_start is None:
00258         self.scan_start = None
00259       end = 0
00260       _x = self
00261       start = end
00262       end += 12
00263       (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00264       start = end
00265       end += 4
00266       (length,) = _struct_I.unpack(str[start:end])
00267       start = end
00268       end += length
00269       if python3:
00270         self.header.frame_id = str[start:end].decode('utf-8')
00271       else:
00272         self.header.frame_id = str[start:end]
00273       _x = self
00274       start = end
00275       end += 32
00276       (_x.angle_min, _x.angle_max, _x.angle_increment, _x.time_increment, _x.range_min, _x.range_max, _x.readings_per_scan, _x.num_scans,) = _struct_6f2I.unpack(str[start:end])
00277       start = end
00278       end += 4
00279       (length,) = _struct_I.unpack(str[start:end])
00280       pattern = '<%sf'%length
00281       start = end
00282       end += struct.calcsize(pattern)
00283       self.ranges = numpy.frombuffer(str[start:end], dtype=numpy.float32, count=length)
00284       start = end
00285       end += 4
00286       (length,) = _struct_I.unpack(str[start:end])
00287       pattern = '<%sf'%length
00288       start = end
00289       end += struct.calcsize(pattern)
00290       self.intensities = numpy.frombuffer(str[start:end], dtype=numpy.float32, count=length)
00291       start = end
00292       end += 4
00293       (length,) = _struct_I.unpack(str[start:end])
00294       self.scan_start = []
00295       for i in range(0, length):
00296         val1 = genpy.Time()
00297         _x = val1
00298         start = end
00299         end += 8
00300         (_x.secs, _x.nsecs,) = _struct_2I.unpack(str[start:end])
00301         self.scan_start.append(val1)
00302       return self
00303     except struct.error as e:
00304       raise genpy.DeserializationError(e) #most likely buffer underfill
00305 
00306 _struct_I = genpy.struct_I
00307 _struct_3I = struct.Struct("<3I")
00308 _struct_2I = struct.Struct("<2I")
00309 _struct_6f2I = struct.Struct("<6f2I")
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Properties Friends


calibration_msgs
Author(s): Vijay Pradeep
autogenerated on Thu Aug 15 2013 10:15:15