$search
00001 """autogenerated by genmsg_py from ScriptGoal.msg. Do not edit.""" 00002 import roslib.message 00003 import struct 00004 00005 00006 class ScriptGoal(roslib.message.Message): 00007 _md5sum = "0a40a194b72e6783b1b8bec8d1c28c7f" 00008 _type = "cob_script_server/ScriptGoal" 00009 _has_header = False #flag to mark the presence of a Header object 00010 _full_text = """# ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ====== 00011 #goal definition 00012 string function_name 00013 string component_name 00014 string parameter_name 00015 string mode 00016 string service_name 00017 float32 duration 00018 bool planning 00019 00020 """ 00021 __slots__ = ['function_name','component_name','parameter_name','mode','service_name','duration','planning'] 00022 _slot_types = ['string','string','string','string','string','float32','bool'] 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 function_name,component_name,parameter_name,mode,service_name,duration,planning 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(ScriptGoal, self).__init__(*args, **kwds) 00040 #message fields cannot be None, assign default values for those that are 00041 if self.function_name is None: 00042 self.function_name = '' 00043 if self.component_name is None: 00044 self.component_name = '' 00045 if self.parameter_name is None: 00046 self.parameter_name = '' 00047 if self.mode is None: 00048 self.mode = '' 00049 if self.service_name is None: 00050 self.service_name = '' 00051 if self.duration is None: 00052 self.duration = 0. 00053 if self.planning is None: 00054 self.planning = False 00055 else: 00056 self.function_name = '' 00057 self.component_name = '' 00058 self.parameter_name = '' 00059 self.mode = '' 00060 self.service_name = '' 00061 self.duration = 0. 00062 self.planning = False 00063 00064 def _get_types(self): 00065 """ 00066 internal API method 00067 """ 00068 return self._slot_types 00069 00070 def serialize(self, buff): 00071 """ 00072 serialize message into buffer 00073 @param buff: buffer 00074 @type buff: StringIO 00075 """ 00076 try: 00077 _x = self.function_name 00078 length = len(_x) 00079 buff.write(struct.pack('<I%ss'%length, length, _x)) 00080 _x = self.component_name 00081 length = len(_x) 00082 buff.write(struct.pack('<I%ss'%length, length, _x)) 00083 _x = self.parameter_name 00084 length = len(_x) 00085 buff.write(struct.pack('<I%ss'%length, length, _x)) 00086 _x = self.mode 00087 length = len(_x) 00088 buff.write(struct.pack('<I%ss'%length, length, _x)) 00089 _x = self.service_name 00090 length = len(_x) 00091 buff.write(struct.pack('<I%ss'%length, length, _x)) 00092 _x = self 00093 buff.write(_struct_fB.pack(_x.duration, _x.planning)) 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 start = end 00109 end += length 00110 self.function_name = str[start:end] 00111 start = end 00112 end += 4 00113 (length,) = _struct_I.unpack(str[start:end]) 00114 start = end 00115 end += length 00116 self.component_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 self.parameter_name = str[start:end] 00123 start = end 00124 end += 4 00125 (length,) = _struct_I.unpack(str[start:end]) 00126 start = end 00127 end += length 00128 self.mode = 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.service_name = str[start:end] 00135 _x = self 00136 start = end 00137 end += 5 00138 (_x.duration, _x.planning,) = _struct_fB.unpack(str[start:end]) 00139 self.planning = bool(self.planning) 00140 return self 00141 except struct.error as e: 00142 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00143 00144 00145 def serialize_numpy(self, buff, numpy): 00146 """ 00147 serialize message with numpy array types into buffer 00148 @param buff: buffer 00149 @type buff: StringIO 00150 @param numpy: numpy python module 00151 @type numpy module 00152 """ 00153 try: 00154 _x = self.function_name 00155 length = len(_x) 00156 buff.write(struct.pack('<I%ss'%length, length, _x)) 00157 _x = self.component_name 00158 length = len(_x) 00159 buff.write(struct.pack('<I%ss'%length, length, _x)) 00160 _x = self.parameter_name 00161 length = len(_x) 00162 buff.write(struct.pack('<I%ss'%length, length, _x)) 00163 _x = self.mode 00164 length = len(_x) 00165 buff.write(struct.pack('<I%ss'%length, length, _x)) 00166 _x = self.service_name 00167 length = len(_x) 00168 buff.write(struct.pack('<I%ss'%length, length, _x)) 00169 _x = self 00170 buff.write(_struct_fB.pack(_x.duration, _x.planning)) 00171 except struct.error as se: self._check_types(se) 00172 except TypeError as te: self._check_types(te) 00173 00174 def deserialize_numpy(self, str, numpy): 00175 """ 00176 unpack serialized message in str into this message instance using numpy for array types 00177 @param str: byte array of serialized message 00178 @type str: str 00179 @param numpy: numpy python module 00180 @type numpy: module 00181 """ 00182 try: 00183 end = 0 00184 start = end 00185 end += 4 00186 (length,) = _struct_I.unpack(str[start:end]) 00187 start = end 00188 end += length 00189 self.function_name = str[start:end] 00190 start = end 00191 end += 4 00192 (length,) = _struct_I.unpack(str[start:end]) 00193 start = end 00194 end += length 00195 self.component_name = str[start:end] 00196 start = end 00197 end += 4 00198 (length,) = _struct_I.unpack(str[start:end]) 00199 start = end 00200 end += length 00201 self.parameter_name = str[start:end] 00202 start = end 00203 end += 4 00204 (length,) = _struct_I.unpack(str[start:end]) 00205 start = end 00206 end += length 00207 self.mode = str[start:end] 00208 start = end 00209 end += 4 00210 (length,) = _struct_I.unpack(str[start:end]) 00211 start = end 00212 end += length 00213 self.service_name = str[start:end] 00214 _x = self 00215 start = end 00216 end += 5 00217 (_x.duration, _x.planning,) = _struct_fB.unpack(str[start:end]) 00218 self.planning = bool(self.planning) 00219 return self 00220 except struct.error as e: 00221 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00222 00223 _struct_I = roslib.message.struct_I 00224 _struct_fB = struct.Struct("<fB")