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