_FriRobotData.py
Go to the documentation of this file.
00001 """autogenerated by genpy from lwr_fri/FriRobotData.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 FriRobotData(genpy.Message):
00009   _md5sum = "e89d68aab24b9a7050d5809b14a4e699"
00010   _type = "lwr_fri/FriRobotData"
00011   _has_header = False #flag to mark the presence of a Header object
00012   _full_text = """float32[7] msrJntPos
00013 float32[7] cmdJntPos
00014 float32[7] cmdJntPosFriOffset
00015 """
00016   __slots__ = ['msrJntPos','cmdJntPos','cmdJntPosFriOffset']
00017   _slot_types = ['float32[7]','float32[7]','float32[7]']
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        msrJntPos,cmdJntPos,cmdJntPosFriOffset
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(FriRobotData, self).__init__(*args, **kwds)
00035       #message fields cannot be None, assign default values for those that are
00036       if self.msrJntPos is None:
00037         self.msrJntPos = [0.,0.,0.,0.,0.,0.,0.]
00038       if self.cmdJntPos is None:
00039         self.cmdJntPos = [0.,0.,0.,0.,0.,0.,0.]
00040       if self.cmdJntPosFriOffset is None:
00041         self.cmdJntPosFriOffset = [0.,0.,0.,0.,0.,0.,0.]
00042     else:
00043       self.msrJntPos = [0.,0.,0.,0.,0.,0.,0.]
00044       self.cmdJntPos = [0.,0.,0.,0.,0.,0.,0.]
00045       self.cmdJntPosFriOffset = [0.,0.,0.,0.,0.,0.,0.]
00046 
00047   def _get_types(self):
00048     """
00049     internal API method
00050     """
00051     return self._slot_types
00052 
00053   def serialize(self, buff):
00054     """
00055     serialize message into buffer
00056     :param buff: buffer, ``StringIO``
00057     """
00058     try:
00059       buff.write(_struct_7f.pack(*self.msrJntPos))
00060       buff.write(_struct_7f.pack(*self.cmdJntPos))
00061       buff.write(_struct_7f.pack(*self.cmdJntPosFriOffset))
00062     except struct.error as se: self._check_types(se)
00063     except TypeError as te: self._check_types(te)
00064 
00065   def deserialize(self, str):
00066     """
00067     unpack serialized message in str into this message instance
00068     :param str: byte array of serialized message, ``str``
00069     """
00070     try:
00071       end = 0
00072       start = end
00073       end += 28
00074       self.msrJntPos = _struct_7f.unpack(str[start:end])
00075       start = end
00076       end += 28
00077       self.cmdJntPos = _struct_7f.unpack(str[start:end])
00078       start = end
00079       end += 28
00080       self.cmdJntPosFriOffset = _struct_7f.unpack(str[start:end])
00081       return self
00082     except struct.error as e:
00083       raise genpy.DeserializationError(e) #most likely buffer underfill
00084 
00085 
00086   def serialize_numpy(self, buff, numpy):
00087     """
00088     serialize message with numpy array types into buffer
00089     :param buff: buffer, ``StringIO``
00090     :param numpy: numpy python module
00091     """
00092     try:
00093       buff.write(self.msrJntPos.tostring())
00094       buff.write(self.cmdJntPos.tostring())
00095       buff.write(self.cmdJntPosFriOffset.tostring())
00096     except struct.error as se: self._check_types(se)
00097     except TypeError as te: self._check_types(te)
00098 
00099   def deserialize_numpy(self, str, numpy):
00100     """
00101     unpack serialized message in str into this message instance using numpy for array types
00102     :param str: byte array of serialized message, ``str``
00103     :param numpy: numpy python module
00104     """
00105     try:
00106       end = 0
00107       start = end
00108       end += 28
00109       self.msrJntPos = numpy.frombuffer(str[start:end], dtype=numpy.float32, count=7)
00110       start = end
00111       end += 28
00112       self.cmdJntPos = numpy.frombuffer(str[start:end], dtype=numpy.float32, count=7)
00113       start = end
00114       end += 28
00115       self.cmdJntPosFriOffset = numpy.frombuffer(str[start:end], dtype=numpy.float32, count=7)
00116       return self
00117     except struct.error as e:
00118       raise genpy.DeserializationError(e) #most likely buffer underfill
00119 
00120 _struct_I = genpy.struct_I
00121 _struct_7f = struct.Struct("<7f")
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Properties Friends Defines


lwr_fri
Author(s): Ruben Smits
autogenerated on Thu Nov 14 2013 11:55:34