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