00001 """autogenerated by genpy from pr2_gripper_sensor_msgs/PR2GripperFindContactResult.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 pr2_gripper_sensor_msgs.msg
00009
00010 class PR2GripperFindContactResult(genpy.Message):
00011 _md5sum = "a1cc8c2fc9268b550e6167f268f97574"
00012 _type = "pr2_gripper_sensor_msgs/PR2GripperFindContactResult"
00013 _has_header = False
00014 _full_text = """# ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ======
00015 #results
00016 PR2GripperFindContactData data
00017
00018 ================================================================================
00019 MSG: pr2_gripper_sensor_msgs/PR2GripperFindContactData
00020 # Time the data was recorded at
00021 time stamp
00022
00023 # true when our contact conditions have been met
00024 # (see PR2GripperFindContact command)
00025 bool contact_conditions_met
00026
00027 # the finger contact conditions
00028 # true if the finger experienced a contact event
00029 #
00030 # contact events are defined as contact with the fingerpads
00031 # as either steady-state or high-freq force events
00032 bool left_fingertip_pad_contact
00033 bool right_fingertip_pad_contact
00034
00035 # the force experinced by the finger Pads (N)
00036 # NOTE:this ignores data from the edges of the finger pressure
00037 float64 left_fingertip_pad_force
00038 float64 right_fingertip_pad_force
00039
00040 # the current joint position (m)
00041 float64 joint_position
00042
00043 # the virtual (parallel) joint effort (N)
00044 float64 joint_effort
00045
00046 # the control state of our realtime controller
00047 PR2GripperSensorRTState rtstate
00048 ================================================================================
00049 MSG: pr2_gripper_sensor_msgs/PR2GripperSensorRTState
00050 # the control state of our realtime controller
00051 int8 realtime_controller_state
00052
00053 # predefined values to indicate our realtime_controller_state
00054 int8 DISABLED = 0
00055 int8 POSITION_SERVO = 3
00056 int8 FORCE_SERVO = 4
00057 int8 FIND_CONTACT = 5
00058 int8 SLIP_SERVO = 6
00059 """
00060 __slots__ = ['data']
00061 _slot_types = ['pr2_gripper_sensor_msgs/PR2GripperFindContactData']
00062
00063 def __init__(self, *args, **kwds):
00064 """
00065 Constructor. Any message fields that are implicitly/explicitly
00066 set to None will be assigned a default value. The recommend
00067 use is keyword arguments as this is more robust to future message
00068 changes. You cannot mix in-order arguments and keyword arguments.
00069
00070 The available fields are:
00071 data
00072
00073 :param args: complete set of field values, in .msg order
00074 :param kwds: use keyword arguments corresponding to message field names
00075 to set specific fields.
00076 """
00077 if args or kwds:
00078 super(PR2GripperFindContactResult, self).__init__(*args, **kwds)
00079
00080 if self.data is None:
00081 self.data = pr2_gripper_sensor_msgs.msg.PR2GripperFindContactData()
00082 else:
00083 self.data = pr2_gripper_sensor_msgs.msg.PR2GripperFindContactData()
00084
00085 def _get_types(self):
00086 """
00087 internal API method
00088 """
00089 return self._slot_types
00090
00091 def serialize(self, buff):
00092 """
00093 serialize message into buffer
00094 :param buff: buffer, ``StringIO``
00095 """
00096 try:
00097 _x = self
00098 buff.write(_struct_2I3B4db.pack(_x.data.stamp.secs, _x.data.stamp.nsecs, _x.data.contact_conditions_met, _x.data.left_fingertip_pad_contact, _x.data.right_fingertip_pad_contact, _x.data.left_fingertip_pad_force, _x.data.right_fingertip_pad_force, _x.data.joint_position, _x.data.joint_effort, _x.data.rtstate.realtime_controller_state))
00099 except struct.error as se: self._check_types(se)
00100 except TypeError as te: self._check_types(te)
00101
00102 def deserialize(self, str):
00103 """
00104 unpack serialized message in str into this message instance
00105 :param str: byte array of serialized message, ``str``
00106 """
00107 try:
00108 if self.data is None:
00109 self.data = pr2_gripper_sensor_msgs.msg.PR2GripperFindContactData()
00110 end = 0
00111 _x = self
00112 start = end
00113 end += 44
00114 (_x.data.stamp.secs, _x.data.stamp.nsecs, _x.data.contact_conditions_met, _x.data.left_fingertip_pad_contact, _x.data.right_fingertip_pad_contact, _x.data.left_fingertip_pad_force, _x.data.right_fingertip_pad_force, _x.data.joint_position, _x.data.joint_effort, _x.data.rtstate.realtime_controller_state,) = _struct_2I3B4db.unpack(str[start:end])
00115 self.data.contact_conditions_met = bool(self.data.contact_conditions_met)
00116 self.data.left_fingertip_pad_contact = bool(self.data.left_fingertip_pad_contact)
00117 self.data.right_fingertip_pad_contact = bool(self.data.right_fingertip_pad_contact)
00118 return self
00119 except struct.error as e:
00120 raise genpy.DeserializationError(e)
00121
00122
00123 def serialize_numpy(self, buff, numpy):
00124 """
00125 serialize message with numpy array types into buffer
00126 :param buff: buffer, ``StringIO``
00127 :param numpy: numpy python module
00128 """
00129 try:
00130 _x = self
00131 buff.write(_struct_2I3B4db.pack(_x.data.stamp.secs, _x.data.stamp.nsecs, _x.data.contact_conditions_met, _x.data.left_fingertip_pad_contact, _x.data.right_fingertip_pad_contact, _x.data.left_fingertip_pad_force, _x.data.right_fingertip_pad_force, _x.data.joint_position, _x.data.joint_effort, _x.data.rtstate.realtime_controller_state))
00132 except struct.error as se: self._check_types(se)
00133 except TypeError as te: self._check_types(te)
00134
00135 def deserialize_numpy(self, str, numpy):
00136 """
00137 unpack serialized message in str into this message instance using numpy for array types
00138 :param str: byte array of serialized message, ``str``
00139 :param numpy: numpy python module
00140 """
00141 try:
00142 if self.data is None:
00143 self.data = pr2_gripper_sensor_msgs.msg.PR2GripperFindContactData()
00144 end = 0
00145 _x = self
00146 start = end
00147 end += 44
00148 (_x.data.stamp.secs, _x.data.stamp.nsecs, _x.data.contact_conditions_met, _x.data.left_fingertip_pad_contact, _x.data.right_fingertip_pad_contact, _x.data.left_fingertip_pad_force, _x.data.right_fingertip_pad_force, _x.data.joint_position, _x.data.joint_effort, _x.data.rtstate.realtime_controller_state,) = _struct_2I3B4db.unpack(str[start:end])
00149 self.data.contact_conditions_met = bool(self.data.contact_conditions_met)
00150 self.data.left_fingertip_pad_contact = bool(self.data.left_fingertip_pad_contact)
00151 self.data.right_fingertip_pad_contact = bool(self.data.right_fingertip_pad_contact)
00152 return self
00153 except struct.error as e:
00154 raise genpy.DeserializationError(e)
00155
00156 _struct_I = genpy.struct_I
00157 _struct_2I3B4db = struct.Struct("<2I3B4db")