_CBPositionData.py
Go to the documentation of this file.
00001 """autogenerated by genpy from joint_qualification_controllers/CBPositionData.msg. Do not edit."""
00002 import sys
00003 python3 = True if sys.hexversion > 0x03000000 else False
00004 import genpy
00005 import struct
00006 
00007 import joint_qualification_controllers.msg
00008 
00009 class CBPositionData(genpy.Message):
00010   _md5sum = "e7b62743b80e10dde08aea881b6ccf7b"
00011   _type = "joint_qualification_controllers/CBPositionData"
00012   _has_header = False #flag to mark the presence of a Header object
00013   _full_text = """float32 flex_position
00014 JointPositionData lift_hold
00015 JointPositionData flex_hold
00016 
00017 ================================================================================
00018 MSG: joint_qualification_controllers/JointPositionData
00019 float32[] time
00020 float32[] position
00021 float32[] velocity
00022 float32[] effort
00023 """
00024   __slots__ = ['flex_position','lift_hold','flex_hold']
00025   _slot_types = ['float32','joint_qualification_controllers/JointPositionData','joint_qualification_controllers/JointPositionData']
00026 
00027   def __init__(self, *args, **kwds):
00028     """
00029     Constructor. Any message fields that are implicitly/explicitly
00030     set to None will be assigned a default value. The recommend
00031     use is keyword arguments as this is more robust to future message
00032     changes.  You cannot mix in-order arguments and keyword arguments.
00033 
00034     The available fields are:
00035        flex_position,lift_hold,flex_hold
00036 
00037     :param args: complete set of field values, in .msg order
00038     :param kwds: use keyword arguments corresponding to message field names
00039     to set specific fields.
00040     """
00041     if args or kwds:
00042       super(CBPositionData, self).__init__(*args, **kwds)
00043       #message fields cannot be None, assign default values for those that are
00044       if self.flex_position is None:
00045         self.flex_position = 0.
00046       if self.lift_hold is None:
00047         self.lift_hold = joint_qualification_controllers.msg.JointPositionData()
00048       if self.flex_hold is None:
00049         self.flex_hold = joint_qualification_controllers.msg.JointPositionData()
00050     else:
00051       self.flex_position = 0.
00052       self.lift_hold = joint_qualification_controllers.msg.JointPositionData()
00053       self.flex_hold = joint_qualification_controllers.msg.JointPositionData()
00054 
00055   def _get_types(self):
00056     """
00057     internal API method
00058     """
00059     return self._slot_types
00060 
00061   def serialize(self, buff):
00062     """
00063     serialize message into buffer
00064     :param buff: buffer, ``StringIO``
00065     """
00066     try:
00067       buff.write(_struct_f.pack(self.flex_position))
00068       length = len(self.lift_hold.time)
00069       buff.write(_struct_I.pack(length))
00070       pattern = '<%sf'%length
00071       buff.write(struct.pack(pattern, *self.lift_hold.time))
00072       length = len(self.lift_hold.position)
00073       buff.write(_struct_I.pack(length))
00074       pattern = '<%sf'%length
00075       buff.write(struct.pack(pattern, *self.lift_hold.position))
00076       length = len(self.lift_hold.velocity)
00077       buff.write(_struct_I.pack(length))
00078       pattern = '<%sf'%length
00079       buff.write(struct.pack(pattern, *self.lift_hold.velocity))
00080       length = len(self.lift_hold.effort)
00081       buff.write(_struct_I.pack(length))
00082       pattern = '<%sf'%length
00083       buff.write(struct.pack(pattern, *self.lift_hold.effort))
00084       length = len(self.flex_hold.time)
00085       buff.write(_struct_I.pack(length))
00086       pattern = '<%sf'%length
00087       buff.write(struct.pack(pattern, *self.flex_hold.time))
00088       length = len(self.flex_hold.position)
00089       buff.write(_struct_I.pack(length))
00090       pattern = '<%sf'%length
00091       buff.write(struct.pack(pattern, *self.flex_hold.position))
00092       length = len(self.flex_hold.velocity)
00093       buff.write(_struct_I.pack(length))
00094       pattern = '<%sf'%length
00095       buff.write(struct.pack(pattern, *self.flex_hold.velocity))
00096       length = len(self.flex_hold.effort)
00097       buff.write(_struct_I.pack(length))
00098       pattern = '<%sf'%length
00099       buff.write(struct.pack(pattern, *self.flex_hold.effort))
00100     except struct.error as se: self._check_types(se)
00101     except TypeError as te: self._check_types(te)
00102 
00103   def deserialize(self, str):
00104     """
00105     unpack serialized message in str into this message instance
00106     :param str: byte array of serialized message, ``str``
00107     """
00108     try:
00109       if self.lift_hold is None:
00110         self.lift_hold = joint_qualification_controllers.msg.JointPositionData()
00111       if self.flex_hold is None:
00112         self.flex_hold = joint_qualification_controllers.msg.JointPositionData()
00113       end = 0
00114       start = end
00115       end += 4
00116       (self.flex_position,) = _struct_f.unpack(str[start:end])
00117       start = end
00118       end += 4
00119       (length,) = _struct_I.unpack(str[start:end])
00120       pattern = '<%sf'%length
00121       start = end
00122       end += struct.calcsize(pattern)
00123       self.lift_hold.time = struct.unpack(pattern, str[start:end])
00124       start = end
00125       end += 4
00126       (length,) = _struct_I.unpack(str[start:end])
00127       pattern = '<%sf'%length
00128       start = end
00129       end += struct.calcsize(pattern)
00130       self.lift_hold.position = struct.unpack(pattern, str[start:end])
00131       start = end
00132       end += 4
00133       (length,) = _struct_I.unpack(str[start:end])
00134       pattern = '<%sf'%length
00135       start = end
00136       end += struct.calcsize(pattern)
00137       self.lift_hold.velocity = struct.unpack(pattern, str[start:end])
00138       start = end
00139       end += 4
00140       (length,) = _struct_I.unpack(str[start:end])
00141       pattern = '<%sf'%length
00142       start = end
00143       end += struct.calcsize(pattern)
00144       self.lift_hold.effort = struct.unpack(pattern, str[start:end])
00145       start = end
00146       end += 4
00147       (length,) = _struct_I.unpack(str[start:end])
00148       pattern = '<%sf'%length
00149       start = end
00150       end += struct.calcsize(pattern)
00151       self.flex_hold.time = struct.unpack(pattern, str[start:end])
00152       start = end
00153       end += 4
00154       (length,) = _struct_I.unpack(str[start:end])
00155       pattern = '<%sf'%length
00156       start = end
00157       end += struct.calcsize(pattern)
00158       self.flex_hold.position = struct.unpack(pattern, str[start:end])
00159       start = end
00160       end += 4
00161       (length,) = _struct_I.unpack(str[start:end])
00162       pattern = '<%sf'%length
00163       start = end
00164       end += struct.calcsize(pattern)
00165       self.flex_hold.velocity = struct.unpack(pattern, str[start:end])
00166       start = end
00167       end += 4
00168       (length,) = _struct_I.unpack(str[start:end])
00169       pattern = '<%sf'%length
00170       start = end
00171       end += struct.calcsize(pattern)
00172       self.flex_hold.effort = struct.unpack(pattern, str[start:end])
00173       return self
00174     except struct.error as e:
00175       raise genpy.DeserializationError(e) #most likely buffer underfill
00176 
00177 
00178   def serialize_numpy(self, buff, numpy):
00179     """
00180     serialize message with numpy array types into buffer
00181     :param buff: buffer, ``StringIO``
00182     :param numpy: numpy python module
00183     """
00184     try:
00185       buff.write(_struct_f.pack(self.flex_position))
00186       length = len(self.lift_hold.time)
00187       buff.write(_struct_I.pack(length))
00188       pattern = '<%sf'%length
00189       buff.write(self.lift_hold.time.tostring())
00190       length = len(self.lift_hold.position)
00191       buff.write(_struct_I.pack(length))
00192       pattern = '<%sf'%length
00193       buff.write(self.lift_hold.position.tostring())
00194       length = len(self.lift_hold.velocity)
00195       buff.write(_struct_I.pack(length))
00196       pattern = '<%sf'%length
00197       buff.write(self.lift_hold.velocity.tostring())
00198       length = len(self.lift_hold.effort)
00199       buff.write(_struct_I.pack(length))
00200       pattern = '<%sf'%length
00201       buff.write(self.lift_hold.effort.tostring())
00202       length = len(self.flex_hold.time)
00203       buff.write(_struct_I.pack(length))
00204       pattern = '<%sf'%length
00205       buff.write(self.flex_hold.time.tostring())
00206       length = len(self.flex_hold.position)
00207       buff.write(_struct_I.pack(length))
00208       pattern = '<%sf'%length
00209       buff.write(self.flex_hold.position.tostring())
00210       length = len(self.flex_hold.velocity)
00211       buff.write(_struct_I.pack(length))
00212       pattern = '<%sf'%length
00213       buff.write(self.flex_hold.velocity.tostring())
00214       length = len(self.flex_hold.effort)
00215       buff.write(_struct_I.pack(length))
00216       pattern = '<%sf'%length
00217       buff.write(self.flex_hold.effort.tostring())
00218     except struct.error as se: self._check_types(se)
00219     except TypeError as te: self._check_types(te)
00220 
00221   def deserialize_numpy(self, str, numpy):
00222     """
00223     unpack serialized message in str into this message instance using numpy for array types
00224     :param str: byte array of serialized message, ``str``
00225     :param numpy: numpy python module
00226     """
00227     try:
00228       if self.lift_hold is None:
00229         self.lift_hold = joint_qualification_controllers.msg.JointPositionData()
00230       if self.flex_hold is None:
00231         self.flex_hold = joint_qualification_controllers.msg.JointPositionData()
00232       end = 0
00233       start = end
00234       end += 4
00235       (self.flex_position,) = _struct_f.unpack(str[start:end])
00236       start = end
00237       end += 4
00238       (length,) = _struct_I.unpack(str[start:end])
00239       pattern = '<%sf'%length
00240       start = end
00241       end += struct.calcsize(pattern)
00242       self.lift_hold.time = numpy.frombuffer(str[start:end], dtype=numpy.float32, count=length)
00243       start = end
00244       end += 4
00245       (length,) = _struct_I.unpack(str[start:end])
00246       pattern = '<%sf'%length
00247       start = end
00248       end += struct.calcsize(pattern)
00249       self.lift_hold.position = numpy.frombuffer(str[start:end], dtype=numpy.float32, count=length)
00250       start = end
00251       end += 4
00252       (length,) = _struct_I.unpack(str[start:end])
00253       pattern = '<%sf'%length
00254       start = end
00255       end += struct.calcsize(pattern)
00256       self.lift_hold.velocity = numpy.frombuffer(str[start:end], dtype=numpy.float32, count=length)
00257       start = end
00258       end += 4
00259       (length,) = _struct_I.unpack(str[start:end])
00260       pattern = '<%sf'%length
00261       start = end
00262       end += struct.calcsize(pattern)
00263       self.lift_hold.effort = numpy.frombuffer(str[start:end], dtype=numpy.float32, count=length)
00264       start = end
00265       end += 4
00266       (length,) = _struct_I.unpack(str[start:end])
00267       pattern = '<%sf'%length
00268       start = end
00269       end += struct.calcsize(pattern)
00270       self.flex_hold.time = numpy.frombuffer(str[start:end], dtype=numpy.float32, count=length)
00271       start = end
00272       end += 4
00273       (length,) = _struct_I.unpack(str[start:end])
00274       pattern = '<%sf'%length
00275       start = end
00276       end += struct.calcsize(pattern)
00277       self.flex_hold.position = numpy.frombuffer(str[start:end], dtype=numpy.float32, count=length)
00278       start = end
00279       end += 4
00280       (length,) = _struct_I.unpack(str[start:end])
00281       pattern = '<%sf'%length
00282       start = end
00283       end += struct.calcsize(pattern)
00284       self.flex_hold.velocity = numpy.frombuffer(str[start:end], dtype=numpy.float32, count=length)
00285       start = end
00286       end += 4
00287       (length,) = _struct_I.unpack(str[start:end])
00288       pattern = '<%sf'%length
00289       start = end
00290       end += struct.calcsize(pattern)
00291       self.flex_hold.effort = numpy.frombuffer(str[start:end], dtype=numpy.float32, count=length)
00292       return self
00293     except struct.error as e:
00294       raise genpy.DeserializationError(e) #most likely buffer underfill
00295 
00296 _struct_I = genpy.struct_I
00297 _struct_f = struct.Struct("<f")


joint_qualification_controllers
Author(s): Kevin Watts, Melonee Wise
autogenerated on Sat Dec 28 2013 17:29:55