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