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