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