$search
00001 """autogenerated by genmsg_py from ManualGraspingAction.msg. Do not edit.""" 00002 import roslib.message 00003 import struct 00004 00005 import srs_assisted_grasping_msgs.msg 00006 import roslib.rostime 00007 import actionlib_msgs.msg 00008 import std_msgs.msg 00009 00010 class ManualGraspingAction(roslib.message.Message): 00011 _md5sum = "e555a5212c7947a3b6c143e2d45c3f28" 00012 _type = "srs_assisted_grasping_msgs/ManualGraspingAction" 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 ManualGraspingActionGoal action_goal 00017 ManualGraspingActionResult action_result 00018 ManualGraspingActionFeedback action_feedback 00019 00020 ================================================================================ 00021 MSG: srs_assisted_grasping_msgs/ManualGraspingActionGoal 00022 # ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ====== 00023 00024 Header header 00025 actionlib_msgs/GoalID goal_id 00026 ManualGraspingGoal 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: srs_assisted_grasping_msgs/ManualGraspingGoal 00061 # ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ====== 00062 # goal 00063 uint8 grasp_type 00064 float32 max_force 00065 bool accept_two_fingers_contact 00066 bool do_not_open_fingers 00067 00068 ================================================================================ 00069 MSG: srs_assisted_grasping_msgs/ManualGraspingActionResult 00070 # ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ====== 00071 00072 Header header 00073 actionlib_msgs/GoalStatus status 00074 ManualGraspingResult result 00075 00076 ================================================================================ 00077 MSG: actionlib_msgs/GoalStatus 00078 GoalID goal_id 00079 uint8 status 00080 uint8 PENDING = 0 # The goal has yet to be processed by the action server 00081 uint8 ACTIVE = 1 # The goal is currently being processed by the action server 00082 uint8 PREEMPTED = 2 # The goal received a cancel request after it started executing 00083 # and has since completed its execution (Terminal State) 00084 uint8 SUCCEEDED = 3 # The goal was achieved successfully by the action server (Terminal State) 00085 uint8 ABORTED = 4 # The goal was aborted during execution by the action server due 00086 # to some failure (Terminal State) 00087 uint8 REJECTED = 5 # The goal was rejected by the action server without being processed, 00088 # because the goal was unattainable or invalid (Terminal State) 00089 uint8 PREEMPTING = 6 # The goal received a cancel request after it started executing 00090 # and has not yet completed execution 00091 uint8 RECALLING = 7 # The goal received a cancel request before it started executing, 00092 # but the action server has not yet confirmed that the goal is canceled 00093 uint8 RECALLED = 8 # The goal received a cancel request before it started executing 00094 # and was successfully cancelled (Terminal State) 00095 uint8 LOST = 9 # An action client can determine that a goal is LOST. This should not be 00096 # sent over the wire by an action server 00097 00098 #Allow for the user to associate a string with GoalStatus for debugging 00099 string text 00100 00101 00102 ================================================================================ 00103 MSG: srs_assisted_grasping_msgs/ManualGraspingResult 00104 # ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ====== 00105 # result 00106 duration time_elapsed 00107 bool grasped 00108 float32 tip1_force 00109 float32 tip2_force 00110 float32 tip3_force 00111 00112 ================================================================================ 00113 MSG: srs_assisted_grasping_msgs/ManualGraspingActionFeedback 00114 # ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ====== 00115 00116 Header header 00117 actionlib_msgs/GoalStatus status 00118 ManualGraspingFeedback feedback 00119 00120 ================================================================================ 00121 MSG: srs_assisted_grasping_msgs/ManualGraspingFeedback 00122 # ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ====== 00123 # feedback 00124 #uint8 progress 00125 float32 tip1_force 00126 float32 tip2_force 00127 float32 tip3_force 00128 00129 00130 """ 00131 __slots__ = ['action_goal','action_result','action_feedback'] 00132 _slot_types = ['srs_assisted_grasping_msgs/ManualGraspingActionGoal','srs_assisted_grasping_msgs/ManualGraspingActionResult','srs_assisted_grasping_msgs/ManualGraspingActionFeedback'] 00133 00134 def __init__(self, *args, **kwds): 00135 """ 00136 Constructor. Any message fields that are implicitly/explicitly 00137 set to None will be assigned a default value. The recommend 00138 use is keyword arguments as this is more robust to future message 00139 changes. You cannot mix in-order arguments and keyword arguments. 00140 00141 The available fields are: 00142 action_goal,action_result,action_feedback 00143 00144 @param args: complete set of field values, in .msg order 00145 @param kwds: use keyword arguments corresponding to message field names 00146 to set specific fields. 00147 """ 00148 if args or kwds: 00149 super(ManualGraspingAction, self).__init__(*args, **kwds) 00150 #message fields cannot be None, assign default values for those that are 00151 if self.action_goal is None: 00152 self.action_goal = srs_assisted_grasping_msgs.msg.ManualGraspingActionGoal() 00153 if self.action_result is None: 00154 self.action_result = srs_assisted_grasping_msgs.msg.ManualGraspingActionResult() 00155 if self.action_feedback is None: 00156 self.action_feedback = srs_assisted_grasping_msgs.msg.ManualGraspingActionFeedback() 00157 else: 00158 self.action_goal = srs_assisted_grasping_msgs.msg.ManualGraspingActionGoal() 00159 self.action_result = srs_assisted_grasping_msgs.msg.ManualGraspingActionResult() 00160 self.action_feedback = srs_assisted_grasping_msgs.msg.ManualGraspingActionFeedback() 00161 00162 def _get_types(self): 00163 """ 00164 internal API method 00165 """ 00166 return self._slot_types 00167 00168 def serialize(self, buff): 00169 """ 00170 serialize message into buffer 00171 @param buff: buffer 00172 @type buff: StringIO 00173 """ 00174 try: 00175 _x = self 00176 buff.write(_struct_3I.pack(_x.action_goal.header.seq, _x.action_goal.header.stamp.secs, _x.action_goal.header.stamp.nsecs)) 00177 _x = self.action_goal.header.frame_id 00178 length = len(_x) 00179 buff.write(struct.pack('<I%ss'%length, length, _x)) 00180 _x = self 00181 buff.write(_struct_2I.pack(_x.action_goal.goal_id.stamp.secs, _x.action_goal.goal_id.stamp.nsecs)) 00182 _x = self.action_goal.goal_id.id 00183 length = len(_x) 00184 buff.write(struct.pack('<I%ss'%length, length, _x)) 00185 _x = self 00186 buff.write(_struct_Bf2B3I.pack(_x.action_goal.goal.grasp_type, _x.action_goal.goal.max_force, _x.action_goal.goal.accept_two_fingers_contact, _x.action_goal.goal.do_not_open_fingers, _x.action_result.header.seq, _x.action_result.header.stamp.secs, _x.action_result.header.stamp.nsecs)) 00187 _x = self.action_result.header.frame_id 00188 length = len(_x) 00189 buff.write(struct.pack('<I%ss'%length, length, _x)) 00190 _x = self 00191 buff.write(_struct_2I.pack(_x.action_result.status.goal_id.stamp.secs, _x.action_result.status.goal_id.stamp.nsecs)) 00192 _x = self.action_result.status.goal_id.id 00193 length = len(_x) 00194 buff.write(struct.pack('<I%ss'%length, length, _x)) 00195 buff.write(_struct_B.pack(self.action_result.status.status)) 00196 _x = self.action_result.status.text 00197 length = len(_x) 00198 buff.write(struct.pack('<I%ss'%length, length, _x)) 00199 _x = self 00200 buff.write(_struct_2iB3f3I.pack(_x.action_result.result.time_elapsed.secs, _x.action_result.result.time_elapsed.nsecs, _x.action_result.result.grasped, _x.action_result.result.tip1_force, _x.action_result.result.tip2_force, _x.action_result.result.tip3_force, _x.action_feedback.header.seq, _x.action_feedback.header.stamp.secs, _x.action_feedback.header.stamp.nsecs)) 00201 _x = self.action_feedback.header.frame_id 00202 length = len(_x) 00203 buff.write(struct.pack('<I%ss'%length, length, _x)) 00204 _x = self 00205 buff.write(_struct_2I.pack(_x.action_feedback.status.goal_id.stamp.secs, _x.action_feedback.status.goal_id.stamp.nsecs)) 00206 _x = self.action_feedback.status.goal_id.id 00207 length = len(_x) 00208 buff.write(struct.pack('<I%ss'%length, length, _x)) 00209 buff.write(_struct_B.pack(self.action_feedback.status.status)) 00210 _x = self.action_feedback.status.text 00211 length = len(_x) 00212 buff.write(struct.pack('<I%ss'%length, length, _x)) 00213 _x = self 00214 buff.write(_struct_3f.pack(_x.action_feedback.feedback.tip1_force, _x.action_feedback.feedback.tip2_force, _x.action_feedback.feedback.tip3_force)) 00215 except struct.error as se: self._check_types(se) 00216 except TypeError as te: self._check_types(te) 00217 00218 def deserialize(self, str): 00219 """ 00220 unpack serialized message in str into this message instance 00221 @param str: byte array of serialized message 00222 @type str: str 00223 """ 00224 try: 00225 if self.action_goal is None: 00226 self.action_goal = srs_assisted_grasping_msgs.msg.ManualGraspingActionGoal() 00227 if self.action_result is None: 00228 self.action_result = srs_assisted_grasping_msgs.msg.ManualGraspingActionResult() 00229 if self.action_feedback is None: 00230 self.action_feedback = srs_assisted_grasping_msgs.msg.ManualGraspingActionFeedback() 00231 end = 0 00232 _x = self 00233 start = end 00234 end += 12 00235 (_x.action_goal.header.seq, _x.action_goal.header.stamp.secs, _x.action_goal.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end]) 00236 start = end 00237 end += 4 00238 (length,) = _struct_I.unpack(str[start:end]) 00239 start = end 00240 end += length 00241 self.action_goal.header.frame_id = str[start:end] 00242 _x = self 00243 start = end 00244 end += 8 00245 (_x.action_goal.goal_id.stamp.secs, _x.action_goal.goal_id.stamp.nsecs,) = _struct_2I.unpack(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.action_goal.goal_id.id = str[start:end] 00252 _x = self 00253 start = end 00254 end += 19 00255 (_x.action_goal.goal.grasp_type, _x.action_goal.goal.max_force, _x.action_goal.goal.accept_two_fingers_contact, _x.action_goal.goal.do_not_open_fingers, _x.action_result.header.seq, _x.action_result.header.stamp.secs, _x.action_result.header.stamp.nsecs,) = _struct_Bf2B3I.unpack(str[start:end]) 00256 self.action_goal.goal.accept_two_fingers_contact = bool(self.action_goal.goal.accept_two_fingers_contact) 00257 self.action_goal.goal.do_not_open_fingers = bool(self.action_goal.goal.do_not_open_fingers) 00258 start = end 00259 end += 4 00260 (length,) = _struct_I.unpack(str[start:end]) 00261 start = end 00262 end += length 00263 self.action_result.header.frame_id = str[start:end] 00264 _x = self 00265 start = end 00266 end += 8 00267 (_x.action_result.status.goal_id.stamp.secs, _x.action_result.status.goal_id.stamp.nsecs,) = _struct_2I.unpack(str[start:end]) 00268 start = end 00269 end += 4 00270 (length,) = _struct_I.unpack(str[start:end]) 00271 start = end 00272 end += length 00273 self.action_result.status.goal_id.id = str[start:end] 00274 start = end 00275 end += 1 00276 (self.action_result.status.status,) = _struct_B.unpack(str[start:end]) 00277 start = end 00278 end += 4 00279 (length,) = _struct_I.unpack(str[start:end]) 00280 start = end 00281 end += length 00282 self.action_result.status.text = str[start:end] 00283 _x = self 00284 start = end 00285 end += 33 00286 (_x.action_result.result.time_elapsed.secs, _x.action_result.result.time_elapsed.nsecs, _x.action_result.result.grasped, _x.action_result.result.tip1_force, _x.action_result.result.tip2_force, _x.action_result.result.tip3_force, _x.action_feedback.header.seq, _x.action_feedback.header.stamp.secs, _x.action_feedback.header.stamp.nsecs,) = _struct_2iB3f3I.unpack(str[start:end]) 00287 self.action_result.result.grasped = bool(self.action_result.result.grasped) 00288 start = end 00289 end += 4 00290 (length,) = _struct_I.unpack(str[start:end]) 00291 start = end 00292 end += length 00293 self.action_feedback.header.frame_id = str[start:end] 00294 _x = self 00295 start = end 00296 end += 8 00297 (_x.action_feedback.status.goal_id.stamp.secs, _x.action_feedback.status.goal_id.stamp.nsecs,) = _struct_2I.unpack(str[start:end]) 00298 start = end 00299 end += 4 00300 (length,) = _struct_I.unpack(str[start:end]) 00301 start = end 00302 end += length 00303 self.action_feedback.status.goal_id.id = str[start:end] 00304 start = end 00305 end += 1 00306 (self.action_feedback.status.status,) = _struct_B.unpack(str[start:end]) 00307 start = end 00308 end += 4 00309 (length,) = _struct_I.unpack(str[start:end]) 00310 start = end 00311 end += length 00312 self.action_feedback.status.text = str[start:end] 00313 _x = self 00314 start = end 00315 end += 12 00316 (_x.action_feedback.feedback.tip1_force, _x.action_feedback.feedback.tip2_force, _x.action_feedback.feedback.tip3_force,) = _struct_3f.unpack(str[start:end]) 00317 return self 00318 except struct.error as e: 00319 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00320 00321 00322 def serialize_numpy(self, buff, numpy): 00323 """ 00324 serialize message with numpy array types into buffer 00325 @param buff: buffer 00326 @type buff: StringIO 00327 @param numpy: numpy python module 00328 @type numpy module 00329 """ 00330 try: 00331 _x = self 00332 buff.write(_struct_3I.pack(_x.action_goal.header.seq, _x.action_goal.header.stamp.secs, _x.action_goal.header.stamp.nsecs)) 00333 _x = self.action_goal.header.frame_id 00334 length = len(_x) 00335 buff.write(struct.pack('<I%ss'%length, length, _x)) 00336 _x = self 00337 buff.write(_struct_2I.pack(_x.action_goal.goal_id.stamp.secs, _x.action_goal.goal_id.stamp.nsecs)) 00338 _x = self.action_goal.goal_id.id 00339 length = len(_x) 00340 buff.write(struct.pack('<I%ss'%length, length, _x)) 00341 _x = self 00342 buff.write(_struct_Bf2B3I.pack(_x.action_goal.goal.grasp_type, _x.action_goal.goal.max_force, _x.action_goal.goal.accept_two_fingers_contact, _x.action_goal.goal.do_not_open_fingers, _x.action_result.header.seq, _x.action_result.header.stamp.secs, _x.action_result.header.stamp.nsecs)) 00343 _x = self.action_result.header.frame_id 00344 length = len(_x) 00345 buff.write(struct.pack('<I%ss'%length, length, _x)) 00346 _x = self 00347 buff.write(_struct_2I.pack(_x.action_result.status.goal_id.stamp.secs, _x.action_result.status.goal_id.stamp.nsecs)) 00348 _x = self.action_result.status.goal_id.id 00349 length = len(_x) 00350 buff.write(struct.pack('<I%ss'%length, length, _x)) 00351 buff.write(_struct_B.pack(self.action_result.status.status)) 00352 _x = self.action_result.status.text 00353 length = len(_x) 00354 buff.write(struct.pack('<I%ss'%length, length, _x)) 00355 _x = self 00356 buff.write(_struct_2iB3f3I.pack(_x.action_result.result.time_elapsed.secs, _x.action_result.result.time_elapsed.nsecs, _x.action_result.result.grasped, _x.action_result.result.tip1_force, _x.action_result.result.tip2_force, _x.action_result.result.tip3_force, _x.action_feedback.header.seq, _x.action_feedback.header.stamp.secs, _x.action_feedback.header.stamp.nsecs)) 00357 _x = self.action_feedback.header.frame_id 00358 length = len(_x) 00359 buff.write(struct.pack('<I%ss'%length, length, _x)) 00360 _x = self 00361 buff.write(_struct_2I.pack(_x.action_feedback.status.goal_id.stamp.secs, _x.action_feedback.status.goal_id.stamp.nsecs)) 00362 _x = self.action_feedback.status.goal_id.id 00363 length = len(_x) 00364 buff.write(struct.pack('<I%ss'%length, length, _x)) 00365 buff.write(_struct_B.pack(self.action_feedback.status.status)) 00366 _x = self.action_feedback.status.text 00367 length = len(_x) 00368 buff.write(struct.pack('<I%ss'%length, length, _x)) 00369 _x = self 00370 buff.write(_struct_3f.pack(_x.action_feedback.feedback.tip1_force, _x.action_feedback.feedback.tip2_force, _x.action_feedback.feedback.tip3_force)) 00371 except struct.error as se: self._check_types(se) 00372 except TypeError as te: self._check_types(te) 00373 00374 def deserialize_numpy(self, str, numpy): 00375 """ 00376 unpack serialized message in str into this message instance using numpy for array types 00377 @param str: byte array of serialized message 00378 @type str: str 00379 @param numpy: numpy python module 00380 @type numpy: module 00381 """ 00382 try: 00383 if self.action_goal is None: 00384 self.action_goal = srs_assisted_grasping_msgs.msg.ManualGraspingActionGoal() 00385 if self.action_result is None: 00386 self.action_result = srs_assisted_grasping_msgs.msg.ManualGraspingActionResult() 00387 if self.action_feedback is None: 00388 self.action_feedback = srs_assisted_grasping_msgs.msg.ManualGraspingActionFeedback() 00389 end = 0 00390 _x = self 00391 start = end 00392 end += 12 00393 (_x.action_goal.header.seq, _x.action_goal.header.stamp.secs, _x.action_goal.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end]) 00394 start = end 00395 end += 4 00396 (length,) = _struct_I.unpack(str[start:end]) 00397 start = end 00398 end += length 00399 self.action_goal.header.frame_id = str[start:end] 00400 _x = self 00401 start = end 00402 end += 8 00403 (_x.action_goal.goal_id.stamp.secs, _x.action_goal.goal_id.stamp.nsecs,) = _struct_2I.unpack(str[start:end]) 00404 start = end 00405 end += 4 00406 (length,) = _struct_I.unpack(str[start:end]) 00407 start = end 00408 end += length 00409 self.action_goal.goal_id.id = str[start:end] 00410 _x = self 00411 start = end 00412 end += 19 00413 (_x.action_goal.goal.grasp_type, _x.action_goal.goal.max_force, _x.action_goal.goal.accept_two_fingers_contact, _x.action_goal.goal.do_not_open_fingers, _x.action_result.header.seq, _x.action_result.header.stamp.secs, _x.action_result.header.stamp.nsecs,) = _struct_Bf2B3I.unpack(str[start:end]) 00414 self.action_goal.goal.accept_two_fingers_contact = bool(self.action_goal.goal.accept_two_fingers_contact) 00415 self.action_goal.goal.do_not_open_fingers = bool(self.action_goal.goal.do_not_open_fingers) 00416 start = end 00417 end += 4 00418 (length,) = _struct_I.unpack(str[start:end]) 00419 start = end 00420 end += length 00421 self.action_result.header.frame_id = str[start:end] 00422 _x = self 00423 start = end 00424 end += 8 00425 (_x.action_result.status.goal_id.stamp.secs, _x.action_result.status.goal_id.stamp.nsecs,) = _struct_2I.unpack(str[start:end]) 00426 start = end 00427 end += 4 00428 (length,) = _struct_I.unpack(str[start:end]) 00429 start = end 00430 end += length 00431 self.action_result.status.goal_id.id = str[start:end] 00432 start = end 00433 end += 1 00434 (self.action_result.status.status,) = _struct_B.unpack(str[start:end]) 00435 start = end 00436 end += 4 00437 (length,) = _struct_I.unpack(str[start:end]) 00438 start = end 00439 end += length 00440 self.action_result.status.text = str[start:end] 00441 _x = self 00442 start = end 00443 end += 33 00444 (_x.action_result.result.time_elapsed.secs, _x.action_result.result.time_elapsed.nsecs, _x.action_result.result.grasped, _x.action_result.result.tip1_force, _x.action_result.result.tip2_force, _x.action_result.result.tip3_force, _x.action_feedback.header.seq, _x.action_feedback.header.stamp.secs, _x.action_feedback.header.stamp.nsecs,) = _struct_2iB3f3I.unpack(str[start:end]) 00445 self.action_result.result.grasped = bool(self.action_result.result.grasped) 00446 start = end 00447 end += 4 00448 (length,) = _struct_I.unpack(str[start:end]) 00449 start = end 00450 end += length 00451 self.action_feedback.header.frame_id = str[start:end] 00452 _x = self 00453 start = end 00454 end += 8 00455 (_x.action_feedback.status.goal_id.stamp.secs, _x.action_feedback.status.goal_id.stamp.nsecs,) = _struct_2I.unpack(str[start:end]) 00456 start = end 00457 end += 4 00458 (length,) = _struct_I.unpack(str[start:end]) 00459 start = end 00460 end += length 00461 self.action_feedback.status.goal_id.id = str[start:end] 00462 start = end 00463 end += 1 00464 (self.action_feedback.status.status,) = _struct_B.unpack(str[start:end]) 00465 start = end 00466 end += 4 00467 (length,) = _struct_I.unpack(str[start:end]) 00468 start = end 00469 end += length 00470 self.action_feedback.status.text = str[start:end] 00471 _x = self 00472 start = end 00473 end += 12 00474 (_x.action_feedback.feedback.tip1_force, _x.action_feedback.feedback.tip2_force, _x.action_feedback.feedback.tip3_force,) = _struct_3f.unpack(str[start:end]) 00475 return self 00476 except struct.error as e: 00477 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00478 00479 _struct_I = roslib.message.struct_I 00480 _struct_Bf2B3I = struct.Struct("<Bf2B3I") 00481 _struct_B = struct.Struct("<B") 00482 _struct_2iB3f3I = struct.Struct("<2iB3f3I") 00483 _struct_3f = struct.Struct("<3f") 00484 _struct_3I = struct.Struct("<3I") 00485 _struct_2I = struct.Struct("<2I")