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