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