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


joint_qualification_controllers
Author(s): Kevin Watts, Melonee Wise
autogenerated on Tue Apr 22 2014 19:39:16