$search
00001 """autogenerated by genmsg_py from PR2GripperForceServoCommand.msg. Do not edit.""" 00002 import roslib.message 00003 import struct 00004 00005 00006 class PR2GripperForceServoCommand(roslib.message.Message): 00007 _md5sum = "dd4b2a0dfafa27b67d2002841f544379" 00008 _type = "pr2_gripper_sensor_msgs/PR2GripperForceServoCommand" 00009 _has_header = False #flag to mark the presence of a Header object 00010 _full_text = """# the amount of fingertip force (in Newtons) to apply. 00011 # NOTE: the joint will squeeze until each finger reaches this level 00012 # values < 0 (opening force) are ignored 00013 # 00014 # 10 N can crack an egg or crush a soda can. 00015 # 15 N can firmly pick up a can of soup. 00016 # Experiment on your own. 00017 # 00018 float64 fingertip_force 00019 """ 00020 __slots__ = ['fingertip_force'] 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 fingertip_force 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(PR2GripperForceServoCommand, self).__init__(*args, **kwds) 00039 #message fields cannot be None, assign default values for those that are 00040 if self.fingertip_force is None: 00041 self.fingertip_force = 0. 00042 else: 00043 self.fingertip_force = 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.fingertip_force)) 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.fingertip_force,) = _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.fingertip_force)) 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.fingertip_force,) = _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")