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