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