Go to the documentation of this file.00001 """autogenerated by genpy from pr2_gripper_sensor_msgs/PR2GripperForceServoGoal.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 pr2_gripper_sensor_msgs.msg
00008
00009 class PR2GripperForceServoGoal(genpy.Message):
00010 _md5sum = "72dfec6461d0f26a4433260fc791bc48"
00011 _type = "pr2_gripper_sensor_msgs/PR2GripperForceServoGoal"
00012 _has_header = False
00013 _full_text = """# ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ======
00014 # Action to launch the gripper into force servoing mode
00015
00016 #goals
00017 PR2GripperForceServoCommand command
00018
00019 ================================================================================
00020 MSG: pr2_gripper_sensor_msgs/PR2GripperForceServoCommand
00021 # the amount of fingertip force (in Newtons) to apply.
00022 # NOTE: the joint will squeeze until each finger reaches this level
00023 # values < 0 (opening force) are ignored
00024 #
00025 # 10 N can crack an egg or crush a soda can.
00026 # 15 N can firmly pick up a can of soup.
00027 # Experiment on your own.
00028 #
00029 float64 fingertip_force
00030 """
00031 __slots__ = ['command']
00032 _slot_types = ['pr2_gripper_sensor_msgs/PR2GripperForceServoCommand']
00033
00034 def __init__(self, *args, **kwds):
00035 """
00036 Constructor. Any message fields that are implicitly/explicitly
00037 set to None will be assigned a default value. The recommend
00038 use is keyword arguments as this is more robust to future message
00039 changes. You cannot mix in-order arguments and keyword arguments.
00040
00041 The available fields are:
00042 command
00043
00044 :param args: complete set of field values, in .msg order
00045 :param kwds: use keyword arguments corresponding to message field names
00046 to set specific fields.
00047 """
00048 if args or kwds:
00049 super(PR2GripperForceServoGoal, self).__init__(*args, **kwds)
00050
00051 if self.command is None:
00052 self.command = pr2_gripper_sensor_msgs.msg.PR2GripperForceServoCommand()
00053 else:
00054 self.command = pr2_gripper_sensor_msgs.msg.PR2GripperForceServoCommand()
00055
00056 def _get_types(self):
00057 """
00058 internal API method
00059 """
00060 return self._slot_types
00061
00062 def serialize(self, buff):
00063 """
00064 serialize message into buffer
00065 :param buff: buffer, ``StringIO``
00066 """
00067 try:
00068 buff.write(_struct_d.pack(self.command.fingertip_force))
00069 except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00070 except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00071
00072 def deserialize(self, str):
00073 """
00074 unpack serialized message in str into this message instance
00075 :param str: byte array of serialized message, ``str``
00076 """
00077 try:
00078 if self.command is None:
00079 self.command = pr2_gripper_sensor_msgs.msg.PR2GripperForceServoCommand()
00080 end = 0
00081 start = end
00082 end += 8
00083 (self.command.fingertip_force,) = _struct_d.unpack(str[start:end])
00084 return self
00085 except struct.error as e:
00086 raise genpy.DeserializationError(e)
00087
00088
00089 def serialize_numpy(self, buff, numpy):
00090 """
00091 serialize message with numpy array types into buffer
00092 :param buff: buffer, ``StringIO``
00093 :param numpy: numpy python module
00094 """
00095 try:
00096 buff.write(_struct_d.pack(self.command.fingertip_force))
00097 except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00098 except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00099
00100 def deserialize_numpy(self, str, numpy):
00101 """
00102 unpack serialized message in str into this message instance using numpy for array types
00103 :param str: byte array of serialized message, ``str``
00104 :param numpy: numpy python module
00105 """
00106 try:
00107 if self.command is None:
00108 self.command = pr2_gripper_sensor_msgs.msg.PR2GripperForceServoCommand()
00109 end = 0
00110 start = end
00111 end += 8
00112 (self.command.fingertip_force,) = _struct_d.unpack(str[start:end])
00113 return self
00114 except struct.error as e:
00115 raise genpy.DeserializationError(e)
00116
00117 _struct_I = genpy.struct_I
00118 _struct_d = struct.Struct("<d")