00001 """autogenerated by genpy from cob_script_server/ScriptActionGoal.msg. Do not edit."""
00002 import sys
00003 python3 = True if sys.hexversion > 0x03000000 else False
00004 import genpy
00005 import struct
00006
00007 import genpy
00008 import actionlib_msgs.msg
00009 import cob_script_server.msg
00010 import std_msgs.msg
00011
00012 class ScriptActionGoal(genpy.Message):
00013 _md5sum = "0d0aefd8bc74f97d2bda7e785f0e79d4"
00014 _type = "cob_script_server/ScriptActionGoal"
00015 _has_header = True
00016 _full_text = """# ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ======
00017
00018 Header header
00019 actionlib_msgs/GoalID goal_id
00020 ScriptGoal goal
00021
00022 ================================================================================
00023 MSG: std_msgs/Header
00024 # Standard metadata for higher-level stamped data types.
00025 # This is generally used to communicate timestamped data
00026 # in a particular coordinate frame.
00027 #
00028 # sequence ID: consecutively increasing ID
00029 uint32 seq
00030 #Two-integer timestamp that is expressed as:
00031 # * stamp.secs: seconds (stamp_secs) since epoch
00032 # * stamp.nsecs: nanoseconds since stamp_secs
00033 # time-handling sugar is provided by the client library
00034 time stamp
00035 #Frame this data is associated with
00036 # 0: no frame
00037 # 1: global frame
00038 string frame_id
00039
00040 ================================================================================
00041 MSG: actionlib_msgs/GoalID
00042 # The stamp should store the time at which this goal was requested.
00043 # It is used by an action server when it tries to preempt all
00044 # goals that were requested before a certain time
00045 time stamp
00046
00047 # The id provides a way to associate feedback and
00048 # result message with specific goal requests. The id
00049 # specified must be unique.
00050 string id
00051
00052
00053 ================================================================================
00054 MSG: cob_script_server/ScriptGoal
00055 # ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ======
00056 #goal definition
00057 string function_name
00058 string component_name
00059 string parameter_name
00060 string mode
00061 string service_name
00062 float32 duration
00063 bool planning
00064
00065 """
00066 __slots__ = ['header','goal_id','goal']
00067 _slot_types = ['std_msgs/Header','actionlib_msgs/GoalID','cob_script_server/ScriptGoal']
00068
00069 def __init__(self, *args, **kwds):
00070 """
00071 Constructor. Any message fields that are implicitly/explicitly
00072 set to None will be assigned a default value. The recommend
00073 use is keyword arguments as this is more robust to future message
00074 changes. You cannot mix in-order arguments and keyword arguments.
00075
00076 The available fields are:
00077 header,goal_id,goal
00078
00079 :param args: complete set of field values, in .msg order
00080 :param kwds: use keyword arguments corresponding to message field names
00081 to set specific fields.
00082 """
00083 if args or kwds:
00084 super(ScriptActionGoal, self).__init__(*args, **kwds)
00085
00086 if self.header is None:
00087 self.header = std_msgs.msg.Header()
00088 if self.goal_id is None:
00089 self.goal_id = actionlib_msgs.msg.GoalID()
00090 if self.goal is None:
00091 self.goal = cob_script_server.msg.ScriptGoal()
00092 else:
00093 self.header = std_msgs.msg.Header()
00094 self.goal_id = actionlib_msgs.msg.GoalID()
00095 self.goal = cob_script_server.msg.ScriptGoal()
00096
00097 def _get_types(self):
00098 """
00099 internal API method
00100 """
00101 return self._slot_types
00102
00103 def serialize(self, buff):
00104 """
00105 serialize message into buffer
00106 :param buff: buffer, ``StringIO``
00107 """
00108 try:
00109 _x = self
00110 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00111 _x = self.header.frame_id
00112 length = len(_x)
00113 if python3 or type(_x) == unicode:
00114 _x = _x.encode('utf-8')
00115 length = len(_x)
00116 buff.write(struct.pack('<I%ss'%length, length, _x))
00117 _x = self
00118 buff.write(_struct_2I.pack(_x.goal_id.stamp.secs, _x.goal_id.stamp.nsecs))
00119 _x = self.goal_id.id
00120 length = len(_x)
00121 if python3 or type(_x) == unicode:
00122 _x = _x.encode('utf-8')
00123 length = len(_x)
00124 buff.write(struct.pack('<I%ss'%length, length, _x))
00125 _x = self.goal.function_name
00126 length = len(_x)
00127 if python3 or type(_x) == unicode:
00128 _x = _x.encode('utf-8')
00129 length = len(_x)
00130 buff.write(struct.pack('<I%ss'%length, length, _x))
00131 _x = self.goal.component_name
00132 length = len(_x)
00133 if python3 or type(_x) == unicode:
00134 _x = _x.encode('utf-8')
00135 length = len(_x)
00136 buff.write(struct.pack('<I%ss'%length, length, _x))
00137 _x = self.goal.parameter_name
00138 length = len(_x)
00139 if python3 or type(_x) == unicode:
00140 _x = _x.encode('utf-8')
00141 length = len(_x)
00142 buff.write(struct.pack('<I%ss'%length, length, _x))
00143 _x = self.goal.mode
00144 length = len(_x)
00145 if python3 or type(_x) == unicode:
00146 _x = _x.encode('utf-8')
00147 length = len(_x)
00148 buff.write(struct.pack('<I%ss'%length, length, _x))
00149 _x = self.goal.service_name
00150 length = len(_x)
00151 if python3 or type(_x) == unicode:
00152 _x = _x.encode('utf-8')
00153 length = len(_x)
00154 buff.write(struct.pack('<I%ss'%length, length, _x))
00155 _x = self
00156 buff.write(_struct_fB.pack(_x.goal.duration, _x.goal.planning))
00157 except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00158 except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00159
00160 def deserialize(self, str):
00161 """
00162 unpack serialized message in str into this message instance
00163 :param str: byte array of serialized message, ``str``
00164 """
00165 try:
00166 if self.header is None:
00167 self.header = std_msgs.msg.Header()
00168 if self.goal_id is None:
00169 self.goal_id = actionlib_msgs.msg.GoalID()
00170 if self.goal is None:
00171 self.goal = cob_script_server.msg.ScriptGoal()
00172 end = 0
00173 _x = self
00174 start = end
00175 end += 12
00176 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00177 start = end
00178 end += 4
00179 (length,) = _struct_I.unpack(str[start:end])
00180 start = end
00181 end += length
00182 if python3:
00183 self.header.frame_id = str[start:end].decode('utf-8')
00184 else:
00185 self.header.frame_id = str[start:end]
00186 _x = self
00187 start = end
00188 end += 8
00189 (_x.goal_id.stamp.secs, _x.goal_id.stamp.nsecs,) = _struct_2I.unpack(str[start:end])
00190 start = end
00191 end += 4
00192 (length,) = _struct_I.unpack(str[start:end])
00193 start = end
00194 end += length
00195 if python3:
00196 self.goal_id.id = str[start:end].decode('utf-8')
00197 else:
00198 self.goal_id.id = str[start:end]
00199 start = end
00200 end += 4
00201 (length,) = _struct_I.unpack(str[start:end])
00202 start = end
00203 end += length
00204 if python3:
00205 self.goal.function_name = str[start:end].decode('utf-8')
00206 else:
00207 self.goal.function_name = str[start:end]
00208 start = end
00209 end += 4
00210 (length,) = _struct_I.unpack(str[start:end])
00211 start = end
00212 end += length
00213 if python3:
00214 self.goal.component_name = str[start:end].decode('utf-8')
00215 else:
00216 self.goal.component_name = str[start:end]
00217 start = end
00218 end += 4
00219 (length,) = _struct_I.unpack(str[start:end])
00220 start = end
00221 end += length
00222 if python3:
00223 self.goal.parameter_name = str[start:end].decode('utf-8')
00224 else:
00225 self.goal.parameter_name = str[start:end]
00226 start = end
00227 end += 4
00228 (length,) = _struct_I.unpack(str[start:end])
00229 start = end
00230 end += length
00231 if python3:
00232 self.goal.mode = str[start:end].decode('utf-8')
00233 else:
00234 self.goal.mode = str[start:end]
00235 start = end
00236 end += 4
00237 (length,) = _struct_I.unpack(str[start:end])
00238 start = end
00239 end += length
00240 if python3:
00241 self.goal.service_name = str[start:end].decode('utf-8')
00242 else:
00243 self.goal.service_name = str[start:end]
00244 _x = self
00245 start = end
00246 end += 5
00247 (_x.goal.duration, _x.goal.planning,) = _struct_fB.unpack(str[start:end])
00248 self.goal.planning = bool(self.goal.planning)
00249 return self
00250 except struct.error as e:
00251 raise genpy.DeserializationError(e)
00252
00253
00254 def serialize_numpy(self, buff, numpy):
00255 """
00256 serialize message with numpy array types into buffer
00257 :param buff: buffer, ``StringIO``
00258 :param numpy: numpy python module
00259 """
00260 try:
00261 _x = self
00262 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00263 _x = self.header.frame_id
00264 length = len(_x)
00265 if python3 or type(_x) == unicode:
00266 _x = _x.encode('utf-8')
00267 length = len(_x)
00268 buff.write(struct.pack('<I%ss'%length, length, _x))
00269 _x = self
00270 buff.write(_struct_2I.pack(_x.goal_id.stamp.secs, _x.goal_id.stamp.nsecs))
00271 _x = self.goal_id.id
00272 length = len(_x)
00273 if python3 or type(_x) == unicode:
00274 _x = _x.encode('utf-8')
00275 length = len(_x)
00276 buff.write(struct.pack('<I%ss'%length, length, _x))
00277 _x = self.goal.function_name
00278 length = len(_x)
00279 if python3 or type(_x) == unicode:
00280 _x = _x.encode('utf-8')
00281 length = len(_x)
00282 buff.write(struct.pack('<I%ss'%length, length, _x))
00283 _x = self.goal.component_name
00284 length = len(_x)
00285 if python3 or type(_x) == unicode:
00286 _x = _x.encode('utf-8')
00287 length = len(_x)
00288 buff.write(struct.pack('<I%ss'%length, length, _x))
00289 _x = self.goal.parameter_name
00290 length = len(_x)
00291 if python3 or type(_x) == unicode:
00292 _x = _x.encode('utf-8')
00293 length = len(_x)
00294 buff.write(struct.pack('<I%ss'%length, length, _x))
00295 _x = self.goal.mode
00296 length = len(_x)
00297 if python3 or type(_x) == unicode:
00298 _x = _x.encode('utf-8')
00299 length = len(_x)
00300 buff.write(struct.pack('<I%ss'%length, length, _x))
00301 _x = self.goal.service_name
00302 length = len(_x)
00303 if python3 or type(_x) == unicode:
00304 _x = _x.encode('utf-8')
00305 length = len(_x)
00306 buff.write(struct.pack('<I%ss'%length, length, _x))
00307 _x = self
00308 buff.write(_struct_fB.pack(_x.goal.duration, _x.goal.planning))
00309 except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00310 except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00311
00312 def deserialize_numpy(self, str, numpy):
00313 """
00314 unpack serialized message in str into this message instance using numpy for array types
00315 :param str: byte array of serialized message, ``str``
00316 :param numpy: numpy python module
00317 """
00318 try:
00319 if self.header is None:
00320 self.header = std_msgs.msg.Header()
00321 if self.goal_id is None:
00322 self.goal_id = actionlib_msgs.msg.GoalID()
00323 if self.goal is None:
00324 self.goal = cob_script_server.msg.ScriptGoal()
00325 end = 0
00326 _x = self
00327 start = end
00328 end += 12
00329 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00330 start = end
00331 end += 4
00332 (length,) = _struct_I.unpack(str[start:end])
00333 start = end
00334 end += length
00335 if python3:
00336 self.header.frame_id = str[start:end].decode('utf-8')
00337 else:
00338 self.header.frame_id = str[start:end]
00339 _x = self
00340 start = end
00341 end += 8
00342 (_x.goal_id.stamp.secs, _x.goal_id.stamp.nsecs,) = _struct_2I.unpack(str[start:end])
00343 start = end
00344 end += 4
00345 (length,) = _struct_I.unpack(str[start:end])
00346 start = end
00347 end += length
00348 if python3:
00349 self.goal_id.id = str[start:end].decode('utf-8')
00350 else:
00351 self.goal_id.id = str[start:end]
00352 start = end
00353 end += 4
00354 (length,) = _struct_I.unpack(str[start:end])
00355 start = end
00356 end += length
00357 if python3:
00358 self.goal.function_name = str[start:end].decode('utf-8')
00359 else:
00360 self.goal.function_name = str[start:end]
00361 start = end
00362 end += 4
00363 (length,) = _struct_I.unpack(str[start:end])
00364 start = end
00365 end += length
00366 if python3:
00367 self.goal.component_name = str[start:end].decode('utf-8')
00368 else:
00369 self.goal.component_name = str[start:end]
00370 start = end
00371 end += 4
00372 (length,) = _struct_I.unpack(str[start:end])
00373 start = end
00374 end += length
00375 if python3:
00376 self.goal.parameter_name = str[start:end].decode('utf-8')
00377 else:
00378 self.goal.parameter_name = str[start:end]
00379 start = end
00380 end += 4
00381 (length,) = _struct_I.unpack(str[start:end])
00382 start = end
00383 end += length
00384 if python3:
00385 self.goal.mode = str[start:end].decode('utf-8')
00386 else:
00387 self.goal.mode = str[start:end]
00388 start = end
00389 end += 4
00390 (length,) = _struct_I.unpack(str[start:end])
00391 start = end
00392 end += length
00393 if python3:
00394 self.goal.service_name = str[start:end].decode('utf-8')
00395 else:
00396 self.goal.service_name = str[start:end]
00397 _x = self
00398 start = end
00399 end += 5
00400 (_x.goal.duration, _x.goal.planning,) = _struct_fB.unpack(str[start:end])
00401 self.goal.planning = bool(self.goal.planning)
00402 return self
00403 except struct.error as e:
00404 raise genpy.DeserializationError(e)
00405
00406 _struct_I = genpy.struct_I
00407 _struct_fB = struct.Struct("<fB")
00408 _struct_3I = struct.Struct("<3I")
00409 _struct_2I = struct.Struct("<2I")