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