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