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


bond
Author(s): Stuart Glaser
autogenerated on Thu Aug 15 2013 10:10:34