$search
00001 """autogenerated by genmsg_py from StateGoal.msg. Do not edit.""" 00002 import roslib.message 00003 import struct 00004 00005 import cob_script_server.msg 00006 import std_msgs.msg 00007 00008 class StateGoal(roslib.message.Message): 00009 _md5sum = "5d2b1a5f7b8263c9eb024ed31a5dbee9" 00010 _type = "cob_script_server/StateGoal" 00011 _has_header = False #flag to mark the presence of a Header object 00012 _full_text = """# ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ====== 00013 #goal definition 00014 cob_script_server/ScriptState state 00015 00016 ================================================================================ 00017 MSG: cob_script_server/ScriptState 00018 Header header 00019 int16 number 00020 string function_name 00021 string component_name 00022 string parameter_name 00023 string full_graph_name 00024 00025 # Possible execution states 00026 byte UNKNOWN=0 00027 byte ACTIVE=1 00028 byte SUCCEEDED=2 00029 byte FAILED=3 00030 byte PAUSED=4 00031 00032 byte state # state of execution 00033 int16 error_code # current error_code for state 00034 00035 ================================================================================ 00036 MSG: std_msgs/Header 00037 # Standard metadata for higher-level stamped data types. 00038 # This is generally used to communicate timestamped data 00039 # in a particular coordinate frame. 00040 # 00041 # sequence ID: consecutively increasing ID 00042 uint32 seq 00043 #Two-integer timestamp that is expressed as: 00044 # * stamp.secs: seconds (stamp_secs) since epoch 00045 # * stamp.nsecs: nanoseconds since stamp_secs 00046 # time-handling sugar is provided by the client library 00047 time stamp 00048 #Frame this data is associated with 00049 # 0: no frame 00050 # 1: global frame 00051 string frame_id 00052 00053 """ 00054 __slots__ = ['state'] 00055 _slot_types = ['cob_script_server/ScriptState'] 00056 00057 def __init__(self, *args, **kwds): 00058 """ 00059 Constructor. Any message fields that are implicitly/explicitly 00060 set to None will be assigned a default value. The recommend 00061 use is keyword arguments as this is more robust to future message 00062 changes. You cannot mix in-order arguments and keyword arguments. 00063 00064 The available fields are: 00065 state 00066 00067 @param args: complete set of field values, in .msg order 00068 @param kwds: use keyword arguments corresponding to message field names 00069 to set specific fields. 00070 """ 00071 if args or kwds: 00072 super(StateGoal, self).__init__(*args, **kwds) 00073 #message fields cannot be None, assign default values for those that are 00074 if self.state is None: 00075 self.state = cob_script_server.msg.ScriptState() 00076 else: 00077 self.state = cob_script_server.msg.ScriptState() 00078 00079 def _get_types(self): 00080 """ 00081 internal API method 00082 """ 00083 return self._slot_types 00084 00085 def serialize(self, buff): 00086 """ 00087 serialize message into buffer 00088 @param buff: buffer 00089 @type buff: StringIO 00090 """ 00091 try: 00092 _x = self 00093 buff.write(_struct_3I.pack(_x.state.header.seq, _x.state.header.stamp.secs, _x.state.header.stamp.nsecs)) 00094 _x = self.state.header.frame_id 00095 length = len(_x) 00096 buff.write(struct.pack('<I%ss'%length, length, _x)) 00097 buff.write(_struct_h.pack(self.state.number)) 00098 _x = self.state.function_name 00099 length = len(_x) 00100 buff.write(struct.pack('<I%ss'%length, length, _x)) 00101 _x = self.state.component_name 00102 length = len(_x) 00103 buff.write(struct.pack('<I%ss'%length, length, _x)) 00104 _x = self.state.parameter_name 00105 length = len(_x) 00106 buff.write(struct.pack('<I%ss'%length, length, _x)) 00107 _x = self.state.full_graph_name 00108 length = len(_x) 00109 buff.write(struct.pack('<I%ss'%length, length, _x)) 00110 _x = self 00111 buff.write(_struct_bh.pack(_x.state.state, _x.state.error_code)) 00112 except struct.error as se: self._check_types(se) 00113 except TypeError as te: self._check_types(te) 00114 00115 def deserialize(self, str): 00116 """ 00117 unpack serialized message in str into this message instance 00118 @param str: byte array of serialized message 00119 @type str: str 00120 """ 00121 try: 00122 if self.state is None: 00123 self.state = cob_script_server.msg.ScriptState() 00124 end = 0 00125 _x = self 00126 start = end 00127 end += 12 00128 (_x.state.header.seq, _x.state.header.stamp.secs, _x.state.header.stamp.nsecs,) = _struct_3I.unpack(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.state.header.frame_id = str[start:end] 00135 start = end 00136 end += 2 00137 (self.state.number,) = _struct_h.unpack(str[start:end]) 00138 start = end 00139 end += 4 00140 (length,) = _struct_I.unpack(str[start:end]) 00141 start = end 00142 end += length 00143 self.state.function_name = str[start:end] 00144 start = end 00145 end += 4 00146 (length,) = _struct_I.unpack(str[start:end]) 00147 start = end 00148 end += length 00149 self.state.component_name = str[start:end] 00150 start = end 00151 end += 4 00152 (length,) = _struct_I.unpack(str[start:end]) 00153 start = end 00154 end += length 00155 self.state.parameter_name = str[start:end] 00156 start = end 00157 end += 4 00158 (length,) = _struct_I.unpack(str[start:end]) 00159 start = end 00160 end += length 00161 self.state.full_graph_name = str[start:end] 00162 _x = self 00163 start = end 00164 end += 3 00165 (_x.state.state, _x.state.error_code,) = _struct_bh.unpack(str[start:end]) 00166 return self 00167 except struct.error as e: 00168 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00169 00170 00171 def serialize_numpy(self, buff, numpy): 00172 """ 00173 serialize message with numpy array types into buffer 00174 @param buff: buffer 00175 @type buff: StringIO 00176 @param numpy: numpy python module 00177 @type numpy module 00178 """ 00179 try: 00180 _x = self 00181 buff.write(_struct_3I.pack(_x.state.header.seq, _x.state.header.stamp.secs, _x.state.header.stamp.nsecs)) 00182 _x = self.state.header.frame_id 00183 length = len(_x) 00184 buff.write(struct.pack('<I%ss'%length, length, _x)) 00185 buff.write(_struct_h.pack(self.state.number)) 00186 _x = self.state.function_name 00187 length = len(_x) 00188 buff.write(struct.pack('<I%ss'%length, length, _x)) 00189 _x = self.state.component_name 00190 length = len(_x) 00191 buff.write(struct.pack('<I%ss'%length, length, _x)) 00192 _x = self.state.parameter_name 00193 length = len(_x) 00194 buff.write(struct.pack('<I%ss'%length, length, _x)) 00195 _x = self.state.full_graph_name 00196 length = len(_x) 00197 buff.write(struct.pack('<I%ss'%length, length, _x)) 00198 _x = self 00199 buff.write(_struct_bh.pack(_x.state.state, _x.state.error_code)) 00200 except struct.error as se: self._check_types(se) 00201 except TypeError as te: self._check_types(te) 00202 00203 def deserialize_numpy(self, str, numpy): 00204 """ 00205 unpack serialized message in str into this message instance using numpy for array types 00206 @param str: byte array of serialized message 00207 @type str: str 00208 @param numpy: numpy python module 00209 @type numpy: module 00210 """ 00211 try: 00212 if self.state is None: 00213 self.state = cob_script_server.msg.ScriptState() 00214 end = 0 00215 _x = self 00216 start = end 00217 end += 12 00218 (_x.state.header.seq, _x.state.header.stamp.secs, _x.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 self.state.header.frame_id = str[start:end] 00225 start = end 00226 end += 2 00227 (self.state.number,) = _struct_h.unpack(str[start:end]) 00228 start = end 00229 end += 4 00230 (length,) = _struct_I.unpack(str[start:end]) 00231 start = end 00232 end += length 00233 self.state.function_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 self.state.component_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 self.state.parameter_name = str[start:end] 00246 start = end 00247 end += 4 00248 (length,) = _struct_I.unpack(str[start:end]) 00249 start = end 00250 end += length 00251 self.state.full_graph_name = str[start:end] 00252 _x = self 00253 start = end 00254 end += 3 00255 (_x.state.state, _x.state.error_code,) = _struct_bh.unpack(str[start:end]) 00256 return self 00257 except struct.error as e: 00258 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00259 00260 _struct_I = roslib.message.struct_I 00261 _struct_h = struct.Struct("<h") 00262 _struct_3I = struct.Struct("<3I") 00263 _struct_bh = struct.Struct("<bh")