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