Go to the documentation of this file.00001 """autogenerated by genpy from pr2_gripper_sensor_msgs/PR2GripperForceServoCommand.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 PR2GripperForceServoCommand(genpy.Message):
00009 _md5sum = "dd4b2a0dfafa27b67d2002841f544379"
00010 _type = "pr2_gripper_sensor_msgs/PR2GripperForceServoCommand"
00011 _has_header = False
00012 _full_text = """# the amount of fingertip force (in Newtons) to apply.
00013 # NOTE: the joint will squeeze until each finger reaches this level
00014 # values < 0 (opening force) are ignored
00015 #
00016 # 10 N can crack an egg or crush a soda can.
00017 # 15 N can firmly pick up a can of soup.
00018 # Experiment on your own.
00019 #
00020 float64 fingertip_force
00021 """
00022 __slots__ = ['fingertip_force']
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 fingertip_force
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(PR2GripperForceServoCommand, self).__init__(*args, **kwds)
00041
00042 if self.fingertip_force is None:
00043 self.fingertip_force = 0.
00044 else:
00045 self.fingertip_force = 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.fingertip_force))
00060 except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00061 except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
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.fingertip_force,) = _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.fingertip_force))
00086 except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00087 except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
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.fingertip_force,) = _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")