_OdometryMatrix.py
Go to the documentation of this file.
00001 """autogenerated by genpy from pr2_mechanism_controllers/OdometryMatrix.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 OdometryMatrix(genpy.Message):
00009   _md5sum = "1f7818e7ce16454badf1bee936b0ff16"
00010   _type = "pr2_mechanism_controllers/OdometryMatrix"
00011   _has_header = False #flag to mark the presence of a Header object
00012   _full_text = """float64[] m
00013 """
00014   __slots__ = ['m']
00015   _slot_types = ['float64[]']
00016 
00017   def __init__(self, *args, **kwds):
00018     """
00019     Constructor. Any message fields that are implicitly/explicitly
00020     set to None will be assigned a default value. The recommend
00021     use is keyword arguments as this is more robust to future message
00022     changes.  You cannot mix in-order arguments and keyword arguments.
00023 
00024     The available fields are:
00025        m
00026 
00027     :param args: complete set of field values, in .msg order
00028     :param kwds: use keyword arguments corresponding to message field names
00029     to set specific fields.
00030     """
00031     if args or kwds:
00032       super(OdometryMatrix, self).__init__(*args, **kwds)
00033       #message fields cannot be None, assign default values for those that are
00034       if self.m is None:
00035         self.m = []
00036     else:
00037       self.m = []
00038 
00039   def _get_types(self):
00040     """
00041     internal API method
00042     """
00043     return self._slot_types
00044 
00045   def serialize(self, buff):
00046     """
00047     serialize message into buffer
00048     :param buff: buffer, ``StringIO``
00049     """
00050     try:
00051       length = len(self.m)
00052       buff.write(_struct_I.pack(length))
00053       pattern = '<%sd'%length
00054       buff.write(struct.pack(pattern, *self.m))
00055     except struct.error as se: self._check_types(se)
00056     except TypeError as te: self._check_types(te)
00057 
00058   def deserialize(self, str):
00059     """
00060     unpack serialized message in str into this message instance
00061     :param str: byte array of serialized message, ``str``
00062     """
00063     try:
00064       end = 0
00065       start = end
00066       end += 4
00067       (length,) = _struct_I.unpack(str[start:end])
00068       pattern = '<%sd'%length
00069       start = end
00070       end += struct.calcsize(pattern)
00071       self.m = struct.unpack(pattern, str[start:end])
00072       return self
00073     except struct.error as e:
00074       raise genpy.DeserializationError(e) #most likely buffer underfill
00075 
00076 
00077   def serialize_numpy(self, buff, numpy):
00078     """
00079     serialize message with numpy array types into buffer
00080     :param buff: buffer, ``StringIO``
00081     :param numpy: numpy python module
00082     """
00083     try:
00084       length = len(self.m)
00085       buff.write(_struct_I.pack(length))
00086       pattern = '<%sd'%length
00087       buff.write(self.m.tostring())
00088     except struct.error as se: self._check_types(se)
00089     except TypeError as te: self._check_types(te)
00090 
00091   def deserialize_numpy(self, str, numpy):
00092     """
00093     unpack serialized message in str into this message instance using numpy for array types
00094     :param str: byte array of serialized message, ``str``
00095     :param numpy: numpy python module
00096     """
00097     try:
00098       end = 0
00099       start = end
00100       end += 4
00101       (length,) = _struct_I.unpack(str[start:end])
00102       pattern = '<%sd'%length
00103       start = end
00104       end += struct.calcsize(pattern)
00105       self.m = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
00106       return self
00107     except struct.error as e:
00108       raise genpy.DeserializationError(e) #most likely buffer underfill
00109 
00110 _struct_I = genpy.struct_I


pr2_mechanism_controllers
Author(s): Sachin Chita, John Hsu, Melonee Wise
autogenerated on Fri Jan 3 2014 11:41:46