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