_HectorDebugInfo.py
Go to the documentation of this file.
00001 """autogenerated by genpy from hector_mapping/HectorDebugInfo.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 hector_mapping.msg
00008 
00009 class HectorDebugInfo(genpy.Message):
00010   _md5sum = "4d33c0696c0c536f5c1447c260756674"
00011   _type = "hector_mapping/HectorDebugInfo"
00012   _has_header = False #flag to mark the presence of a Header object
00013   _full_text = """HectorIterData[] iterData
00014 ================================================================================
00015 MSG: hector_mapping/HectorIterData
00016 float64[9] hessian
00017 float64 conditionNum
00018 float64 determinant
00019 float64 conditionNum2d
00020 float64 determinant2d
00021 
00022 """
00023   __slots__ = ['iterData']
00024   _slot_types = ['hector_mapping/HectorIterData[]']
00025 
00026   def __init__(self, *args, **kwds):
00027     """
00028     Constructor. Any message fields that are implicitly/explicitly
00029     set to None will be assigned a default value. The recommend
00030     use is keyword arguments as this is more robust to future message
00031     changes.  You cannot mix in-order arguments and keyword arguments.
00032 
00033     The available fields are:
00034        iterData
00035 
00036     :param args: complete set of field values, in .msg order
00037     :param kwds: use keyword arguments corresponding to message field names
00038     to set specific fields.
00039     """
00040     if args or kwds:
00041       super(HectorDebugInfo, self).__init__(*args, **kwds)
00042       #message fields cannot be None, assign default values for those that are
00043       if self.iterData is None:
00044         self.iterData = []
00045     else:
00046       self.iterData = []
00047 
00048   def _get_types(self):
00049     """
00050     internal API method
00051     """
00052     return self._slot_types
00053 
00054   def serialize(self, buff):
00055     """
00056     serialize message into buffer
00057     :param buff: buffer, ``StringIO``
00058     """
00059     try:
00060       length = len(self.iterData)
00061       buff.write(_struct_I.pack(length))
00062       for val1 in self.iterData:
00063         buff.write(_struct_9d.pack(*val1.hessian))
00064         _x = val1
00065         buff.write(_struct_4d.pack(_x.conditionNum, _x.determinant, _x.conditionNum2d, _x.determinant2d))
00066     except struct.error as se: self._check_types(se)
00067     except TypeError as te: self._check_types(te)
00068 
00069   def deserialize(self, str):
00070     """
00071     unpack serialized message in str into this message instance
00072     :param str: byte array of serialized message, ``str``
00073     """
00074     try:
00075       if self.iterData is None:
00076         self.iterData = None
00077       end = 0
00078       start = end
00079       end += 4
00080       (length,) = _struct_I.unpack(str[start:end])
00081       self.iterData = []
00082       for i in range(0, length):
00083         val1 = hector_mapping.msg.HectorIterData()
00084         start = end
00085         end += 72
00086         val1.hessian = _struct_9d.unpack(str[start:end])
00087         _x = val1
00088         start = end
00089         end += 32
00090         (_x.conditionNum, _x.determinant, _x.conditionNum2d, _x.determinant2d,) = _struct_4d.unpack(str[start:end])
00091         self.iterData.append(val1)
00092       return self
00093     except struct.error as e:
00094       raise genpy.DeserializationError(e) #most likely buffer underfill
00095 
00096 
00097   def serialize_numpy(self, buff, numpy):
00098     """
00099     serialize message with numpy array types into buffer
00100     :param buff: buffer, ``StringIO``
00101     :param numpy: numpy python module
00102     """
00103     try:
00104       length = len(self.iterData)
00105       buff.write(_struct_I.pack(length))
00106       for val1 in self.iterData:
00107         buff.write(val1.hessian.tostring())
00108         _x = val1
00109         buff.write(_struct_4d.pack(_x.conditionNum, _x.determinant, _x.conditionNum2d, _x.determinant2d))
00110     except struct.error as se: self._check_types(se)
00111     except TypeError as te: self._check_types(te)
00112 
00113   def deserialize_numpy(self, str, numpy):
00114     """
00115     unpack serialized message in str into this message instance using numpy for array types
00116     :param str: byte array of serialized message, ``str``
00117     :param numpy: numpy python module
00118     """
00119     try:
00120       if self.iterData is None:
00121         self.iterData = None
00122       end = 0
00123       start = end
00124       end += 4
00125       (length,) = _struct_I.unpack(str[start:end])
00126       self.iterData = []
00127       for i in range(0, length):
00128         val1 = hector_mapping.msg.HectorIterData()
00129         start = end
00130         end += 72
00131         val1.hessian = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=9)
00132         _x = val1
00133         start = end
00134         end += 32
00135         (_x.conditionNum, _x.determinant, _x.conditionNum2d, _x.determinant2d,) = _struct_4d.unpack(str[start:end])
00136         self.iterData.append(val1)
00137       return self
00138     except struct.error as e:
00139       raise genpy.DeserializationError(e) #most likely buffer underfill
00140 
00141 _struct_I = genpy.struct_I
00142 _struct_4d = struct.Struct("<4d")
00143 _struct_9d = struct.Struct("<9d")
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Properties Friends


hector_mapping
Author(s): Stefan Kohlbrecher
autogenerated on Mon Jul 15 2013 16:52:03