00001 """autogenerated by genmsg_py from PR2GripperFindContactFeedback.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 PR2GripperFindContactFeedback(roslib.message.Message):
00009 _md5sum = "a1cc8c2fc9268b550e6167f268f97574"
00010 _type = "pr2_gripper_sensor_msgs/PR2GripperFindContactFeedback"
00011 _has_header = False
00012 _full_text = """# ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ======
00013 # feedback
00014 PR2GripperFindContactData data
00015
00016
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(PR2GripperFindContactFeedback, 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
00095 @type buff: StringIO
00096 """
00097 try:
00098 _x = self
00099 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))
00100 except struct.error, se: self._check_types(se)
00101 except TypeError, te: self._check_types(te)
00102
00103 def deserialize(self, str):
00104 """
00105 unpack serialized message in str into this message instance
00106 @param str: byte array of serialized message
00107 @type str: str
00108 """
00109 try:
00110 if self.data is None:
00111 self.data = pr2_gripper_sensor_msgs.msg.PR2GripperFindContactData()
00112 end = 0
00113 _x = self
00114 start = end
00115 end += 44
00116 (_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])
00117 self.data.contact_conditions_met = bool(self.data.contact_conditions_met)
00118 self.data.left_fingertip_pad_contact = bool(self.data.left_fingertip_pad_contact)
00119 self.data.right_fingertip_pad_contact = bool(self.data.right_fingertip_pad_contact)
00120 return self
00121 except struct.error, e:
00122 raise roslib.message.DeserializationError(e)
00123
00124
00125 def serialize_numpy(self, buff, numpy):
00126 """
00127 serialize message with numpy array types into buffer
00128 @param buff: buffer
00129 @type buff: StringIO
00130 @param numpy: numpy python module
00131 @type numpy module
00132 """
00133 try:
00134 _x = self
00135 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))
00136 except struct.error, se: self._check_types(se)
00137 except TypeError, te: self._check_types(te)
00138
00139 def deserialize_numpy(self, str, numpy):
00140 """
00141 unpack serialized message in str into this message instance using numpy for array types
00142 @param str: byte array of serialized message
00143 @type str: str
00144 @param numpy: numpy python module
00145 @type numpy: module
00146 """
00147 try:
00148 if self.data is None:
00149 self.data = pr2_gripper_sensor_msgs.msg.PR2GripperFindContactData()
00150 end = 0
00151 _x = self
00152 start = end
00153 end += 44
00154 (_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])
00155 self.data.contact_conditions_met = bool(self.data.contact_conditions_met)
00156 self.data.left_fingertip_pad_contact = bool(self.data.left_fingertip_pad_contact)
00157 self.data.right_fingertip_pad_contact = bool(self.data.right_fingertip_pad_contact)
00158 return self
00159 except struct.error, e:
00160 raise roslib.message.DeserializationError(e)
00161
00162 _struct_I = roslib.message.struct_I
00163 _struct_2I3B4db = struct.Struct("<2I3B4db")