$search
00001 """autogenerated by genmsg_py from TestValue.msg. Do not edit.""" 00002 import roslib.message 00003 import struct 00004 00005 00006 class TestValue(roslib.message.Message): 00007 _md5sum = "8fffe15af3a2ec4c24d3cf323fdfe721" 00008 _type = "pr2_self_test_msgs/TestValue" 00009 _has_header = False #flag to mark the presence of a Header object 00010 _full_text = """# TestValue is recorded value during PR2 qualification 00011 string key 00012 string value 00013 string min 00014 string max 00015 """ 00016 __slots__ = ['key','value','min','max'] 00017 _slot_types = ['string','string','string','string'] 00018 00019 def __init__(self, *args, **kwds): 00020 """ 00021 Constructor. Any message fields that are implicitly/explicitly 00022 set to None will be assigned a default value. The recommend 00023 use is keyword arguments as this is more robust to future message 00024 changes. You cannot mix in-order arguments and keyword arguments. 00025 00026 The available fields are: 00027 key,value,min,max 00028 00029 @param args: complete set of field values, in .msg order 00030 @param kwds: use keyword arguments corresponding to message field names 00031 to set specific fields. 00032 """ 00033 if args or kwds: 00034 super(TestValue, self).__init__(*args, **kwds) 00035 #message fields cannot be None, assign default values for those that are 00036 if self.key is None: 00037 self.key = '' 00038 if self.value is None: 00039 self.value = '' 00040 if self.min is None: 00041 self.min = '' 00042 if self.max is None: 00043 self.max = '' 00044 else: 00045 self.key = '' 00046 self.value = '' 00047 self.min = '' 00048 self.max = '' 00049 00050 def _get_types(self): 00051 """ 00052 internal API method 00053 """ 00054 return self._slot_types 00055 00056 def serialize(self, buff): 00057 """ 00058 serialize message into buffer 00059 @param buff: buffer 00060 @type buff: StringIO 00061 """ 00062 try: 00063 _x = self.key 00064 length = len(_x) 00065 buff.write(struct.pack('<I%ss'%length, length, _x)) 00066 _x = self.value 00067 length = len(_x) 00068 buff.write(struct.pack('<I%ss'%length, length, _x)) 00069 _x = self.min 00070 length = len(_x) 00071 buff.write(struct.pack('<I%ss'%length, length, _x)) 00072 _x = self.max 00073 length = len(_x) 00074 buff.write(struct.pack('<I%ss'%length, length, _x)) 00075 except struct.error as se: self._check_types(se) 00076 except TypeError as te: self._check_types(te) 00077 00078 def deserialize(self, str): 00079 """ 00080 unpack serialized message in str into this message instance 00081 @param str: byte array of serialized message 00082 @type str: str 00083 """ 00084 try: 00085 end = 0 00086 start = end 00087 end += 4 00088 (length,) = _struct_I.unpack(str[start:end]) 00089 start = end 00090 end += length 00091 self.key = str[start:end] 00092 start = end 00093 end += 4 00094 (length,) = _struct_I.unpack(str[start:end]) 00095 start = end 00096 end += length 00097 self.value = str[start:end] 00098 start = end 00099 end += 4 00100 (length,) = _struct_I.unpack(str[start:end]) 00101 start = end 00102 end += length 00103 self.min = str[start:end] 00104 start = end 00105 end += 4 00106 (length,) = _struct_I.unpack(str[start:end]) 00107 start = end 00108 end += length 00109 self.max = str[start:end] 00110 return self 00111 except struct.error as e: 00112 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00113 00114 00115 def serialize_numpy(self, buff, numpy): 00116 """ 00117 serialize message with numpy array types into buffer 00118 @param buff: buffer 00119 @type buff: StringIO 00120 @param numpy: numpy python module 00121 @type numpy module 00122 """ 00123 try: 00124 _x = self.key 00125 length = len(_x) 00126 buff.write(struct.pack('<I%ss'%length, length, _x)) 00127 _x = self.value 00128 length = len(_x) 00129 buff.write(struct.pack('<I%ss'%length, length, _x)) 00130 _x = self.min 00131 length = len(_x) 00132 buff.write(struct.pack('<I%ss'%length, length, _x)) 00133 _x = self.max 00134 length = len(_x) 00135 buff.write(struct.pack('<I%ss'%length, length, _x)) 00136 except struct.error as se: self._check_types(se) 00137 except TypeError as te: self._check_types(te) 00138 00139 def deserialize_numpy(self, str, numpy): 00140 """ 00141 unpack serialized message in str into this message instance using numpy for array types 00142 @param str: byte array of serialized message 00143 @type str: str 00144 @param numpy: numpy python module 00145 @type numpy: module 00146 """ 00147 try: 00148 end = 0 00149 start = end 00150 end += 4 00151 (length,) = _struct_I.unpack(str[start:end]) 00152 start = end 00153 end += length 00154 self.key = str[start:end] 00155 start = end 00156 end += 4 00157 (length,) = _struct_I.unpack(str[start:end]) 00158 start = end 00159 end += length 00160 self.value = str[start:end] 00161 start = end 00162 end += 4 00163 (length,) = _struct_I.unpack(str[start:end]) 00164 start = end 00165 end += length 00166 self.min = str[start:end] 00167 start = end 00168 end += 4 00169 (length,) = _struct_I.unpack(str[start:end]) 00170 start = end 00171 end += length 00172 self.max = str[start:end] 00173 return self 00174 except struct.error as e: 00175 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00176 00177 _struct_I = roslib.message.struct_I