$search
00001 """autogenerated by genmsg_py from TestAction.msg. Do not edit.""" 00002 import roslib.message 00003 import struct 00004 00005 import actionlib_msgs.msg 00006 import roslib.rostime 00007 import actionlib.msg 00008 import std_msgs.msg 00009 00010 class TestAction(roslib.message.Message): 00011 _md5sum = "991e87a72802262dfbe5d1b3cf6efc9a" 00012 _type = "actionlib/TestAction" 00013 _has_header = False #flag to mark the presence of a Header object 00014 _full_text = """# ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ====== 00015 00016 TestActionGoal action_goal 00017 TestActionResult action_result 00018 TestActionFeedback action_feedback 00019 00020 ================================================================================ 00021 MSG: actionlib/TestActionGoal 00022 # ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ====== 00023 00024 Header header 00025 actionlib_msgs/GoalID goal_id 00026 TestGoal goal 00027 00028 ================================================================================ 00029 MSG: std_msgs/Header 00030 # Standard metadata for higher-level stamped data types. 00031 # This is generally used to communicate timestamped data 00032 # in a particular coordinate frame. 00033 # 00034 # sequence ID: consecutively increasing ID 00035 uint32 seq 00036 #Two-integer timestamp that is expressed as: 00037 # * stamp.secs: seconds (stamp_secs) since epoch 00038 # * stamp.nsecs: nanoseconds since stamp_secs 00039 # time-handling sugar is provided by the client library 00040 time stamp 00041 #Frame this data is associated with 00042 # 0: no frame 00043 # 1: global frame 00044 string frame_id 00045 00046 ================================================================================ 00047 MSG: actionlib_msgs/GoalID 00048 # The stamp should store the time at which this goal was requested. 00049 # It is used by an action server when it tries to preempt all 00050 # goals that were requested before a certain time 00051 time stamp 00052 00053 # The id provides a way to associate feedback and 00054 # result message with specific goal requests. The id 00055 # specified must be unique. 00056 string id 00057 00058 00059 ================================================================================ 00060 MSG: actionlib/TestGoal 00061 # ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ====== 00062 int32 goal 00063 00064 ================================================================================ 00065 MSG: actionlib/TestActionResult 00066 # ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ====== 00067 00068 Header header 00069 actionlib_msgs/GoalStatus status 00070 TestResult result 00071 00072 ================================================================================ 00073 MSG: actionlib_msgs/GoalStatus 00074 GoalID goal_id 00075 uint8 status 00076 uint8 PENDING = 0 # The goal has yet to be processed by the action server 00077 uint8 ACTIVE = 1 # The goal is currently being processed by the action server 00078 uint8 PREEMPTED = 2 # The goal received a cancel request after it started executing 00079 # and has since completed its execution (Terminal State) 00080 uint8 SUCCEEDED = 3 # The goal was achieved successfully by the action server (Terminal State) 00081 uint8 ABORTED = 4 # The goal was aborted during execution by the action server due 00082 # to some failure (Terminal State) 00083 uint8 REJECTED = 5 # The goal was rejected by the action server without being processed, 00084 # because the goal was unattainable or invalid (Terminal State) 00085 uint8 PREEMPTING = 6 # The goal received a cancel request after it started executing 00086 # and has not yet completed execution 00087 uint8 RECALLING = 7 # The goal received a cancel request before it started executing, 00088 # but the action server has not yet confirmed that the goal is canceled 00089 uint8 RECALLED = 8 # The goal received a cancel request before it started executing 00090 # and was successfully cancelled (Terminal State) 00091 uint8 LOST = 9 # An action client can determine that a goal is LOST. This should not be 00092 # sent over the wire by an action server 00093 00094 #Allow for the user to associate a string with GoalStatus for debugging 00095 string text 00096 00097 00098 ================================================================================ 00099 MSG: actionlib/TestResult 00100 # ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ====== 00101 int32 result 00102 00103 ================================================================================ 00104 MSG: actionlib/TestActionFeedback 00105 # ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ====== 00106 00107 Header header 00108 actionlib_msgs/GoalStatus status 00109 TestFeedback feedback 00110 00111 ================================================================================ 00112 MSG: actionlib/TestFeedback 00113 # ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ====== 00114 int32 feedback 00115 00116 00117 """ 00118 __slots__ = ['action_goal','action_result','action_feedback'] 00119 _slot_types = ['actionlib/TestActionGoal','actionlib/TestActionResult','actionlib/TestActionFeedback'] 00120 00121 def __init__(self, *args, **kwds): 00122 """ 00123 Constructor. Any message fields that are implicitly/explicitly 00124 set to None will be assigned a default value. The recommend 00125 use is keyword arguments as this is more robust to future message 00126 changes. You cannot mix in-order arguments and keyword arguments. 00127 00128 The available fields are: 00129 action_goal,action_result,action_feedback 00130 00131 @param args: complete set of field values, in .msg order 00132 @param kwds: use keyword arguments corresponding to message field names 00133 to set specific fields. 00134 """ 00135 if args or kwds: 00136 super(TestAction, self).__init__(*args, **kwds) 00137 #message fields cannot be None, assign default values for those that are 00138 if self.action_goal is None: 00139 self.action_goal = actionlib.msg.TestActionGoal() 00140 if self.action_result is None: 00141 self.action_result = actionlib.msg.TestActionResult() 00142 if self.action_feedback is None: 00143 self.action_feedback = actionlib.msg.TestActionFeedback() 00144 else: 00145 self.action_goal = actionlib.msg.TestActionGoal() 00146 self.action_result = actionlib.msg.TestActionResult() 00147 self.action_feedback = actionlib.msg.TestActionFeedback() 00148 00149 def _get_types(self): 00150 """ 00151 internal API method 00152 """ 00153 return self._slot_types 00154 00155 def serialize(self, buff): 00156 """ 00157 serialize message into buffer 00158 @param buff: buffer 00159 @type buff: StringIO 00160 """ 00161 try: 00162 _x = self 00163 buff.write(_struct_3I.pack(_x.action_goal.header.seq, _x.action_goal.header.stamp.secs, _x.action_goal.header.stamp.nsecs)) 00164 _x = self.action_goal.header.frame_id 00165 length = len(_x) 00166 buff.write(struct.pack('<I%ss'%length, length, _x)) 00167 _x = self 00168 buff.write(_struct_2I.pack(_x.action_goal.goal_id.stamp.secs, _x.action_goal.goal_id.stamp.nsecs)) 00169 _x = self.action_goal.goal_id.id 00170 length = len(_x) 00171 buff.write(struct.pack('<I%ss'%length, length, _x)) 00172 _x = self 00173 buff.write(_struct_i3I.pack(_x.action_goal.goal.goal, _x.action_result.header.seq, _x.action_result.header.stamp.secs, _x.action_result.header.stamp.nsecs)) 00174 _x = self.action_result.header.frame_id 00175 length = len(_x) 00176 buff.write(struct.pack('<I%ss'%length, length, _x)) 00177 _x = self 00178 buff.write(_struct_2I.pack(_x.action_result.status.goal_id.stamp.secs, _x.action_result.status.goal_id.stamp.nsecs)) 00179 _x = self.action_result.status.goal_id.id 00180 length = len(_x) 00181 buff.write(struct.pack('<I%ss'%length, length, _x)) 00182 buff.write(_struct_B.pack(self.action_result.status.status)) 00183 _x = self.action_result.status.text 00184 length = len(_x) 00185 buff.write(struct.pack('<I%ss'%length, length, _x)) 00186 _x = self 00187 buff.write(_struct_i3I.pack(_x.action_result.result.result, _x.action_feedback.header.seq, _x.action_feedback.header.stamp.secs, _x.action_feedback.header.stamp.nsecs)) 00188 _x = self.action_feedback.header.frame_id 00189 length = len(_x) 00190 buff.write(struct.pack('<I%ss'%length, length, _x)) 00191 _x = self 00192 buff.write(_struct_2I.pack(_x.action_feedback.status.goal_id.stamp.secs, _x.action_feedback.status.goal_id.stamp.nsecs)) 00193 _x = self.action_feedback.status.goal_id.id 00194 length = len(_x) 00195 buff.write(struct.pack('<I%ss'%length, length, _x)) 00196 buff.write(_struct_B.pack(self.action_feedback.status.status)) 00197 _x = self.action_feedback.status.text 00198 length = len(_x) 00199 buff.write(struct.pack('<I%ss'%length, length, _x)) 00200 buff.write(_struct_i.pack(self.action_feedback.feedback.feedback)) 00201 except struct.error as se: self._check_types(se) 00202 except TypeError as te: self._check_types(te) 00203 00204 def deserialize(self, str): 00205 """ 00206 unpack serialized message in str into this message instance 00207 @param str: byte array of serialized message 00208 @type str: str 00209 """ 00210 try: 00211 if self.action_goal is None: 00212 self.action_goal = actionlib.msg.TestActionGoal() 00213 if self.action_result is None: 00214 self.action_result = actionlib.msg.TestActionResult() 00215 if self.action_feedback is None: 00216 self.action_feedback = actionlib.msg.TestActionFeedback() 00217 end = 0 00218 _x = self 00219 start = end 00220 end += 12 00221 (_x.action_goal.header.seq, _x.action_goal.header.stamp.secs, _x.action_goal.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end]) 00222 start = end 00223 end += 4 00224 (length,) = _struct_I.unpack(str[start:end]) 00225 start = end 00226 end += length 00227 self.action_goal.header.frame_id = str[start:end] 00228 _x = self 00229 start = end 00230 end += 8 00231 (_x.action_goal.goal_id.stamp.secs, _x.action_goal.goal_id.stamp.nsecs,) = _struct_2I.unpack(str[start:end]) 00232 start = end 00233 end += 4 00234 (length,) = _struct_I.unpack(str[start:end]) 00235 start = end 00236 end += length 00237 self.action_goal.goal_id.id = str[start:end] 00238 _x = self 00239 start = end 00240 end += 16 00241 (_x.action_goal.goal.goal, _x.action_result.header.seq, _x.action_result.header.stamp.secs, _x.action_result.header.stamp.nsecs,) = _struct_i3I.unpack(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.action_result.header.frame_id = str[start:end] 00248 _x = self 00249 start = end 00250 end += 8 00251 (_x.action_result.status.goal_id.stamp.secs, _x.action_result.status.goal_id.stamp.nsecs,) = _struct_2I.unpack(str[start:end]) 00252 start = end 00253 end += 4 00254 (length,) = _struct_I.unpack(str[start:end]) 00255 start = end 00256 end += length 00257 self.action_result.status.goal_id.id = str[start:end] 00258 start = end 00259 end += 1 00260 (self.action_result.status.status,) = _struct_B.unpack(str[start:end]) 00261 start = end 00262 end += 4 00263 (length,) = _struct_I.unpack(str[start:end]) 00264 start = end 00265 end += length 00266 self.action_result.status.text = str[start:end] 00267 _x = self 00268 start = end 00269 end += 16 00270 (_x.action_result.result.result, _x.action_feedback.header.seq, _x.action_feedback.header.stamp.secs, _x.action_feedback.header.stamp.nsecs,) = _struct_i3I.unpack(str[start:end]) 00271 start = end 00272 end += 4 00273 (length,) = _struct_I.unpack(str[start:end]) 00274 start = end 00275 end += length 00276 self.action_feedback.header.frame_id = str[start:end] 00277 _x = self 00278 start = end 00279 end += 8 00280 (_x.action_feedback.status.goal_id.stamp.secs, _x.action_feedback.status.goal_id.stamp.nsecs,) = _struct_2I.unpack(str[start:end]) 00281 start = end 00282 end += 4 00283 (length,) = _struct_I.unpack(str[start:end]) 00284 start = end 00285 end += length 00286 self.action_feedback.status.goal_id.id = str[start:end] 00287 start = end 00288 end += 1 00289 (self.action_feedback.status.status,) = _struct_B.unpack(str[start:end]) 00290 start = end 00291 end += 4 00292 (length,) = _struct_I.unpack(str[start:end]) 00293 start = end 00294 end += length 00295 self.action_feedback.status.text = str[start:end] 00296 start = end 00297 end += 4 00298 (self.action_feedback.feedback.feedback,) = _struct_i.unpack(str[start:end]) 00299 return self 00300 except struct.error as e: 00301 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00302 00303 00304 def serialize_numpy(self, buff, numpy): 00305 """ 00306 serialize message with numpy array types into buffer 00307 @param buff: buffer 00308 @type buff: StringIO 00309 @param numpy: numpy python module 00310 @type numpy module 00311 """ 00312 try: 00313 _x = self 00314 buff.write(_struct_3I.pack(_x.action_goal.header.seq, _x.action_goal.header.stamp.secs, _x.action_goal.header.stamp.nsecs)) 00315 _x = self.action_goal.header.frame_id 00316 length = len(_x) 00317 buff.write(struct.pack('<I%ss'%length, length, _x)) 00318 _x = self 00319 buff.write(_struct_2I.pack(_x.action_goal.goal_id.stamp.secs, _x.action_goal.goal_id.stamp.nsecs)) 00320 _x = self.action_goal.goal_id.id 00321 length = len(_x) 00322 buff.write(struct.pack('<I%ss'%length, length, _x)) 00323 _x = self 00324 buff.write(_struct_i3I.pack(_x.action_goal.goal.goal, _x.action_result.header.seq, _x.action_result.header.stamp.secs, _x.action_result.header.stamp.nsecs)) 00325 _x = self.action_result.header.frame_id 00326 length = len(_x) 00327 buff.write(struct.pack('<I%ss'%length, length, _x)) 00328 _x = self 00329 buff.write(_struct_2I.pack(_x.action_result.status.goal_id.stamp.secs, _x.action_result.status.goal_id.stamp.nsecs)) 00330 _x = self.action_result.status.goal_id.id 00331 length = len(_x) 00332 buff.write(struct.pack('<I%ss'%length, length, _x)) 00333 buff.write(_struct_B.pack(self.action_result.status.status)) 00334 _x = self.action_result.status.text 00335 length = len(_x) 00336 buff.write(struct.pack('<I%ss'%length, length, _x)) 00337 _x = self 00338 buff.write(_struct_i3I.pack(_x.action_result.result.result, _x.action_feedback.header.seq, _x.action_feedback.header.stamp.secs, _x.action_feedback.header.stamp.nsecs)) 00339 _x = self.action_feedback.header.frame_id 00340 length = len(_x) 00341 buff.write(struct.pack('<I%ss'%length, length, _x)) 00342 _x = self 00343 buff.write(_struct_2I.pack(_x.action_feedback.status.goal_id.stamp.secs, _x.action_feedback.status.goal_id.stamp.nsecs)) 00344 _x = self.action_feedback.status.goal_id.id 00345 length = len(_x) 00346 buff.write(struct.pack('<I%ss'%length, length, _x)) 00347 buff.write(_struct_B.pack(self.action_feedback.status.status)) 00348 _x = self.action_feedback.status.text 00349 length = len(_x) 00350 buff.write(struct.pack('<I%ss'%length, length, _x)) 00351 buff.write(_struct_i.pack(self.action_feedback.feedback.feedback)) 00352 except struct.error as se: self._check_types(se) 00353 except TypeError as te: self._check_types(te) 00354 00355 def deserialize_numpy(self, str, numpy): 00356 """ 00357 unpack serialized message in str into this message instance using numpy for array types 00358 @param str: byte array of serialized message 00359 @type str: str 00360 @param numpy: numpy python module 00361 @type numpy: module 00362 """ 00363 try: 00364 if self.action_goal is None: 00365 self.action_goal = actionlib.msg.TestActionGoal() 00366 if self.action_result is None: 00367 self.action_result = actionlib.msg.TestActionResult() 00368 if self.action_feedback is None: 00369 self.action_feedback = actionlib.msg.TestActionFeedback() 00370 end = 0 00371 _x = self 00372 start = end 00373 end += 12 00374 (_x.action_goal.header.seq, _x.action_goal.header.stamp.secs, _x.action_goal.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end]) 00375 start = end 00376 end += 4 00377 (length,) = _struct_I.unpack(str[start:end]) 00378 start = end 00379 end += length 00380 self.action_goal.header.frame_id = str[start:end] 00381 _x = self 00382 start = end 00383 end += 8 00384 (_x.action_goal.goal_id.stamp.secs, _x.action_goal.goal_id.stamp.nsecs,) = _struct_2I.unpack(str[start:end]) 00385 start = end 00386 end += 4 00387 (length,) = _struct_I.unpack(str[start:end]) 00388 start = end 00389 end += length 00390 self.action_goal.goal_id.id = str[start:end] 00391 _x = self 00392 start = end 00393 end += 16 00394 (_x.action_goal.goal.goal, _x.action_result.header.seq, _x.action_result.header.stamp.secs, _x.action_result.header.stamp.nsecs,) = _struct_i3I.unpack(str[start:end]) 00395 start = end 00396 end += 4 00397 (length,) = _struct_I.unpack(str[start:end]) 00398 start = end 00399 end += length 00400 self.action_result.header.frame_id = str[start:end] 00401 _x = self 00402 start = end 00403 end += 8 00404 (_x.action_result.status.goal_id.stamp.secs, _x.action_result.status.goal_id.stamp.nsecs,) = _struct_2I.unpack(str[start:end]) 00405 start = end 00406 end += 4 00407 (length,) = _struct_I.unpack(str[start:end]) 00408 start = end 00409 end += length 00410 self.action_result.status.goal_id.id = str[start:end] 00411 start = end 00412 end += 1 00413 (self.action_result.status.status,) = _struct_B.unpack(str[start:end]) 00414 start = end 00415 end += 4 00416 (length,) = _struct_I.unpack(str[start:end]) 00417 start = end 00418 end += length 00419 self.action_result.status.text = str[start:end] 00420 _x = self 00421 start = end 00422 end += 16 00423 (_x.action_result.result.result, _x.action_feedback.header.seq, _x.action_feedback.header.stamp.secs, _x.action_feedback.header.stamp.nsecs,) = _struct_i3I.unpack(str[start:end]) 00424 start = end 00425 end += 4 00426 (length,) = _struct_I.unpack(str[start:end]) 00427 start = end 00428 end += length 00429 self.action_feedback.header.frame_id = str[start:end] 00430 _x = self 00431 start = end 00432 end += 8 00433 (_x.action_feedback.status.goal_id.stamp.secs, _x.action_feedback.status.goal_id.stamp.nsecs,) = _struct_2I.unpack(str[start:end]) 00434 start = end 00435 end += 4 00436 (length,) = _struct_I.unpack(str[start:end]) 00437 start = end 00438 end += length 00439 self.action_feedback.status.goal_id.id = str[start:end] 00440 start = end 00441 end += 1 00442 (self.action_feedback.status.status,) = _struct_B.unpack(str[start:end]) 00443 start = end 00444 end += 4 00445 (length,) = _struct_I.unpack(str[start:end]) 00446 start = end 00447 end += length 00448 self.action_feedback.status.text = str[start:end] 00449 start = end 00450 end += 4 00451 (self.action_feedback.feedback.feedback,) = _struct_i.unpack(str[start:end]) 00452 return self 00453 except struct.error as e: 00454 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00455 00456 _struct_I = roslib.message.struct_I 00457 _struct_i = struct.Struct("<i") 00458 _struct_3I = struct.Struct("<3I") 00459 _struct_B = struct.Struct("<B") 00460 _struct_2I = struct.Struct("<2I") 00461 _struct_i3I = struct.Struct("<i3I")