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