$search
00001 """autogenerated by genmsg_py from PR2GripperGrabGoal.msg. Do not edit.""" 00002 import roslib.message 00003 import struct 00004 00005 import pr2_gripper_sensor_msgs.msg 00006 00007 class PR2GripperGrabGoal(roslib.message.Message): 00008 _md5sum = "4dec90ce1cb7519ca39577ac65441112" 00009 _type = "pr2_gripper_sensor_msgs/PR2GripperGrabGoal" 00010 _has_header = False #flag to mark the presence of a Header object 00011 _full_text = """# ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ====== 00012 #goal 00013 PR2GripperGrabCommand command 00014 00015 ================================================================================ 00016 MSG: pr2_gripper_sensor_msgs/PR2GripperGrabCommand 00017 # The gain to use to evaluate how hard an object should be 00018 # grasped after it is contacted. This is based on hardness 00019 # estimation as outlined in TRO paper (see wiki). 00020 # 00021 # Try 0.03 00022 # 00023 # Units (N/(m/s^2)) 00024 float64 hardness_gain 00025 00026 """ 00027 __slots__ = ['command'] 00028 _slot_types = ['pr2_gripper_sensor_msgs/PR2GripperGrabCommand'] 00029 00030 def __init__(self, *args, **kwds): 00031 """ 00032 Constructor. Any message fields that are implicitly/explicitly 00033 set to None will be assigned a default value. The recommend 00034 use is keyword arguments as this is more robust to future message 00035 changes. You cannot mix in-order arguments and keyword arguments. 00036 00037 The available fields are: 00038 command 00039 00040 @param args: complete set of field values, in .msg order 00041 @param kwds: use keyword arguments corresponding to message field names 00042 to set specific fields. 00043 """ 00044 if args or kwds: 00045 super(PR2GripperGrabGoal, self).__init__(*args, **kwds) 00046 #message fields cannot be None, assign default values for those that are 00047 if self.command is None: 00048 self.command = pr2_gripper_sensor_msgs.msg.PR2GripperGrabCommand() 00049 else: 00050 self.command = pr2_gripper_sensor_msgs.msg.PR2GripperGrabCommand() 00051 00052 def _get_types(self): 00053 """ 00054 internal API method 00055 """ 00056 return self._slot_types 00057 00058 def serialize(self, buff): 00059 """ 00060 serialize message into buffer 00061 @param buff: buffer 00062 @type buff: StringIO 00063 """ 00064 try: 00065 buff.write(_struct_d.pack(self.command.hardness_gain)) 00066 except struct.error as se: self._check_types(se) 00067 except TypeError as te: self._check_types(te) 00068 00069 def deserialize(self, str): 00070 """ 00071 unpack serialized message in str into this message instance 00072 @param str: byte array of serialized message 00073 @type str: str 00074 """ 00075 try: 00076 if self.command is None: 00077 self.command = pr2_gripper_sensor_msgs.msg.PR2GripperGrabCommand() 00078 end = 0 00079 start = end 00080 end += 8 00081 (self.command.hardness_gain,) = _struct_d.unpack(str[start:end]) 00082 return self 00083 except struct.error as e: 00084 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00085 00086 00087 def serialize_numpy(self, buff, numpy): 00088 """ 00089 serialize message with numpy array types into buffer 00090 @param buff: buffer 00091 @type buff: StringIO 00092 @param numpy: numpy python module 00093 @type numpy module 00094 """ 00095 try: 00096 buff.write(_struct_d.pack(self.command.hardness_gain)) 00097 except struct.error as se: self._check_types(se) 00098 except TypeError as te: self._check_types(te) 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 00104 @type str: str 00105 @param numpy: numpy python module 00106 @type numpy: module 00107 """ 00108 try: 00109 if self.command is None: 00110 self.command = pr2_gripper_sensor_msgs.msg.PR2GripperGrabCommand() 00111 end = 0 00112 start = end 00113 end += 8 00114 (self.command.hardness_gain,) = _struct_d.unpack(str[start:end]) 00115 return self 00116 except struct.error as e: 00117 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00118 00119 _struct_I = roslib.message.struct_I 00120 _struct_d = struct.Struct("<d")