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