Go to the documentation of this file.00001 """autogenerated by genpy from pr2_gripper_sensor_msgs/PR2GripperGrabCommand.msg. Do not edit."""
00002 import sys
00003 python3 = True if sys.hexversion > 0x03000000 else False
00004 import genpy
00005 import struct
00006
00007
00008 class PR2GripperGrabCommand(genpy.Message):
00009 _md5sum = "cf286b093615060c79527896d36bf694"
00010 _type = "pr2_gripper_sensor_msgs/PR2GripperGrabCommand"
00011 _has_header = False
00012 _full_text = """# The gain to use to evaluate how hard an object should be
00013 # grasped after it is contacted. This is based on hardness
00014 # estimation as outlined in TRO paper (see wiki).
00015 #
00016 # Try 0.03
00017 #
00018 # Units (N/(m/s^2))
00019 float64 hardness_gain
00020
00021 """
00022 __slots__ = ['hardness_gain']
00023 _slot_types = ['float64']
00024
00025 def __init__(self, *args, **kwds):
00026 """
00027 Constructor. Any message fields that are implicitly/explicitly
00028 set to None will be assigned a default value. The recommend
00029 use is keyword arguments as this is more robust to future message
00030 changes. You cannot mix in-order arguments and keyword arguments.
00031
00032 The available fields are:
00033 hardness_gain
00034
00035 :param args: complete set of field values, in .msg order
00036 :param kwds: use keyword arguments corresponding to message field names
00037 to set specific fields.
00038 """
00039 if args or kwds:
00040 super(PR2GripperGrabCommand, self).__init__(*args, **kwds)
00041
00042 if self.hardness_gain is None:
00043 self.hardness_gain = 0.
00044 else:
00045 self.hardness_gain = 0.
00046
00047 def _get_types(self):
00048 """
00049 internal API method
00050 """
00051 return self._slot_types
00052
00053 def serialize(self, buff):
00054 """
00055 serialize message into buffer
00056 :param buff: buffer, ``StringIO``
00057 """
00058 try:
00059 buff.write(_struct_d.pack(self.hardness_gain))
00060 except struct.error as se: self._check_types(se)
00061 except TypeError as te: self._check_types(te)
00062
00063 def deserialize(self, str):
00064 """
00065 unpack serialized message in str into this message instance
00066 :param str: byte array of serialized message, ``str``
00067 """
00068 try:
00069 end = 0
00070 start = end
00071 end += 8
00072 (self.hardness_gain,) = _struct_d.unpack(str[start:end])
00073 return self
00074 except struct.error as e:
00075 raise genpy.DeserializationError(e)
00076
00077
00078 def serialize_numpy(self, buff, numpy):
00079 """
00080 serialize message with numpy array types into buffer
00081 :param buff: buffer, ``StringIO``
00082 :param numpy: numpy python module
00083 """
00084 try:
00085 buff.write(_struct_d.pack(self.hardness_gain))
00086 except struct.error as se: self._check_types(se)
00087 except TypeError as te: self._check_types(te)
00088
00089 def deserialize_numpy(self, str, numpy):
00090 """
00091 unpack serialized message in str into this message instance using numpy for array types
00092 :param str: byte array of serialized message, ``str``
00093 :param numpy: numpy python module
00094 """
00095 try:
00096 end = 0
00097 start = end
00098 end += 8
00099 (self.hardness_gain,) = _struct_d.unpack(str[start:end])
00100 return self
00101 except struct.error as e:
00102 raise genpy.DeserializationError(e)
00103
00104 _struct_I = genpy.struct_I
00105 _struct_d = struct.Struct("<d")