00001 """autogenerated by genmsg_py from PR2GripperSensorRawData.msg. Do not edit."""
00002 import roslib.message
00003 import struct
00004
00005 import roslib.rostime
00006
00007 class PR2GripperSensorRawData(roslib.message.Message):
00008 _md5sum = "696a1f2e6969deb0bc6998636ae1b17e"
00009 _type = "pr2_gripper_sensor_msgs/PR2GripperSensorRawData"
00010 _has_header = False
00011 _full_text = """# NOTE: This message is only for debugging purposes. It is not intended for API usage - and is not published under release code.
00012
00013 # Standard ROS header
00014 time stamp
00015
00016 # corrected for zero contact
00017 float64 left_finger_pad_force
00018 float64 right_finger_pad_force
00019
00020 # filtered values : high pass filter at 5 Hz after correcting for zero contact
00021 float64 left_finger_pad_force_filtered
00022 float64 right_finger_pad_force_filtered
00023
00024 # corrected for zero contact
00025 float64[22] left_finger_pad_forces
00026 float64[22] right_finger_pad_forces
00027
00028 # filtered values : high pass filter at 5 Hz after correcting for zero contact
00029 float64[22] left_finger_pad_forces_filtered
00030 float64[22] right_finger_pad_forces_filtered
00031
00032 # raw acceleration values
00033 float64 acc_x_raw
00034 float64 acc_y_raw
00035 float64 acc_z_raw
00036
00037 # filtered acceleration values
00038 float64 acc_x_filtered
00039 float64 acc_y_filtered
00040 float64 acc_z_filtered
00041
00042 # boolean variables indicating whether contact exists or not
00043 bool left_contact
00044 bool right_contact
00045 """
00046 __slots__ = ['stamp','left_finger_pad_force','right_finger_pad_force','left_finger_pad_force_filtered','right_finger_pad_force_filtered','left_finger_pad_forces','right_finger_pad_forces','left_finger_pad_forces_filtered','right_finger_pad_forces_filtered','acc_x_raw','acc_y_raw','acc_z_raw','acc_x_filtered','acc_y_filtered','acc_z_filtered','left_contact','right_contact']
00047 _slot_types = ['time','float64','float64','float64','float64','float64[22]','float64[22]','float64[22]','float64[22]','float64','float64','float64','float64','float64','float64','bool','bool']
00048
00049 def __init__(self, *args, **kwds):
00050 """
00051 Constructor. Any message fields that are implicitly/explicitly
00052 set to None will be assigned a default value. The recommend
00053 use is keyword arguments as this is more robust to future message
00054 changes. You cannot mix in-order arguments and keyword arguments.
00055
00056 The available fields are:
00057 stamp,left_finger_pad_force,right_finger_pad_force,left_finger_pad_force_filtered,right_finger_pad_force_filtered,left_finger_pad_forces,right_finger_pad_forces,left_finger_pad_forces_filtered,right_finger_pad_forces_filtered,acc_x_raw,acc_y_raw,acc_z_raw,acc_x_filtered,acc_y_filtered,acc_z_filtered,left_contact,right_contact
00058
00059 @param args: complete set of field values, in .msg order
00060 @param kwds: use keyword arguments corresponding to message field names
00061 to set specific fields.
00062 """
00063 if args or kwds:
00064 super(PR2GripperSensorRawData, self).__init__(*args, **kwds)
00065
00066 if self.stamp is None:
00067 self.stamp = roslib.rostime.Time()
00068 if self.left_finger_pad_force is None:
00069 self.left_finger_pad_force = 0.
00070 if self.right_finger_pad_force is None:
00071 self.right_finger_pad_force = 0.
00072 if self.left_finger_pad_force_filtered is None:
00073 self.left_finger_pad_force_filtered = 0.
00074 if self.right_finger_pad_force_filtered is None:
00075 self.right_finger_pad_force_filtered = 0.
00076 if self.left_finger_pad_forces is None:
00077 self.left_finger_pad_forces = [0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.]
00078 if self.right_finger_pad_forces is None:
00079 self.right_finger_pad_forces = [0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.]
00080 if self.left_finger_pad_forces_filtered is None:
00081 self.left_finger_pad_forces_filtered = [0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.]
00082 if self.right_finger_pad_forces_filtered is None:
00083 self.right_finger_pad_forces_filtered = [0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.]
00084 if self.acc_x_raw is None:
00085 self.acc_x_raw = 0.
00086 if self.acc_y_raw is None:
00087 self.acc_y_raw = 0.
00088 if self.acc_z_raw is None:
00089 self.acc_z_raw = 0.
00090 if self.acc_x_filtered is None:
00091 self.acc_x_filtered = 0.
00092 if self.acc_y_filtered is None:
00093 self.acc_y_filtered = 0.
00094 if self.acc_z_filtered is None:
00095 self.acc_z_filtered = 0.
00096 if self.left_contact is None:
00097 self.left_contact = False
00098 if self.right_contact is None:
00099 self.right_contact = False
00100 else:
00101 self.stamp = roslib.rostime.Time()
00102 self.left_finger_pad_force = 0.
00103 self.right_finger_pad_force = 0.
00104 self.left_finger_pad_force_filtered = 0.
00105 self.right_finger_pad_force_filtered = 0.
00106 self.left_finger_pad_forces = [0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.]
00107 self.right_finger_pad_forces = [0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.]
00108 self.left_finger_pad_forces_filtered = [0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.]
00109 self.right_finger_pad_forces_filtered = [0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.]
00110 self.acc_x_raw = 0.
00111 self.acc_y_raw = 0.
00112 self.acc_z_raw = 0.
00113 self.acc_x_filtered = 0.
00114 self.acc_y_filtered = 0.
00115 self.acc_z_filtered = 0.
00116 self.left_contact = False
00117 self.right_contact = False
00118
00119 def _get_types(self):
00120 """
00121 internal API method
00122 """
00123 return self._slot_types
00124
00125 def serialize(self, buff):
00126 """
00127 serialize message into buffer
00128 @param buff: buffer
00129 @type buff: StringIO
00130 """
00131 try:
00132 _x = self
00133 buff.write(_struct_2I4d.pack(_x.stamp.secs, _x.stamp.nsecs, _x.left_finger_pad_force, _x.right_finger_pad_force, _x.left_finger_pad_force_filtered, _x.right_finger_pad_force_filtered))
00134 buff.write(_struct_22d.pack(*self.left_finger_pad_forces))
00135 buff.write(_struct_22d.pack(*self.right_finger_pad_forces))
00136 buff.write(_struct_22d.pack(*self.left_finger_pad_forces_filtered))
00137 buff.write(_struct_22d.pack(*self.right_finger_pad_forces_filtered))
00138 _x = self
00139 buff.write(_struct_6d2B.pack(_x.acc_x_raw, _x.acc_y_raw, _x.acc_z_raw, _x.acc_x_filtered, _x.acc_y_filtered, _x.acc_z_filtered, _x.left_contact, _x.right_contact))
00140 except struct.error, se: self._check_types(se)
00141 except TypeError, te: self._check_types(te)
00142
00143 def deserialize(self, str):
00144 """
00145 unpack serialized message in str into this message instance
00146 @param str: byte array of serialized message
00147 @type str: str
00148 """
00149 try:
00150 if self.stamp is None:
00151 self.stamp = roslib.rostime.Time()
00152 end = 0
00153 _x = self
00154 start = end
00155 end += 40
00156 (_x.stamp.secs, _x.stamp.nsecs, _x.left_finger_pad_force, _x.right_finger_pad_force, _x.left_finger_pad_force_filtered, _x.right_finger_pad_force_filtered,) = _struct_2I4d.unpack(str[start:end])
00157 start = end
00158 end += 176
00159 self.left_finger_pad_forces = _struct_22d.unpack(str[start:end])
00160 start = end
00161 end += 176
00162 self.right_finger_pad_forces = _struct_22d.unpack(str[start:end])
00163 start = end
00164 end += 176
00165 self.left_finger_pad_forces_filtered = _struct_22d.unpack(str[start:end])
00166 start = end
00167 end += 176
00168 self.right_finger_pad_forces_filtered = _struct_22d.unpack(str[start:end])
00169 _x = self
00170 start = end
00171 end += 50
00172 (_x.acc_x_raw, _x.acc_y_raw, _x.acc_z_raw, _x.acc_x_filtered, _x.acc_y_filtered, _x.acc_z_filtered, _x.left_contact, _x.right_contact,) = _struct_6d2B.unpack(str[start:end])
00173 self.left_contact = bool(self.left_contact)
00174 self.right_contact = bool(self.right_contact)
00175 self.stamp.canon()
00176 return self
00177 except struct.error, e:
00178 raise roslib.message.DeserializationError(e)
00179
00180
00181 def serialize_numpy(self, buff, numpy):
00182 """
00183 serialize message with numpy array types into buffer
00184 @param buff: buffer
00185 @type buff: StringIO
00186 @param numpy: numpy python module
00187 @type numpy module
00188 """
00189 try:
00190 _x = self
00191 buff.write(_struct_2I4d.pack(_x.stamp.secs, _x.stamp.nsecs, _x.left_finger_pad_force, _x.right_finger_pad_force, _x.left_finger_pad_force_filtered, _x.right_finger_pad_force_filtered))
00192 buff.write(self.left_finger_pad_forces.tostring())
00193 buff.write(self.right_finger_pad_forces.tostring())
00194 buff.write(self.left_finger_pad_forces_filtered.tostring())
00195 buff.write(self.right_finger_pad_forces_filtered.tostring())
00196 _x = self
00197 buff.write(_struct_6d2B.pack(_x.acc_x_raw, _x.acc_y_raw, _x.acc_z_raw, _x.acc_x_filtered, _x.acc_y_filtered, _x.acc_z_filtered, _x.left_contact, _x.right_contact))
00198 except struct.error, se: self._check_types(se)
00199 except TypeError, te: self._check_types(te)
00200
00201 def deserialize_numpy(self, str, numpy):
00202 """
00203 unpack serialized message in str into this message instance using numpy for array types
00204 @param str: byte array of serialized message
00205 @type str: str
00206 @param numpy: numpy python module
00207 @type numpy: module
00208 """
00209 try:
00210 if self.stamp is None:
00211 self.stamp = roslib.rostime.Time()
00212 end = 0
00213 _x = self
00214 start = end
00215 end += 40
00216 (_x.stamp.secs, _x.stamp.nsecs, _x.left_finger_pad_force, _x.right_finger_pad_force, _x.left_finger_pad_force_filtered, _x.right_finger_pad_force_filtered,) = _struct_2I4d.unpack(str[start:end])
00217 start = end
00218 end += 176
00219 self.left_finger_pad_forces = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=22)
00220 start = end
00221 end += 176
00222 self.right_finger_pad_forces = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=22)
00223 start = end
00224 end += 176
00225 self.left_finger_pad_forces_filtered = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=22)
00226 start = end
00227 end += 176
00228 self.right_finger_pad_forces_filtered = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=22)
00229 _x = self
00230 start = end
00231 end += 50
00232 (_x.acc_x_raw, _x.acc_y_raw, _x.acc_z_raw, _x.acc_x_filtered, _x.acc_y_filtered, _x.acc_z_filtered, _x.left_contact, _x.right_contact,) = _struct_6d2B.unpack(str[start:end])
00233 self.left_contact = bool(self.left_contact)
00234 self.right_contact = bool(self.right_contact)
00235 self.stamp.canon()
00236 return self
00237 except struct.error, e:
00238 raise roslib.message.DeserializationError(e)
00239
00240 _struct_I = roslib.message.struct_I
00241 _struct_22d = struct.Struct("<22d")
00242 _struct_2I4d = struct.Struct("<2I4d")
00243 _struct_6d2B = struct.Struct("<6d2B")