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