$search
00001 """autogenerated by genmsg_py from ManualGraspingResult.msg. Do not edit.""" 00002 import roslib.message 00003 import struct 00004 00005 import roslib.rostime 00006 00007 class ManualGraspingResult(roslib.message.Message): 00008 _md5sum = "84e0c29ee3715a768f8d896e6b92254b" 00009 _type = "srs_assisted_grasping_msgs/ManualGraspingResult" 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 # result 00013 duration time_elapsed 00014 bool grasped 00015 float32 tip1_force 00016 float32 tip2_force 00017 float32 tip3_force 00018 00019 """ 00020 __slots__ = ['time_elapsed','grasped','tip1_force','tip2_force','tip3_force'] 00021 _slot_types = ['duration','bool','float32','float32','float32'] 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 time_elapsed,grasped,tip1_force,tip2_force,tip3_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(ManualGraspingResult, self).__init__(*args, **kwds) 00039 #message fields cannot be None, assign default values for those that are 00040 if self.time_elapsed is None: 00041 self.time_elapsed = roslib.rostime.Duration() 00042 if self.grasped is None: 00043 self.grasped = False 00044 if self.tip1_force is None: 00045 self.tip1_force = 0. 00046 if self.tip2_force is None: 00047 self.tip2_force = 0. 00048 if self.tip3_force is None: 00049 self.tip3_force = 0. 00050 else: 00051 self.time_elapsed = roslib.rostime.Duration() 00052 self.grasped = False 00053 self.tip1_force = 0. 00054 self.tip2_force = 0. 00055 self.tip3_force = 0. 00056 00057 def _get_types(self): 00058 """ 00059 internal API method 00060 """ 00061 return self._slot_types 00062 00063 def serialize(self, buff): 00064 """ 00065 serialize message into buffer 00066 @param buff: buffer 00067 @type buff: StringIO 00068 """ 00069 try: 00070 _x = self 00071 buff.write(_struct_2iB3f.pack(_x.time_elapsed.secs, _x.time_elapsed.nsecs, _x.grasped, _x.tip1_force, _x.tip2_force, _x.tip3_force)) 00072 except struct.error as se: self._check_types(se) 00073 except TypeError as te: self._check_types(te) 00074 00075 def deserialize(self, str): 00076 """ 00077 unpack serialized message in str into this message instance 00078 @param str: byte array of serialized message 00079 @type str: str 00080 """ 00081 try: 00082 if self.time_elapsed is None: 00083 self.time_elapsed = roslib.rostime.Duration() 00084 end = 0 00085 _x = self 00086 start = end 00087 end += 21 00088 (_x.time_elapsed.secs, _x.time_elapsed.nsecs, _x.grasped, _x.tip1_force, _x.tip2_force, _x.tip3_force,) = _struct_2iB3f.unpack(str[start:end]) 00089 self.grasped = bool(self.grasped) 00090 self.time_elapsed.canon() 00091 return self 00092 except struct.error as e: 00093 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00094 00095 00096 def serialize_numpy(self, buff, numpy): 00097 """ 00098 serialize message with numpy array types into buffer 00099 @param buff: buffer 00100 @type buff: StringIO 00101 @param numpy: numpy python module 00102 @type numpy module 00103 """ 00104 try: 00105 _x = self 00106 buff.write(_struct_2iB3f.pack(_x.time_elapsed.secs, _x.time_elapsed.nsecs, _x.grasped, _x.tip1_force, _x.tip2_force, _x.tip3_force)) 00107 except struct.error as se: self._check_types(se) 00108 except TypeError as te: self._check_types(te) 00109 00110 def deserialize_numpy(self, str, numpy): 00111 """ 00112 unpack serialized message in str into this message instance using numpy for array types 00113 @param str: byte array of serialized message 00114 @type str: str 00115 @param numpy: numpy python module 00116 @type numpy: module 00117 """ 00118 try: 00119 if self.time_elapsed is None: 00120 self.time_elapsed = roslib.rostime.Duration() 00121 end = 0 00122 _x = self 00123 start = end 00124 end += 21 00125 (_x.time_elapsed.secs, _x.time_elapsed.nsecs, _x.grasped, _x.tip1_force, _x.tip2_force, _x.tip3_force,) = _struct_2iB3f.unpack(str[start:end]) 00126 self.grasped = bool(self.grasped) 00127 self.time_elapsed.canon() 00128 return self 00129 except struct.error as e: 00130 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00131 00132 _struct_I = roslib.message.struct_I 00133 _struct_2iB3f = struct.Struct("<2iB3f")