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


hector_mapping
Author(s): Stefan Kohlbrecher
autogenerated on Mon Oct 6 2014 00:33:51