00001 """autogenerated by genpy from joint_qualification_controllers/HysteresisData.msg. Do not edit."""
00002 import sys
00003 python3 = True if sys.hexversion > 0x03000000 else False
00004 import genpy
00005 import struct
00006
00007
00008 class HysteresisData(genpy.Message):
00009 _md5sum = "55018edece2f193bc97f016db04a871b"
00010 _type = "joint_qualification_controllers/HysteresisData"
00011 _has_header = False
00012 _full_text = """string joint_name
00013
00014 float32[] time_up
00015 float32[] effort_up
00016 float32[] position_up
00017 float32[] velocity_up
00018
00019 float32[] time_down
00020 float32[] effort_down
00021 float32[] position_down
00022 float32[] velocity_down
00023
00024 string[] arg_name
00025 float32[] arg_value
00026
00027 """
00028 __slots__ = ['joint_name','time_up','effort_up','position_up','velocity_up','time_down','effort_down','position_down','velocity_down','arg_name','arg_value']
00029 _slot_types = ['string','float32[]','float32[]','float32[]','float32[]','float32[]','float32[]','float32[]','float32[]','string[]','float32[]']
00030
00031 def __init__(self, *args, **kwds):
00032 """
00033 Constructor. Any message fields that are implicitly/explicitly
00034 set to None will be assigned a default value. The recommend
00035 use is keyword arguments as this is more robust to future message
00036 changes. You cannot mix in-order arguments and keyword arguments.
00037
00038 The available fields are:
00039 joint_name,time_up,effort_up,position_up,velocity_up,time_down,effort_down,position_down,velocity_down,arg_name,arg_value
00040
00041 :param args: complete set of field values, in .msg order
00042 :param kwds: use keyword arguments corresponding to message field names
00043 to set specific fields.
00044 """
00045 if args or kwds:
00046 super(HysteresisData, self).__init__(*args, **kwds)
00047
00048 if self.joint_name is None:
00049 self.joint_name = ''
00050 if self.time_up is None:
00051 self.time_up = []
00052 if self.effort_up is None:
00053 self.effort_up = []
00054 if self.position_up is None:
00055 self.position_up = []
00056 if self.velocity_up is None:
00057 self.velocity_up = []
00058 if self.time_down is None:
00059 self.time_down = []
00060 if self.effort_down is None:
00061 self.effort_down = []
00062 if self.position_down is None:
00063 self.position_down = []
00064 if self.velocity_down is None:
00065 self.velocity_down = []
00066 if self.arg_name is None:
00067 self.arg_name = []
00068 if self.arg_value is None:
00069 self.arg_value = []
00070 else:
00071 self.joint_name = ''
00072 self.time_up = []
00073 self.effort_up = []
00074 self.position_up = []
00075 self.velocity_up = []
00076 self.time_down = []
00077 self.effort_down = []
00078 self.position_down = []
00079 self.velocity_down = []
00080 self.arg_name = []
00081 self.arg_value = []
00082
00083 def _get_types(self):
00084 """
00085 internal API method
00086 """
00087 return self._slot_types
00088
00089 def serialize(self, buff):
00090 """
00091 serialize message into buffer
00092 :param buff: buffer, ``StringIO``
00093 """
00094 try:
00095 _x = self.joint_name
00096 length = len(_x)
00097 if python3 or type(_x) == unicode:
00098 _x = _x.encode('utf-8')
00099 length = len(_x)
00100 buff.write(struct.pack('<I%ss'%length, length, _x))
00101 length = len(self.time_up)
00102 buff.write(_struct_I.pack(length))
00103 pattern = '<%sf'%length
00104 buff.write(struct.pack(pattern, *self.time_up))
00105 length = len(self.effort_up)
00106 buff.write(_struct_I.pack(length))
00107 pattern = '<%sf'%length
00108 buff.write(struct.pack(pattern, *self.effort_up))
00109 length = len(self.position_up)
00110 buff.write(_struct_I.pack(length))
00111 pattern = '<%sf'%length
00112 buff.write(struct.pack(pattern, *self.position_up))
00113 length = len(self.velocity_up)
00114 buff.write(_struct_I.pack(length))
00115 pattern = '<%sf'%length
00116 buff.write(struct.pack(pattern, *self.velocity_up))
00117 length = len(self.time_down)
00118 buff.write(_struct_I.pack(length))
00119 pattern = '<%sf'%length
00120 buff.write(struct.pack(pattern, *self.time_down))
00121 length = len(self.effort_down)
00122 buff.write(_struct_I.pack(length))
00123 pattern = '<%sf'%length
00124 buff.write(struct.pack(pattern, *self.effort_down))
00125 length = len(self.position_down)
00126 buff.write(_struct_I.pack(length))
00127 pattern = '<%sf'%length
00128 buff.write(struct.pack(pattern, *self.position_down))
00129 length = len(self.velocity_down)
00130 buff.write(_struct_I.pack(length))
00131 pattern = '<%sf'%length
00132 buff.write(struct.pack(pattern, *self.velocity_down))
00133 length = len(self.arg_name)
00134 buff.write(_struct_I.pack(length))
00135 for val1 in self.arg_name:
00136 length = len(val1)
00137 if python3 or type(val1) == unicode:
00138 val1 = val1.encode('utf-8')
00139 length = len(val1)
00140 buff.write(struct.pack('<I%ss'%length, length, val1))
00141 length = len(self.arg_value)
00142 buff.write(_struct_I.pack(length))
00143 pattern = '<%sf'%length
00144 buff.write(struct.pack(pattern, *self.arg_value))
00145 except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00146 except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00147
00148 def deserialize(self, str):
00149 """
00150 unpack serialized message in str into this message instance
00151 :param str: byte array of serialized message, ``str``
00152 """
00153 try:
00154 end = 0
00155 start = end
00156 end += 4
00157 (length,) = _struct_I.unpack(str[start:end])
00158 start = end
00159 end += length
00160 if python3:
00161 self.joint_name = str[start:end].decode('utf-8')
00162 else:
00163 self.joint_name = str[start:end]
00164 start = end
00165 end += 4
00166 (length,) = _struct_I.unpack(str[start:end])
00167 pattern = '<%sf'%length
00168 start = end
00169 end += struct.calcsize(pattern)
00170 self.time_up = struct.unpack(pattern, str[start:end])
00171 start = end
00172 end += 4
00173 (length,) = _struct_I.unpack(str[start:end])
00174 pattern = '<%sf'%length
00175 start = end
00176 end += struct.calcsize(pattern)
00177 self.effort_up = struct.unpack(pattern, str[start:end])
00178 start = end
00179 end += 4
00180 (length,) = _struct_I.unpack(str[start:end])
00181 pattern = '<%sf'%length
00182 start = end
00183 end += struct.calcsize(pattern)
00184 self.position_up = struct.unpack(pattern, str[start:end])
00185 start = end
00186 end += 4
00187 (length,) = _struct_I.unpack(str[start:end])
00188 pattern = '<%sf'%length
00189 start = end
00190 end += struct.calcsize(pattern)
00191 self.velocity_up = struct.unpack(pattern, str[start:end])
00192 start = end
00193 end += 4
00194 (length,) = _struct_I.unpack(str[start:end])
00195 pattern = '<%sf'%length
00196 start = end
00197 end += struct.calcsize(pattern)
00198 self.time_down = struct.unpack(pattern, str[start:end])
00199 start = end
00200 end += 4
00201 (length,) = _struct_I.unpack(str[start:end])
00202 pattern = '<%sf'%length
00203 start = end
00204 end += struct.calcsize(pattern)
00205 self.effort_down = struct.unpack(pattern, str[start:end])
00206 start = end
00207 end += 4
00208 (length,) = _struct_I.unpack(str[start:end])
00209 pattern = '<%sf'%length
00210 start = end
00211 end += struct.calcsize(pattern)
00212 self.position_down = struct.unpack(pattern, str[start:end])
00213 start = end
00214 end += 4
00215 (length,) = _struct_I.unpack(str[start:end])
00216 pattern = '<%sf'%length
00217 start = end
00218 end += struct.calcsize(pattern)
00219 self.velocity_down = struct.unpack(pattern, str[start:end])
00220 start = end
00221 end += 4
00222 (length,) = _struct_I.unpack(str[start:end])
00223 self.arg_name = []
00224 for i in range(0, length):
00225 start = end
00226 end += 4
00227 (length,) = _struct_I.unpack(str[start:end])
00228 start = end
00229 end += length
00230 if python3:
00231 val1 = str[start:end].decode('utf-8')
00232 else:
00233 val1 = str[start:end]
00234 self.arg_name.append(val1)
00235 start = end
00236 end += 4
00237 (length,) = _struct_I.unpack(str[start:end])
00238 pattern = '<%sf'%length
00239 start = end
00240 end += struct.calcsize(pattern)
00241 self.arg_value = struct.unpack(pattern, str[start:end])
00242 return self
00243 except struct.error as e:
00244 raise genpy.DeserializationError(e)
00245
00246
00247 def serialize_numpy(self, buff, numpy):
00248 """
00249 serialize message with numpy array types into buffer
00250 :param buff: buffer, ``StringIO``
00251 :param numpy: numpy python module
00252 """
00253 try:
00254 _x = self.joint_name
00255 length = len(_x)
00256 if python3 or type(_x) == unicode:
00257 _x = _x.encode('utf-8')
00258 length = len(_x)
00259 buff.write(struct.pack('<I%ss'%length, length, _x))
00260 length = len(self.time_up)
00261 buff.write(_struct_I.pack(length))
00262 pattern = '<%sf'%length
00263 buff.write(self.time_up.tostring())
00264 length = len(self.effort_up)
00265 buff.write(_struct_I.pack(length))
00266 pattern = '<%sf'%length
00267 buff.write(self.effort_up.tostring())
00268 length = len(self.position_up)
00269 buff.write(_struct_I.pack(length))
00270 pattern = '<%sf'%length
00271 buff.write(self.position_up.tostring())
00272 length = len(self.velocity_up)
00273 buff.write(_struct_I.pack(length))
00274 pattern = '<%sf'%length
00275 buff.write(self.velocity_up.tostring())
00276 length = len(self.time_down)
00277 buff.write(_struct_I.pack(length))
00278 pattern = '<%sf'%length
00279 buff.write(self.time_down.tostring())
00280 length = len(self.effort_down)
00281 buff.write(_struct_I.pack(length))
00282 pattern = '<%sf'%length
00283 buff.write(self.effort_down.tostring())
00284 length = len(self.position_down)
00285 buff.write(_struct_I.pack(length))
00286 pattern = '<%sf'%length
00287 buff.write(self.position_down.tostring())
00288 length = len(self.velocity_down)
00289 buff.write(_struct_I.pack(length))
00290 pattern = '<%sf'%length
00291 buff.write(self.velocity_down.tostring())
00292 length = len(self.arg_name)
00293 buff.write(_struct_I.pack(length))
00294 for val1 in self.arg_name:
00295 length = len(val1)
00296 if python3 or type(val1) == unicode:
00297 val1 = val1.encode('utf-8')
00298 length = len(val1)
00299 buff.write(struct.pack('<I%ss'%length, length, val1))
00300 length = len(self.arg_value)
00301 buff.write(_struct_I.pack(length))
00302 pattern = '<%sf'%length
00303 buff.write(self.arg_value.tostring())
00304 except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00305 except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00306
00307 def deserialize_numpy(self, str, numpy):
00308 """
00309 unpack serialized message in str into this message instance using numpy for array types
00310 :param str: byte array of serialized message, ``str``
00311 :param numpy: numpy python module
00312 """
00313 try:
00314 end = 0
00315 start = end
00316 end += 4
00317 (length,) = _struct_I.unpack(str[start:end])
00318 start = end
00319 end += length
00320 if python3:
00321 self.joint_name = str[start:end].decode('utf-8')
00322 else:
00323 self.joint_name = str[start:end]
00324 start = end
00325 end += 4
00326 (length,) = _struct_I.unpack(str[start:end])
00327 pattern = '<%sf'%length
00328 start = end
00329 end += struct.calcsize(pattern)
00330 self.time_up = numpy.frombuffer(str[start:end], dtype=numpy.float32, count=length)
00331 start = end
00332 end += 4
00333 (length,) = _struct_I.unpack(str[start:end])
00334 pattern = '<%sf'%length
00335 start = end
00336 end += struct.calcsize(pattern)
00337 self.effort_up = numpy.frombuffer(str[start:end], dtype=numpy.float32, count=length)
00338 start = end
00339 end += 4
00340 (length,) = _struct_I.unpack(str[start:end])
00341 pattern = '<%sf'%length
00342 start = end
00343 end += struct.calcsize(pattern)
00344 self.position_up = numpy.frombuffer(str[start:end], dtype=numpy.float32, count=length)
00345 start = end
00346 end += 4
00347 (length,) = _struct_I.unpack(str[start:end])
00348 pattern = '<%sf'%length
00349 start = end
00350 end += struct.calcsize(pattern)
00351 self.velocity_up = numpy.frombuffer(str[start:end], dtype=numpy.float32, count=length)
00352 start = end
00353 end += 4
00354 (length,) = _struct_I.unpack(str[start:end])
00355 pattern = '<%sf'%length
00356 start = end
00357 end += struct.calcsize(pattern)
00358 self.time_down = numpy.frombuffer(str[start:end], dtype=numpy.float32, count=length)
00359 start = end
00360 end += 4
00361 (length,) = _struct_I.unpack(str[start:end])
00362 pattern = '<%sf'%length
00363 start = end
00364 end += struct.calcsize(pattern)
00365 self.effort_down = numpy.frombuffer(str[start:end], dtype=numpy.float32, count=length)
00366 start = end
00367 end += 4
00368 (length,) = _struct_I.unpack(str[start:end])
00369 pattern = '<%sf'%length
00370 start = end
00371 end += struct.calcsize(pattern)
00372 self.position_down = numpy.frombuffer(str[start:end], dtype=numpy.float32, count=length)
00373 start = end
00374 end += 4
00375 (length,) = _struct_I.unpack(str[start:end])
00376 pattern = '<%sf'%length
00377 start = end
00378 end += struct.calcsize(pattern)
00379 self.velocity_down = numpy.frombuffer(str[start:end], dtype=numpy.float32, count=length)
00380 start = end
00381 end += 4
00382 (length,) = _struct_I.unpack(str[start:end])
00383 self.arg_name = []
00384 for i in range(0, length):
00385 start = end
00386 end += 4
00387 (length,) = _struct_I.unpack(str[start:end])
00388 start = end
00389 end += length
00390 if python3:
00391 val1 = str[start:end].decode('utf-8')
00392 else:
00393 val1 = str[start:end]
00394 self.arg_name.append(val1)
00395 start = end
00396 end += 4
00397 (length,) = _struct_I.unpack(str[start:end])
00398 pattern = '<%sf'%length
00399 start = end
00400 end += struct.calcsize(pattern)
00401 self.arg_value = numpy.frombuffer(str[start:end], dtype=numpy.float32, count=length)
00402 return self
00403 except struct.error as e:
00404 raise genpy.DeserializationError(e)
00405
00406 _struct_I = genpy.struct_I