00001 """autogenerated by genpy from cob_script_server/StateActionGoal.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 StateActionGoal(genpy.Message):
00013 _md5sum = "f58b9a5222bb93570e16f2c52ca3ec7b"
00014 _type = "cob_script_server/StateActionGoal"
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 StateGoal 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/StateGoal
00055 # ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ======
00056 #goal definition
00057 cob_script_server/ScriptState state
00058
00059 ================================================================================
00060 MSG: cob_script_server/ScriptState
00061 Header header
00062 int16 number
00063 string function_name
00064 string component_name
00065 string parameter_name
00066 string full_graph_name
00067
00068 # Possible execution states
00069 byte UNKNOWN=0
00070 byte ACTIVE=1
00071 byte SUCCEEDED=2
00072 byte FAILED=3
00073 byte PAUSED=4
00074
00075 byte state # state of execution
00076 int16 error_code # current error_code for state
00077
00078 """
00079 __slots__ = ['header','goal_id','goal']
00080 _slot_types = ['std_msgs/Header','actionlib_msgs/GoalID','cob_script_server/StateGoal']
00081
00082 def __init__(self, *args, **kwds):
00083 """
00084 Constructor. Any message fields that are implicitly/explicitly
00085 set to None will be assigned a default value. The recommend
00086 use is keyword arguments as this is more robust to future message
00087 changes. You cannot mix in-order arguments and keyword arguments.
00088
00089 The available fields are:
00090 header,goal_id,goal
00091
00092 :param args: complete set of field values, in .msg order
00093 :param kwds: use keyword arguments corresponding to message field names
00094 to set specific fields.
00095 """
00096 if args or kwds:
00097 super(StateActionGoal, self).__init__(*args, **kwds)
00098
00099 if self.header is None:
00100 self.header = std_msgs.msg.Header()
00101 if self.goal_id is None:
00102 self.goal_id = actionlib_msgs.msg.GoalID()
00103 if self.goal is None:
00104 self.goal = cob_script_server.msg.StateGoal()
00105 else:
00106 self.header = std_msgs.msg.Header()
00107 self.goal_id = actionlib_msgs.msg.GoalID()
00108 self.goal = cob_script_server.msg.StateGoal()
00109
00110 def _get_types(self):
00111 """
00112 internal API method
00113 """
00114 return self._slot_types
00115
00116 def serialize(self, buff):
00117 """
00118 serialize message into buffer
00119 :param buff: buffer, ``StringIO``
00120 """
00121 try:
00122 _x = self
00123 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00124 _x = self.header.frame_id
00125 length = len(_x)
00126 if python3 or type(_x) == unicode:
00127 _x = _x.encode('utf-8')
00128 length = len(_x)
00129 buff.write(struct.pack('<I%ss'%length, length, _x))
00130 _x = self
00131 buff.write(_struct_2I.pack(_x.goal_id.stamp.secs, _x.goal_id.stamp.nsecs))
00132 _x = self.goal_id.id
00133 length = len(_x)
00134 if python3 or type(_x) == unicode:
00135 _x = _x.encode('utf-8')
00136 length = len(_x)
00137 buff.write(struct.pack('<I%ss'%length, length, _x))
00138 _x = self
00139 buff.write(_struct_3I.pack(_x.goal.state.header.seq, _x.goal.state.header.stamp.secs, _x.goal.state.header.stamp.nsecs))
00140 _x = self.goal.state.header.frame_id
00141 length = len(_x)
00142 if python3 or type(_x) == unicode:
00143 _x = _x.encode('utf-8')
00144 length = len(_x)
00145 buff.write(struct.pack('<I%ss'%length, length, _x))
00146 buff.write(_struct_h.pack(self.goal.state.number))
00147 _x = self.goal.state.function_name
00148 length = len(_x)
00149 if python3 or type(_x) == unicode:
00150 _x = _x.encode('utf-8')
00151 length = len(_x)
00152 buff.write(struct.pack('<I%ss'%length, length, _x))
00153 _x = self.goal.state.component_name
00154 length = len(_x)
00155 if python3 or type(_x) == unicode:
00156 _x = _x.encode('utf-8')
00157 length = len(_x)
00158 buff.write(struct.pack('<I%ss'%length, length, _x))
00159 _x = self.goal.state.parameter_name
00160 length = len(_x)
00161 if python3 or type(_x) == unicode:
00162 _x = _x.encode('utf-8')
00163 length = len(_x)
00164 buff.write(struct.pack('<I%ss'%length, length, _x))
00165 _x = self.goal.state.full_graph_name
00166 length = len(_x)
00167 if python3 or type(_x) == unicode:
00168 _x = _x.encode('utf-8')
00169 length = len(_x)
00170 buff.write(struct.pack('<I%ss'%length, length, _x))
00171 _x = self
00172 buff.write(_struct_bh.pack(_x.goal.state.state, _x.goal.state.error_code))
00173 except struct.error as se: self._check_types(se)
00174 except TypeError as te: self._check_types(te)
00175
00176 def deserialize(self, str):
00177 """
00178 unpack serialized message in str into this message instance
00179 :param str: byte array of serialized message, ``str``
00180 """
00181 try:
00182 if self.header is None:
00183 self.header = std_msgs.msg.Header()
00184 if self.goal_id is None:
00185 self.goal_id = actionlib_msgs.msg.GoalID()
00186 if self.goal is None:
00187 self.goal = cob_script_server.msg.StateGoal()
00188 end = 0
00189 _x = self
00190 start = end
00191 end += 12
00192 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00193 start = end
00194 end += 4
00195 (length,) = _struct_I.unpack(str[start:end])
00196 start = end
00197 end += length
00198 if python3:
00199 self.header.frame_id = str[start:end].decode('utf-8')
00200 else:
00201 self.header.frame_id = str[start:end]
00202 _x = self
00203 start = end
00204 end += 8
00205 (_x.goal_id.stamp.secs, _x.goal_id.stamp.nsecs,) = _struct_2I.unpack(str[start:end])
00206 start = end
00207 end += 4
00208 (length,) = _struct_I.unpack(str[start:end])
00209 start = end
00210 end += length
00211 if python3:
00212 self.goal_id.id = str[start:end].decode('utf-8')
00213 else:
00214 self.goal_id.id = str[start:end]
00215 _x = self
00216 start = end
00217 end += 12
00218 (_x.goal.state.header.seq, _x.goal.state.header.stamp.secs, _x.goal.state.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00219 start = end
00220 end += 4
00221 (length,) = _struct_I.unpack(str[start:end])
00222 start = end
00223 end += length
00224 if python3:
00225 self.goal.state.header.frame_id = str[start:end].decode('utf-8')
00226 else:
00227 self.goal.state.header.frame_id = str[start:end]
00228 start = end
00229 end += 2
00230 (self.goal.state.number,) = _struct_h.unpack(str[start:end])
00231 start = end
00232 end += 4
00233 (length,) = _struct_I.unpack(str[start:end])
00234 start = end
00235 end += length
00236 if python3:
00237 self.goal.state.function_name = str[start:end].decode('utf-8')
00238 else:
00239 self.goal.state.function_name = str[start:end]
00240 start = end
00241 end += 4
00242 (length,) = _struct_I.unpack(str[start:end])
00243 start = end
00244 end += length
00245 if python3:
00246 self.goal.state.component_name = str[start:end].decode('utf-8')
00247 else:
00248 self.goal.state.component_name = str[start:end]
00249 start = end
00250 end += 4
00251 (length,) = _struct_I.unpack(str[start:end])
00252 start = end
00253 end += length
00254 if python3:
00255 self.goal.state.parameter_name = str[start:end].decode('utf-8')
00256 else:
00257 self.goal.state.parameter_name = str[start:end]
00258 start = end
00259 end += 4
00260 (length,) = _struct_I.unpack(str[start:end])
00261 start = end
00262 end += length
00263 if python3:
00264 self.goal.state.full_graph_name = str[start:end].decode('utf-8')
00265 else:
00266 self.goal.state.full_graph_name = str[start:end]
00267 _x = self
00268 start = end
00269 end += 3
00270 (_x.goal.state.state, _x.goal.state.error_code,) = _struct_bh.unpack(str[start:end])
00271 return self
00272 except struct.error as e:
00273 raise genpy.DeserializationError(e)
00274
00275
00276 def serialize_numpy(self, buff, numpy):
00277 """
00278 serialize message with numpy array types into buffer
00279 :param buff: buffer, ``StringIO``
00280 :param numpy: numpy python module
00281 """
00282 try:
00283 _x = self
00284 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00285 _x = self.header.frame_id
00286 length = len(_x)
00287 if python3 or type(_x) == unicode:
00288 _x = _x.encode('utf-8')
00289 length = len(_x)
00290 buff.write(struct.pack('<I%ss'%length, length, _x))
00291 _x = self
00292 buff.write(_struct_2I.pack(_x.goal_id.stamp.secs, _x.goal_id.stamp.nsecs))
00293 _x = self.goal_id.id
00294 length = len(_x)
00295 if python3 or type(_x) == unicode:
00296 _x = _x.encode('utf-8')
00297 length = len(_x)
00298 buff.write(struct.pack('<I%ss'%length, length, _x))
00299 _x = self
00300 buff.write(_struct_3I.pack(_x.goal.state.header.seq, _x.goal.state.header.stamp.secs, _x.goal.state.header.stamp.nsecs))
00301 _x = self.goal.state.header.frame_id
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 buff.write(_struct_h.pack(self.goal.state.number))
00308 _x = self.goal.state.function_name
00309 length = len(_x)
00310 if python3 or type(_x) == unicode:
00311 _x = _x.encode('utf-8')
00312 length = len(_x)
00313 buff.write(struct.pack('<I%ss'%length, length, _x))
00314 _x = self.goal.state.component_name
00315 length = len(_x)
00316 if python3 or type(_x) == unicode:
00317 _x = _x.encode('utf-8')
00318 length = len(_x)
00319 buff.write(struct.pack('<I%ss'%length, length, _x))
00320 _x = self.goal.state.parameter_name
00321 length = len(_x)
00322 if python3 or type(_x) == unicode:
00323 _x = _x.encode('utf-8')
00324 length = len(_x)
00325 buff.write(struct.pack('<I%ss'%length, length, _x))
00326 _x = self.goal.state.full_graph_name
00327 length = len(_x)
00328 if python3 or type(_x) == unicode:
00329 _x = _x.encode('utf-8')
00330 length = len(_x)
00331 buff.write(struct.pack('<I%ss'%length, length, _x))
00332 _x = self
00333 buff.write(_struct_bh.pack(_x.goal.state.state, _x.goal.state.error_code))
00334 except struct.error as se: self._check_types(se)
00335 except TypeError as te: self._check_types(te)
00336
00337 def deserialize_numpy(self, str, numpy):
00338 """
00339 unpack serialized message in str into this message instance using numpy for array types
00340 :param str: byte array of serialized message, ``str``
00341 :param numpy: numpy python module
00342 """
00343 try:
00344 if self.header is None:
00345 self.header = std_msgs.msg.Header()
00346 if self.goal_id is None:
00347 self.goal_id = actionlib_msgs.msg.GoalID()
00348 if self.goal is None:
00349 self.goal = cob_script_server.msg.StateGoal()
00350 end = 0
00351 _x = self
00352 start = end
00353 end += 12
00354 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00355 start = end
00356 end += 4
00357 (length,) = _struct_I.unpack(str[start:end])
00358 start = end
00359 end += length
00360 if python3:
00361 self.header.frame_id = str[start:end].decode('utf-8')
00362 else:
00363 self.header.frame_id = str[start:end]
00364 _x = self
00365 start = end
00366 end += 8
00367 (_x.goal_id.stamp.secs, _x.goal_id.stamp.nsecs,) = _struct_2I.unpack(str[start:end])
00368 start = end
00369 end += 4
00370 (length,) = _struct_I.unpack(str[start:end])
00371 start = end
00372 end += length
00373 if python3:
00374 self.goal_id.id = str[start:end].decode('utf-8')
00375 else:
00376 self.goal_id.id = str[start:end]
00377 _x = self
00378 start = end
00379 end += 12
00380 (_x.goal.state.header.seq, _x.goal.state.header.stamp.secs, _x.goal.state.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00381 start = end
00382 end += 4
00383 (length,) = _struct_I.unpack(str[start:end])
00384 start = end
00385 end += length
00386 if python3:
00387 self.goal.state.header.frame_id = str[start:end].decode('utf-8')
00388 else:
00389 self.goal.state.header.frame_id = str[start:end]
00390 start = end
00391 end += 2
00392 (self.goal.state.number,) = _struct_h.unpack(str[start:end])
00393 start = end
00394 end += 4
00395 (length,) = _struct_I.unpack(str[start:end])
00396 start = end
00397 end += length
00398 if python3:
00399 self.goal.state.function_name = str[start:end].decode('utf-8')
00400 else:
00401 self.goal.state.function_name = str[start:end]
00402 start = end
00403 end += 4
00404 (length,) = _struct_I.unpack(str[start:end])
00405 start = end
00406 end += length
00407 if python3:
00408 self.goal.state.component_name = str[start:end].decode('utf-8')
00409 else:
00410 self.goal.state.component_name = str[start:end]
00411 start = end
00412 end += 4
00413 (length,) = _struct_I.unpack(str[start:end])
00414 start = end
00415 end += length
00416 if python3:
00417 self.goal.state.parameter_name = str[start:end].decode('utf-8')
00418 else:
00419 self.goal.state.parameter_name = str[start:end]
00420 start = end
00421 end += 4
00422 (length,) = _struct_I.unpack(str[start:end])
00423 start = end
00424 end += length
00425 if python3:
00426 self.goal.state.full_graph_name = str[start:end].decode('utf-8')
00427 else:
00428 self.goal.state.full_graph_name = str[start:end]
00429 _x = self
00430 start = end
00431 end += 3
00432 (_x.goal.state.state, _x.goal.state.error_code,) = _struct_bh.unpack(str[start:end])
00433 return self
00434 except struct.error as e:
00435 raise genpy.DeserializationError(e)
00436
00437 _struct_I = genpy.struct_I
00438 _struct_h = struct.Struct("<h")
00439 _struct_3I = struct.Struct("<3I")
00440 _struct_bh = struct.Struct("<bh")
00441 _struct_2I = struct.Struct("<2I")