00001 """autogenerated by genpy from pr2_gripper_sensor_msgs/PR2GripperFindContactAction.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 pr2_gripper_sensor_msgs.msg
00010 import std_msgs.msg
00011
00012 class PR2GripperFindContactAction(genpy.Message):
00013 _md5sum = "99ab2df1bbde46c447b38f28b7896d16"
00014 _type = "pr2_gripper_sensor_msgs/PR2GripperFindContactAction"
00015 _has_header = False
00016 _full_text = """# ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ======
00017
00018 PR2GripperFindContactActionGoal action_goal
00019 PR2GripperFindContactActionResult action_result
00020 PR2GripperFindContactActionFeedback action_feedback
00021
00022 ================================================================================
00023 MSG: pr2_gripper_sensor_msgs/PR2GripperFindContactActionGoal
00024 # ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ======
00025
00026 Header header
00027 actionlib_msgs/GoalID goal_id
00028 PR2GripperFindContactGoal goal
00029
00030 ================================================================================
00031 MSG: std_msgs/Header
00032 # Standard metadata for higher-level stamped data types.
00033 # This is generally used to communicate timestamped data
00034 # in a particular coordinate frame.
00035 #
00036 # sequence ID: consecutively increasing ID
00037 uint32 seq
00038 #Two-integer timestamp that is expressed as:
00039 # * stamp.secs: seconds (stamp_secs) since epoch
00040 # * stamp.nsecs: nanoseconds since stamp_secs
00041 # time-handling sugar is provided by the client library
00042 time stamp
00043 #Frame this data is associated with
00044 # 0: no frame
00045 # 1: global frame
00046 string frame_id
00047
00048 ================================================================================
00049 MSG: actionlib_msgs/GoalID
00050 # The stamp should store the time at which this goal was requested.
00051 # It is used by an action server when it tries to preempt all
00052 # goals that were requested before a certain time
00053 time stamp
00054
00055 # The id provides a way to associate feedback and
00056 # result message with specific goal requests. The id
00057 # specified must be unique.
00058 string id
00059
00060
00061 ================================================================================
00062 MSG: pr2_gripper_sensor_msgs/PR2GripperFindContactGoal
00063 # ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ======
00064 # Contact action used to close fingers and find object contacts
00065 # quickly while still stopping fast in real-time to not damage
00066 # objects
00067
00068 #goal
00069 PR2GripperFindContactCommand command
00070
00071 ================================================================================
00072 MSG: pr2_gripper_sensor_msgs/PR2GripperFindContactCommand
00073 # set true if you want to calibrate the fingertip sensors on the start
00074 # of the find_contact action. While this is not necessary (and
00075 # the default value will not calibrate the sensors) for best
00076 # performance it is recommended that you set this to true each time
00077 # you are calling find_contact and are confident the fingertips are
00078 # not touching anything
00079 # NOTE: SHOULD ONLY BE TRUE WHEN BOTH FINGERS ARE TOUCHING NOTHING
00080 bool zero_fingertip_sensors
00081
00082 # the finger contact conditions that determine what our goal is
00083 # Leaving this field blank will result in the robot closing until
00084 # contact on BOTH fingers is achieved
00085 int8 contact_conditions
00086
00087 # predefined values for the above contact_conditions variable
00088 int8 BOTH = 0 # both fingers must make contact
00089 int8 LEFT = 1 # just the left finger
00090 int8 RIGHT = 2 # just the right finger
00091 int8 EITHER = 3 # either finger, we don't care which
00092
00093 ================================================================================
00094 MSG: pr2_gripper_sensor_msgs/PR2GripperFindContactActionResult
00095 # ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ======
00096
00097 Header header
00098 actionlib_msgs/GoalStatus status
00099 PR2GripperFindContactResult result
00100
00101 ================================================================================
00102 MSG: actionlib_msgs/GoalStatus
00103 GoalID goal_id
00104 uint8 status
00105 uint8 PENDING = 0 # The goal has yet to be processed by the action server
00106 uint8 ACTIVE = 1 # The goal is currently being processed by the action server
00107 uint8 PREEMPTED = 2 # The goal received a cancel request after it started executing
00108 # and has since completed its execution (Terminal State)
00109 uint8 SUCCEEDED = 3 # The goal was achieved successfully by the action server (Terminal State)
00110 uint8 ABORTED = 4 # The goal was aborted during execution by the action server due
00111 # to some failure (Terminal State)
00112 uint8 REJECTED = 5 # The goal was rejected by the action server without being processed,
00113 # because the goal was unattainable or invalid (Terminal State)
00114 uint8 PREEMPTING = 6 # The goal received a cancel request after it started executing
00115 # and has not yet completed execution
00116 uint8 RECALLING = 7 # The goal received a cancel request before it started executing,
00117 # but the action server has not yet confirmed that the goal is canceled
00118 uint8 RECALLED = 8 # The goal received a cancel request before it started executing
00119 # and was successfully cancelled (Terminal State)
00120 uint8 LOST = 9 # An action client can determine that a goal is LOST. This should not be
00121 # sent over the wire by an action server
00122
00123 #Allow for the user to associate a string with GoalStatus for debugging
00124 string text
00125
00126
00127 ================================================================================
00128 MSG: pr2_gripper_sensor_msgs/PR2GripperFindContactResult
00129 # ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ======
00130 #results
00131 PR2GripperFindContactData data
00132
00133 ================================================================================
00134 MSG: pr2_gripper_sensor_msgs/PR2GripperFindContactData
00135 # Time the data was recorded at
00136 time stamp
00137
00138 # true when our contact conditions have been met
00139 # (see PR2GripperFindContact command)
00140 bool contact_conditions_met
00141
00142 # the finger contact conditions
00143 # true if the finger experienced a contact event
00144 #
00145 # contact events are defined as contact with the fingerpads
00146 # as either steady-state or high-freq force events
00147 bool left_fingertip_pad_contact
00148 bool right_fingertip_pad_contact
00149
00150 # the force experinced by the finger Pads (N)
00151 # NOTE:this ignores data from the edges of the finger pressure
00152 float64 left_fingertip_pad_force
00153 float64 right_fingertip_pad_force
00154
00155 # the current joint position (m)
00156 float64 joint_position
00157
00158 # the virtual (parallel) joint effort (N)
00159 float64 joint_effort
00160
00161 # the control state of our realtime controller
00162 PR2GripperSensorRTState rtstate
00163 ================================================================================
00164 MSG: pr2_gripper_sensor_msgs/PR2GripperSensorRTState
00165 # the control state of our realtime controller
00166 int8 realtime_controller_state
00167
00168 # predefined values to indicate our realtime_controller_state
00169 int8 DISABLED = 0
00170 int8 POSITION_SERVO = 3
00171 int8 FORCE_SERVO = 4
00172 int8 FIND_CONTACT = 5
00173 int8 SLIP_SERVO = 6
00174 ================================================================================
00175 MSG: pr2_gripper_sensor_msgs/PR2GripperFindContactActionFeedback
00176 # ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ======
00177
00178 Header header
00179 actionlib_msgs/GoalStatus status
00180 PR2GripperFindContactFeedback feedback
00181
00182 ================================================================================
00183 MSG: pr2_gripper_sensor_msgs/PR2GripperFindContactFeedback
00184 # ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ======
00185 # feedback
00186 PR2GripperFindContactData data
00187
00188
00189
00190 """
00191 __slots__ = ['action_goal','action_result','action_feedback']
00192 _slot_types = ['pr2_gripper_sensor_msgs/PR2GripperFindContactActionGoal','pr2_gripper_sensor_msgs/PR2GripperFindContactActionResult','pr2_gripper_sensor_msgs/PR2GripperFindContactActionFeedback']
00193
00194 def __init__(self, *args, **kwds):
00195 """
00196 Constructor. Any message fields that are implicitly/explicitly
00197 set to None will be assigned a default value. The recommend
00198 use is keyword arguments as this is more robust to future message
00199 changes. You cannot mix in-order arguments and keyword arguments.
00200
00201 The available fields are:
00202 action_goal,action_result,action_feedback
00203
00204 :param args: complete set of field values, in .msg order
00205 :param kwds: use keyword arguments corresponding to message field names
00206 to set specific fields.
00207 """
00208 if args or kwds:
00209 super(PR2GripperFindContactAction, self).__init__(*args, **kwds)
00210
00211 if self.action_goal is None:
00212 self.action_goal = pr2_gripper_sensor_msgs.msg.PR2GripperFindContactActionGoal()
00213 if self.action_result is None:
00214 self.action_result = pr2_gripper_sensor_msgs.msg.PR2GripperFindContactActionResult()
00215 if self.action_feedback is None:
00216 self.action_feedback = pr2_gripper_sensor_msgs.msg.PR2GripperFindContactActionFeedback()
00217 else:
00218 self.action_goal = pr2_gripper_sensor_msgs.msg.PR2GripperFindContactActionGoal()
00219 self.action_result = pr2_gripper_sensor_msgs.msg.PR2GripperFindContactActionResult()
00220 self.action_feedback = pr2_gripper_sensor_msgs.msg.PR2GripperFindContactActionFeedback()
00221
00222 def _get_types(self):
00223 """
00224 internal API method
00225 """
00226 return self._slot_types
00227
00228 def serialize(self, buff):
00229 """
00230 serialize message into buffer
00231 :param buff: buffer, ``StringIO``
00232 """
00233 try:
00234 _x = self
00235 buff.write(_struct_3I.pack(_x.action_goal.header.seq, _x.action_goal.header.stamp.secs, _x.action_goal.header.stamp.nsecs))
00236 _x = self.action_goal.header.frame_id
00237 length = len(_x)
00238 if python3 or type(_x) == unicode:
00239 _x = _x.encode('utf-8')
00240 length = len(_x)
00241 buff.write(struct.pack('<I%ss'%length, length, _x))
00242 _x = self
00243 buff.write(_struct_2I.pack(_x.action_goal.goal_id.stamp.secs, _x.action_goal.goal_id.stamp.nsecs))
00244 _x = self.action_goal.goal_id.id
00245 length = len(_x)
00246 if python3 or type(_x) == unicode:
00247 _x = _x.encode('utf-8')
00248 length = len(_x)
00249 buff.write(struct.pack('<I%ss'%length, length, _x))
00250 _x = self
00251 buff.write(_struct_Bb3I.pack(_x.action_goal.goal.command.zero_fingertip_sensors, _x.action_goal.goal.command.contact_conditions, _x.action_result.header.seq, _x.action_result.header.stamp.secs, _x.action_result.header.stamp.nsecs))
00252 _x = self.action_result.header.frame_id
00253 length = len(_x)
00254 if python3 or type(_x) == unicode:
00255 _x = _x.encode('utf-8')
00256 length = len(_x)
00257 buff.write(struct.pack('<I%ss'%length, length, _x))
00258 _x = self
00259 buff.write(_struct_2I.pack(_x.action_result.status.goal_id.stamp.secs, _x.action_result.status.goal_id.stamp.nsecs))
00260 _x = self.action_result.status.goal_id.id
00261 length = len(_x)
00262 if python3 or type(_x) == unicode:
00263 _x = _x.encode('utf-8')
00264 length = len(_x)
00265 buff.write(struct.pack('<I%ss'%length, length, _x))
00266 buff.write(_struct_B.pack(self.action_result.status.status))
00267 _x = self.action_result.status.text
00268 length = len(_x)
00269 if python3 or type(_x) == unicode:
00270 _x = _x.encode('utf-8')
00271 length = len(_x)
00272 buff.write(struct.pack('<I%ss'%length, length, _x))
00273 _x = self
00274 buff.write(_struct_2I3B4db3I.pack(_x.action_result.result.data.stamp.secs, _x.action_result.result.data.stamp.nsecs, _x.action_result.result.data.contact_conditions_met, _x.action_result.result.data.left_fingertip_pad_contact, _x.action_result.result.data.right_fingertip_pad_contact, _x.action_result.result.data.left_fingertip_pad_force, _x.action_result.result.data.right_fingertip_pad_force, _x.action_result.result.data.joint_position, _x.action_result.result.data.joint_effort, _x.action_result.result.data.rtstate.realtime_controller_state, _x.action_feedback.header.seq, _x.action_feedback.header.stamp.secs, _x.action_feedback.header.stamp.nsecs))
00275 _x = self.action_feedback.header.frame_id
00276 length = len(_x)
00277 if python3 or type(_x) == unicode:
00278 _x = _x.encode('utf-8')
00279 length = len(_x)
00280 buff.write(struct.pack('<I%ss'%length, length, _x))
00281 _x = self
00282 buff.write(_struct_2I.pack(_x.action_feedback.status.goal_id.stamp.secs, _x.action_feedback.status.goal_id.stamp.nsecs))
00283 _x = self.action_feedback.status.goal_id.id
00284 length = len(_x)
00285 if python3 or type(_x) == unicode:
00286 _x = _x.encode('utf-8')
00287 length = len(_x)
00288 buff.write(struct.pack('<I%ss'%length, length, _x))
00289 buff.write(_struct_B.pack(self.action_feedback.status.status))
00290 _x = self.action_feedback.status.text
00291 length = len(_x)
00292 if python3 or type(_x) == unicode:
00293 _x = _x.encode('utf-8')
00294 length = len(_x)
00295 buff.write(struct.pack('<I%ss'%length, length, _x))
00296 _x = self
00297 buff.write(_struct_2I3B4db.pack(_x.action_feedback.feedback.data.stamp.secs, _x.action_feedback.feedback.data.stamp.nsecs, _x.action_feedback.feedback.data.contact_conditions_met, _x.action_feedback.feedback.data.left_fingertip_pad_contact, _x.action_feedback.feedback.data.right_fingertip_pad_contact, _x.action_feedback.feedback.data.left_fingertip_pad_force, _x.action_feedback.feedback.data.right_fingertip_pad_force, _x.action_feedback.feedback.data.joint_position, _x.action_feedback.feedback.data.joint_effort, _x.action_feedback.feedback.data.rtstate.realtime_controller_state))
00298 except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00299 except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00300
00301 def deserialize(self, str):
00302 """
00303 unpack serialized message in str into this message instance
00304 :param str: byte array of serialized message, ``str``
00305 """
00306 try:
00307 if self.action_goal is None:
00308 self.action_goal = pr2_gripper_sensor_msgs.msg.PR2GripperFindContactActionGoal()
00309 if self.action_result is None:
00310 self.action_result = pr2_gripper_sensor_msgs.msg.PR2GripperFindContactActionResult()
00311 if self.action_feedback is None:
00312 self.action_feedback = pr2_gripper_sensor_msgs.msg.PR2GripperFindContactActionFeedback()
00313 end = 0
00314 _x = self
00315 start = end
00316 end += 12
00317 (_x.action_goal.header.seq, _x.action_goal.header.stamp.secs, _x.action_goal.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00318 start = end
00319 end += 4
00320 (length,) = _struct_I.unpack(str[start:end])
00321 start = end
00322 end += length
00323 if python3:
00324 self.action_goal.header.frame_id = str[start:end].decode('utf-8')
00325 else:
00326 self.action_goal.header.frame_id = str[start:end]
00327 _x = self
00328 start = end
00329 end += 8
00330 (_x.action_goal.goal_id.stamp.secs, _x.action_goal.goal_id.stamp.nsecs,) = _struct_2I.unpack(str[start:end])
00331 start = end
00332 end += 4
00333 (length,) = _struct_I.unpack(str[start:end])
00334 start = end
00335 end += length
00336 if python3:
00337 self.action_goal.goal_id.id = str[start:end].decode('utf-8')
00338 else:
00339 self.action_goal.goal_id.id = str[start:end]
00340 _x = self
00341 start = end
00342 end += 14
00343 (_x.action_goal.goal.command.zero_fingertip_sensors, _x.action_goal.goal.command.contact_conditions, _x.action_result.header.seq, _x.action_result.header.stamp.secs, _x.action_result.header.stamp.nsecs,) = _struct_Bb3I.unpack(str[start:end])
00344 self.action_goal.goal.command.zero_fingertip_sensors = bool(self.action_goal.goal.command.zero_fingertip_sensors)
00345 start = end
00346 end += 4
00347 (length,) = _struct_I.unpack(str[start:end])
00348 start = end
00349 end += length
00350 if python3:
00351 self.action_result.header.frame_id = str[start:end].decode('utf-8')
00352 else:
00353 self.action_result.header.frame_id = str[start:end]
00354 _x = self
00355 start = end
00356 end += 8
00357 (_x.action_result.status.goal_id.stamp.secs, _x.action_result.status.goal_id.stamp.nsecs,) = _struct_2I.unpack(str[start:end])
00358 start = end
00359 end += 4
00360 (length,) = _struct_I.unpack(str[start:end])
00361 start = end
00362 end += length
00363 if python3:
00364 self.action_result.status.goal_id.id = str[start:end].decode('utf-8')
00365 else:
00366 self.action_result.status.goal_id.id = str[start:end]
00367 start = end
00368 end += 1
00369 (self.action_result.status.status,) = _struct_B.unpack(str[start:end])
00370 start = end
00371 end += 4
00372 (length,) = _struct_I.unpack(str[start:end])
00373 start = end
00374 end += length
00375 if python3:
00376 self.action_result.status.text = str[start:end].decode('utf-8')
00377 else:
00378 self.action_result.status.text = str[start:end]
00379 _x = self
00380 start = end
00381 end += 56
00382 (_x.action_result.result.data.stamp.secs, _x.action_result.result.data.stamp.nsecs, _x.action_result.result.data.contact_conditions_met, _x.action_result.result.data.left_fingertip_pad_contact, _x.action_result.result.data.right_fingertip_pad_contact, _x.action_result.result.data.left_fingertip_pad_force, _x.action_result.result.data.right_fingertip_pad_force, _x.action_result.result.data.joint_position, _x.action_result.result.data.joint_effort, _x.action_result.result.data.rtstate.realtime_controller_state, _x.action_feedback.header.seq, _x.action_feedback.header.stamp.secs, _x.action_feedback.header.stamp.nsecs,) = _struct_2I3B4db3I.unpack(str[start:end])
00383 self.action_result.result.data.contact_conditions_met = bool(self.action_result.result.data.contact_conditions_met)
00384 self.action_result.result.data.left_fingertip_pad_contact = bool(self.action_result.result.data.left_fingertip_pad_contact)
00385 self.action_result.result.data.right_fingertip_pad_contact = bool(self.action_result.result.data.right_fingertip_pad_contact)
00386 start = end
00387 end += 4
00388 (length,) = _struct_I.unpack(str[start:end])
00389 start = end
00390 end += length
00391 if python3:
00392 self.action_feedback.header.frame_id = str[start:end].decode('utf-8')
00393 else:
00394 self.action_feedback.header.frame_id = str[start:end]
00395 _x = self
00396 start = end
00397 end += 8
00398 (_x.action_feedback.status.goal_id.stamp.secs, _x.action_feedback.status.goal_id.stamp.nsecs,) = _struct_2I.unpack(str[start:end])
00399 start = end
00400 end += 4
00401 (length,) = _struct_I.unpack(str[start:end])
00402 start = end
00403 end += length
00404 if python3:
00405 self.action_feedback.status.goal_id.id = str[start:end].decode('utf-8')
00406 else:
00407 self.action_feedback.status.goal_id.id = str[start:end]
00408 start = end
00409 end += 1
00410 (self.action_feedback.status.status,) = _struct_B.unpack(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.action_feedback.status.text = str[start:end].decode('utf-8')
00418 else:
00419 self.action_feedback.status.text = str[start:end]
00420 _x = self
00421 start = end
00422 end += 44
00423 (_x.action_feedback.feedback.data.stamp.secs, _x.action_feedback.feedback.data.stamp.nsecs, _x.action_feedback.feedback.data.contact_conditions_met, _x.action_feedback.feedback.data.left_fingertip_pad_contact, _x.action_feedback.feedback.data.right_fingertip_pad_contact, _x.action_feedback.feedback.data.left_fingertip_pad_force, _x.action_feedback.feedback.data.right_fingertip_pad_force, _x.action_feedback.feedback.data.joint_position, _x.action_feedback.feedback.data.joint_effort, _x.action_feedback.feedback.data.rtstate.realtime_controller_state,) = _struct_2I3B4db.unpack(str[start:end])
00424 self.action_feedback.feedback.data.contact_conditions_met = bool(self.action_feedback.feedback.data.contact_conditions_met)
00425 self.action_feedback.feedback.data.left_fingertip_pad_contact = bool(self.action_feedback.feedback.data.left_fingertip_pad_contact)
00426 self.action_feedback.feedback.data.right_fingertip_pad_contact = bool(self.action_feedback.feedback.data.right_fingertip_pad_contact)
00427 return self
00428 except struct.error as e:
00429 raise genpy.DeserializationError(e)
00430
00431
00432 def serialize_numpy(self, buff, numpy):
00433 """
00434 serialize message with numpy array types into buffer
00435 :param buff: buffer, ``StringIO``
00436 :param numpy: numpy python module
00437 """
00438 try:
00439 _x = self
00440 buff.write(_struct_3I.pack(_x.action_goal.header.seq, _x.action_goal.header.stamp.secs, _x.action_goal.header.stamp.nsecs))
00441 _x = self.action_goal.header.frame_id
00442 length = len(_x)
00443 if python3 or type(_x) == unicode:
00444 _x = _x.encode('utf-8')
00445 length = len(_x)
00446 buff.write(struct.pack('<I%ss'%length, length, _x))
00447 _x = self
00448 buff.write(_struct_2I.pack(_x.action_goal.goal_id.stamp.secs, _x.action_goal.goal_id.stamp.nsecs))
00449 _x = self.action_goal.goal_id.id
00450 length = len(_x)
00451 if python3 or type(_x) == unicode:
00452 _x = _x.encode('utf-8')
00453 length = len(_x)
00454 buff.write(struct.pack('<I%ss'%length, length, _x))
00455 _x = self
00456 buff.write(_struct_Bb3I.pack(_x.action_goal.goal.command.zero_fingertip_sensors, _x.action_goal.goal.command.contact_conditions, _x.action_result.header.seq, _x.action_result.header.stamp.secs, _x.action_result.header.stamp.nsecs))
00457 _x = self.action_result.header.frame_id
00458 length = len(_x)
00459 if python3 or type(_x) == unicode:
00460 _x = _x.encode('utf-8')
00461 length = len(_x)
00462 buff.write(struct.pack('<I%ss'%length, length, _x))
00463 _x = self
00464 buff.write(_struct_2I.pack(_x.action_result.status.goal_id.stamp.secs, _x.action_result.status.goal_id.stamp.nsecs))
00465 _x = self.action_result.status.goal_id.id
00466 length = len(_x)
00467 if python3 or type(_x) == unicode:
00468 _x = _x.encode('utf-8')
00469 length = len(_x)
00470 buff.write(struct.pack('<I%ss'%length, length, _x))
00471 buff.write(_struct_B.pack(self.action_result.status.status))
00472 _x = self.action_result.status.text
00473 length = len(_x)
00474 if python3 or type(_x) == unicode:
00475 _x = _x.encode('utf-8')
00476 length = len(_x)
00477 buff.write(struct.pack('<I%ss'%length, length, _x))
00478 _x = self
00479 buff.write(_struct_2I3B4db3I.pack(_x.action_result.result.data.stamp.secs, _x.action_result.result.data.stamp.nsecs, _x.action_result.result.data.contact_conditions_met, _x.action_result.result.data.left_fingertip_pad_contact, _x.action_result.result.data.right_fingertip_pad_contact, _x.action_result.result.data.left_fingertip_pad_force, _x.action_result.result.data.right_fingertip_pad_force, _x.action_result.result.data.joint_position, _x.action_result.result.data.joint_effort, _x.action_result.result.data.rtstate.realtime_controller_state, _x.action_feedback.header.seq, _x.action_feedback.header.stamp.secs, _x.action_feedback.header.stamp.nsecs))
00480 _x = self.action_feedback.header.frame_id
00481 length = len(_x)
00482 if python3 or type(_x) == unicode:
00483 _x = _x.encode('utf-8')
00484 length = len(_x)
00485 buff.write(struct.pack('<I%ss'%length, length, _x))
00486 _x = self
00487 buff.write(_struct_2I.pack(_x.action_feedback.status.goal_id.stamp.secs, _x.action_feedback.status.goal_id.stamp.nsecs))
00488 _x = self.action_feedback.status.goal_id.id
00489 length = len(_x)
00490 if python3 or type(_x) == unicode:
00491 _x = _x.encode('utf-8')
00492 length = len(_x)
00493 buff.write(struct.pack('<I%ss'%length, length, _x))
00494 buff.write(_struct_B.pack(self.action_feedback.status.status))
00495 _x = self.action_feedback.status.text
00496 length = len(_x)
00497 if python3 or type(_x) == unicode:
00498 _x = _x.encode('utf-8')
00499 length = len(_x)
00500 buff.write(struct.pack('<I%ss'%length, length, _x))
00501 _x = self
00502 buff.write(_struct_2I3B4db.pack(_x.action_feedback.feedback.data.stamp.secs, _x.action_feedback.feedback.data.stamp.nsecs, _x.action_feedback.feedback.data.contact_conditions_met, _x.action_feedback.feedback.data.left_fingertip_pad_contact, _x.action_feedback.feedback.data.right_fingertip_pad_contact, _x.action_feedback.feedback.data.left_fingertip_pad_force, _x.action_feedback.feedback.data.right_fingertip_pad_force, _x.action_feedback.feedback.data.joint_position, _x.action_feedback.feedback.data.joint_effort, _x.action_feedback.feedback.data.rtstate.realtime_controller_state))
00503 except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00504 except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00505
00506 def deserialize_numpy(self, str, numpy):
00507 """
00508 unpack serialized message in str into this message instance using numpy for array types
00509 :param str: byte array of serialized message, ``str``
00510 :param numpy: numpy python module
00511 """
00512 try:
00513 if self.action_goal is None:
00514 self.action_goal = pr2_gripper_sensor_msgs.msg.PR2GripperFindContactActionGoal()
00515 if self.action_result is None:
00516 self.action_result = pr2_gripper_sensor_msgs.msg.PR2GripperFindContactActionResult()
00517 if self.action_feedback is None:
00518 self.action_feedback = pr2_gripper_sensor_msgs.msg.PR2GripperFindContactActionFeedback()
00519 end = 0
00520 _x = self
00521 start = end
00522 end += 12
00523 (_x.action_goal.header.seq, _x.action_goal.header.stamp.secs, _x.action_goal.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00524 start = end
00525 end += 4
00526 (length,) = _struct_I.unpack(str[start:end])
00527 start = end
00528 end += length
00529 if python3:
00530 self.action_goal.header.frame_id = str[start:end].decode('utf-8')
00531 else:
00532 self.action_goal.header.frame_id = str[start:end]
00533 _x = self
00534 start = end
00535 end += 8
00536 (_x.action_goal.goal_id.stamp.secs, _x.action_goal.goal_id.stamp.nsecs,) = _struct_2I.unpack(str[start:end])
00537 start = end
00538 end += 4
00539 (length,) = _struct_I.unpack(str[start:end])
00540 start = end
00541 end += length
00542 if python3:
00543 self.action_goal.goal_id.id = str[start:end].decode('utf-8')
00544 else:
00545 self.action_goal.goal_id.id = str[start:end]
00546 _x = self
00547 start = end
00548 end += 14
00549 (_x.action_goal.goal.command.zero_fingertip_sensors, _x.action_goal.goal.command.contact_conditions, _x.action_result.header.seq, _x.action_result.header.stamp.secs, _x.action_result.header.stamp.nsecs,) = _struct_Bb3I.unpack(str[start:end])
00550 self.action_goal.goal.command.zero_fingertip_sensors = bool(self.action_goal.goal.command.zero_fingertip_sensors)
00551 start = end
00552 end += 4
00553 (length,) = _struct_I.unpack(str[start:end])
00554 start = end
00555 end += length
00556 if python3:
00557 self.action_result.header.frame_id = str[start:end].decode('utf-8')
00558 else:
00559 self.action_result.header.frame_id = str[start:end]
00560 _x = self
00561 start = end
00562 end += 8
00563 (_x.action_result.status.goal_id.stamp.secs, _x.action_result.status.goal_id.stamp.nsecs,) = _struct_2I.unpack(str[start:end])
00564 start = end
00565 end += 4
00566 (length,) = _struct_I.unpack(str[start:end])
00567 start = end
00568 end += length
00569 if python3:
00570 self.action_result.status.goal_id.id = str[start:end].decode('utf-8')
00571 else:
00572 self.action_result.status.goal_id.id = str[start:end]
00573 start = end
00574 end += 1
00575 (self.action_result.status.status,) = _struct_B.unpack(str[start:end])
00576 start = end
00577 end += 4
00578 (length,) = _struct_I.unpack(str[start:end])
00579 start = end
00580 end += length
00581 if python3:
00582 self.action_result.status.text = str[start:end].decode('utf-8')
00583 else:
00584 self.action_result.status.text = str[start:end]
00585 _x = self
00586 start = end
00587 end += 56
00588 (_x.action_result.result.data.stamp.secs, _x.action_result.result.data.stamp.nsecs, _x.action_result.result.data.contact_conditions_met, _x.action_result.result.data.left_fingertip_pad_contact, _x.action_result.result.data.right_fingertip_pad_contact, _x.action_result.result.data.left_fingertip_pad_force, _x.action_result.result.data.right_fingertip_pad_force, _x.action_result.result.data.joint_position, _x.action_result.result.data.joint_effort, _x.action_result.result.data.rtstate.realtime_controller_state, _x.action_feedback.header.seq, _x.action_feedback.header.stamp.secs, _x.action_feedback.header.stamp.nsecs,) = _struct_2I3B4db3I.unpack(str[start:end])
00589 self.action_result.result.data.contact_conditions_met = bool(self.action_result.result.data.contact_conditions_met)
00590 self.action_result.result.data.left_fingertip_pad_contact = bool(self.action_result.result.data.left_fingertip_pad_contact)
00591 self.action_result.result.data.right_fingertip_pad_contact = bool(self.action_result.result.data.right_fingertip_pad_contact)
00592 start = end
00593 end += 4
00594 (length,) = _struct_I.unpack(str[start:end])
00595 start = end
00596 end += length
00597 if python3:
00598 self.action_feedback.header.frame_id = str[start:end].decode('utf-8')
00599 else:
00600 self.action_feedback.header.frame_id = str[start:end]
00601 _x = self
00602 start = end
00603 end += 8
00604 (_x.action_feedback.status.goal_id.stamp.secs, _x.action_feedback.status.goal_id.stamp.nsecs,) = _struct_2I.unpack(str[start:end])
00605 start = end
00606 end += 4
00607 (length,) = _struct_I.unpack(str[start:end])
00608 start = end
00609 end += length
00610 if python3:
00611 self.action_feedback.status.goal_id.id = str[start:end].decode('utf-8')
00612 else:
00613 self.action_feedback.status.goal_id.id = str[start:end]
00614 start = end
00615 end += 1
00616 (self.action_feedback.status.status,) = _struct_B.unpack(str[start:end])
00617 start = end
00618 end += 4
00619 (length,) = _struct_I.unpack(str[start:end])
00620 start = end
00621 end += length
00622 if python3:
00623 self.action_feedback.status.text = str[start:end].decode('utf-8')
00624 else:
00625 self.action_feedback.status.text = str[start:end]
00626 _x = self
00627 start = end
00628 end += 44
00629 (_x.action_feedback.feedback.data.stamp.secs, _x.action_feedback.feedback.data.stamp.nsecs, _x.action_feedback.feedback.data.contact_conditions_met, _x.action_feedback.feedback.data.left_fingertip_pad_contact, _x.action_feedback.feedback.data.right_fingertip_pad_contact, _x.action_feedback.feedback.data.left_fingertip_pad_force, _x.action_feedback.feedback.data.right_fingertip_pad_force, _x.action_feedback.feedback.data.joint_position, _x.action_feedback.feedback.data.joint_effort, _x.action_feedback.feedback.data.rtstate.realtime_controller_state,) = _struct_2I3B4db.unpack(str[start:end])
00630 self.action_feedback.feedback.data.contact_conditions_met = bool(self.action_feedback.feedback.data.contact_conditions_met)
00631 self.action_feedback.feedback.data.left_fingertip_pad_contact = bool(self.action_feedback.feedback.data.left_fingertip_pad_contact)
00632 self.action_feedback.feedback.data.right_fingertip_pad_contact = bool(self.action_feedback.feedback.data.right_fingertip_pad_contact)
00633 return self
00634 except struct.error as e:
00635 raise genpy.DeserializationError(e)
00636
00637 _struct_I = genpy.struct_I
00638 _struct_B = struct.Struct("<B")
00639 _struct_2I3B4db = struct.Struct("<2I3B4db")
00640 _struct_Bb3I = struct.Struct("<Bb3I")
00641 _struct_3I = struct.Struct("<3I")
00642 _struct_2I = struct.Struct("<2I")
00643 _struct_2I3B4db3I = struct.Struct("<2I3B4db3I")