$search
00001 """autogenerated by genmsg_py from ExperimentResult.msg. Do not edit.""" 00002 import roslib.message 00003 import struct 00004 00005 00006 class ExperimentResult(roslib.message.Message): 00007 _md5sum = "c426d2d8f166bdda938148c7e967c60a" 00008 _type = "robot_booking/ExperimentResult" 00009 _has_header = False #flag to mark the presence of a Header object 00010 _full_text = """bool result 00011 int8 grab 00012 float32 time 00013 float32 best_time 00014 00015 00016 """ 00017 __slots__ = ['result','grab','time','best_time'] 00018 _slot_types = ['bool','int8','float32','float32'] 00019 00020 def __init__(self, *args, **kwds): 00021 """ 00022 Constructor. Any message fields that are implicitly/explicitly 00023 set to None will be assigned a default value. The recommend 00024 use is keyword arguments as this is more robust to future message 00025 changes. You cannot mix in-order arguments and keyword arguments. 00026 00027 The available fields are: 00028 result,grab,time,best_time 00029 00030 @param args: complete set of field values, in .msg order 00031 @param kwds: use keyword arguments corresponding to message field names 00032 to set specific fields. 00033 """ 00034 if args or kwds: 00035 super(ExperimentResult, self).__init__(*args, **kwds) 00036 #message fields cannot be None, assign default values for those that are 00037 if self.result is None: 00038 self.result = False 00039 if self.grab is None: 00040 self.grab = 0 00041 if self.time is None: 00042 self.time = 0. 00043 if self.best_time is None: 00044 self.best_time = 0. 00045 else: 00046 self.result = False 00047 self.grab = 0 00048 self.time = 0. 00049 self.best_time = 0. 00050 00051 def _get_types(self): 00052 """ 00053 internal API method 00054 """ 00055 return self._slot_types 00056 00057 def serialize(self, buff): 00058 """ 00059 serialize message into buffer 00060 @param buff: buffer 00061 @type buff: StringIO 00062 """ 00063 try: 00064 _x = self 00065 buff.write(_struct_Bb2f.pack(_x.result, _x.grab, _x.time, _x.best_time)) 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 end = 0 00077 _x = self 00078 start = end 00079 end += 10 00080 (_x.result, _x.grab, _x.time, _x.best_time,) = _struct_Bb2f.unpack(str[start:end]) 00081 self.result = bool(self.result) 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 _x = self 00097 buff.write(_struct_Bb2f.pack(_x.result, _x.grab, _x.time, _x.best_time)) 00098 except struct.error as se: self._check_types(se) 00099 except TypeError as te: self._check_types(te) 00100 00101 def deserialize_numpy(self, str, numpy): 00102 """ 00103 unpack serialized message in str into this message instance using numpy for array types 00104 @param str: byte array of serialized message 00105 @type str: str 00106 @param numpy: numpy python module 00107 @type numpy: module 00108 """ 00109 try: 00110 end = 0 00111 _x = self 00112 start = end 00113 end += 10 00114 (_x.result, _x.grab, _x.time, _x.best_time,) = _struct_Bb2f.unpack(str[start:end]) 00115 self.result = bool(self.result) 00116 return self 00117 except struct.error as e: 00118 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00119 00120 _struct_I = roslib.message.struct_I 00121 _struct_Bb2f = struct.Struct("<Bb2f")