_IntervalStatus.py
Go to the documentation of this file.
00001 """autogenerated by genpy from calibration_msgs/IntervalStatus.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 
00009 class IntervalStatus(genpy.Message):
00010   _md5sum = "277fe87e9a44a07ab27c97b6b37d5898"
00011   _type = "calibration_msgs/IntervalStatus"
00012   _has_header = True #flag to mark the presence of a Header object
00013   _full_text = """# Status of interval intersection
00014 # This can give some indication of which samples have failed to capture
00015 Header header
00016 string[] names
00017 float32[] yeild_rates
00018 
00019 ================================================================================
00020 MSG: std_msgs/Header
00021 # Standard metadata for higher-level stamped data types.
00022 # This is generally used to communicate timestamped data 
00023 # in a particular coordinate frame.
00024 # 
00025 # sequence ID: consecutively increasing ID 
00026 uint32 seq
00027 #Two-integer timestamp that is expressed as:
00028 # * stamp.secs: seconds (stamp_secs) since epoch
00029 # * stamp.nsecs: nanoseconds since stamp_secs
00030 # time-handling sugar is provided by the client library
00031 time stamp
00032 #Frame this data is associated with
00033 # 0: no frame
00034 # 1: global frame
00035 string frame_id
00036 
00037 """
00038   __slots__ = ['header','names','yeild_rates']
00039   _slot_types = ['std_msgs/Header','string[]','float32[]']
00040 
00041   def __init__(self, *args, **kwds):
00042     """
00043     Constructor. Any message fields that are implicitly/explicitly
00044     set to None will be assigned a default value. The recommend
00045     use is keyword arguments as this is more robust to future message
00046     changes.  You cannot mix in-order arguments and keyword arguments.
00047 
00048     The available fields are:
00049        header,names,yeild_rates
00050 
00051     :param args: complete set of field values, in .msg order
00052     :param kwds: use keyword arguments corresponding to message field names
00053     to set specific fields.
00054     """
00055     if args or kwds:
00056       super(IntervalStatus, self).__init__(*args, **kwds)
00057       #message fields cannot be None, assign default values for those that are
00058       if self.header is None:
00059         self.header = std_msgs.msg.Header()
00060       if self.names is None:
00061         self.names = []
00062       if self.yeild_rates is None:
00063         self.yeild_rates = []
00064     else:
00065       self.header = std_msgs.msg.Header()
00066       self.names = []
00067       self.yeild_rates = []
00068 
00069   def _get_types(self):
00070     """
00071     internal API method
00072     """
00073     return self._slot_types
00074 
00075   def serialize(self, buff):
00076     """
00077     serialize message into buffer
00078     :param buff: buffer, ``StringIO``
00079     """
00080     try:
00081       _x = self
00082       buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00083       _x = self.header.frame_id
00084       length = len(_x)
00085       if python3 or type(_x) == unicode:
00086         _x = _x.encode('utf-8')
00087         length = len(_x)
00088       buff.write(struct.pack('<I%ss'%length, length, _x))
00089       length = len(self.names)
00090       buff.write(_struct_I.pack(length))
00091       for val1 in self.names:
00092         length = len(val1)
00093         if python3 or type(val1) == unicode:
00094           val1 = val1.encode('utf-8')
00095           length = len(val1)
00096         buff.write(struct.pack('<I%ss'%length, length, val1))
00097       length = len(self.yeild_rates)
00098       buff.write(_struct_I.pack(length))
00099       pattern = '<%sf'%length
00100       buff.write(struct.pack(pattern, *self.yeild_rates))
00101     except struct.error as se: self._check_types(se)
00102     except TypeError as te: self._check_types(te)
00103 
00104   def deserialize(self, str):
00105     """
00106     unpack serialized message in str into this message instance
00107     :param str: byte array of serialized message, ``str``
00108     """
00109     try:
00110       if self.header is None:
00111         self.header = std_msgs.msg.Header()
00112       end = 0
00113       _x = self
00114       start = end
00115       end += 12
00116       (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00117       start = end
00118       end += 4
00119       (length,) = _struct_I.unpack(str[start:end])
00120       start = end
00121       end += length
00122       if python3:
00123         self.header.frame_id = str[start:end].decode('utf-8')
00124       else:
00125         self.header.frame_id = str[start:end]
00126       start = end
00127       end += 4
00128       (length,) = _struct_I.unpack(str[start:end])
00129       self.names = []
00130       for i in range(0, length):
00131         start = end
00132         end += 4
00133         (length,) = _struct_I.unpack(str[start:end])
00134         start = end
00135         end += length
00136         if python3:
00137           val1 = str[start:end].decode('utf-8')
00138         else:
00139           val1 = str[start:end]
00140         self.names.append(val1)
00141       start = end
00142       end += 4
00143       (length,) = _struct_I.unpack(str[start:end])
00144       pattern = '<%sf'%length
00145       start = end
00146       end += struct.calcsize(pattern)
00147       self.yeild_rates = struct.unpack(pattern, str[start:end])
00148       return self
00149     except struct.error as e:
00150       raise genpy.DeserializationError(e) #most likely buffer underfill
00151 
00152 
00153   def serialize_numpy(self, buff, numpy):
00154     """
00155     serialize message with numpy array types into buffer
00156     :param buff: buffer, ``StringIO``
00157     :param numpy: numpy python module
00158     """
00159     try:
00160       _x = self
00161       buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00162       _x = self.header.frame_id
00163       length = len(_x)
00164       if python3 or type(_x) == unicode:
00165         _x = _x.encode('utf-8')
00166         length = len(_x)
00167       buff.write(struct.pack('<I%ss'%length, length, _x))
00168       length = len(self.names)
00169       buff.write(_struct_I.pack(length))
00170       for val1 in self.names:
00171         length = len(val1)
00172         if python3 or type(val1) == unicode:
00173           val1 = val1.encode('utf-8')
00174           length = len(val1)
00175         buff.write(struct.pack('<I%ss'%length, length, val1))
00176       length = len(self.yeild_rates)
00177       buff.write(_struct_I.pack(length))
00178       pattern = '<%sf'%length
00179       buff.write(self.yeild_rates.tostring())
00180     except struct.error as se: self._check_types(se)
00181     except TypeError as te: self._check_types(te)
00182 
00183   def deserialize_numpy(self, str, numpy):
00184     """
00185     unpack serialized message in str into this message instance using numpy for array types
00186     :param str: byte array of serialized message, ``str``
00187     :param numpy: numpy python module
00188     """
00189     try:
00190       if self.header is None:
00191         self.header = std_msgs.msg.Header()
00192       end = 0
00193       _x = self
00194       start = end
00195       end += 12
00196       (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00197       start = end
00198       end += 4
00199       (length,) = _struct_I.unpack(str[start:end])
00200       start = end
00201       end += length
00202       if python3:
00203         self.header.frame_id = str[start:end].decode('utf-8')
00204       else:
00205         self.header.frame_id = str[start:end]
00206       start = end
00207       end += 4
00208       (length,) = _struct_I.unpack(str[start:end])
00209       self.names = []
00210       for i in range(0, length):
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 = str[start:end].decode('utf-8')
00218         else:
00219           val1 = str[start:end]
00220         self.names.append(val1)
00221       start = end
00222       end += 4
00223       (length,) = _struct_I.unpack(str[start:end])
00224       pattern = '<%sf'%length
00225       start = end
00226       end += struct.calcsize(pattern)
00227       self.yeild_rates = numpy.frombuffer(str[start:end], dtype=numpy.float32, count=length)
00228       return self
00229     except struct.error as e:
00230       raise genpy.DeserializationError(e) #most likely buffer underfill
00231 
00232 _struct_I = genpy.struct_I
00233 _struct_3I = struct.Struct("<3I")
 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