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