_Homography.py
Go to the documentation of this file.
00001 """autogenerated by genpy from projector_calibration/Homography.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 Homography(genpy.Message):
00009   _md5sum = "4af85ebd3bce315ca2280fd0f51c499f"
00010   _type = "projector_calibration/Homography"
00011   _has_header = False #flag to mark the presence of a Header object
00012   _full_text = """float64[9] mat # a 3x3 homography matrix
00013 """
00014   __slots__ = ['mat']
00015   _slot_types = ['float64[9]']
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        mat
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(Homography, self).__init__(*args, **kwds)
00033       #message fields cannot be None, assign default values for those that are
00034       if self.mat is None:
00035         self.mat = [0.,0.,0.,0.,0.,0.,0.,0.,0.]
00036     else:
00037       self.mat = [0.,0.,0.,0.,0.,0.,0.,0.,0.]
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       buff.write(_struct_9d.pack(*self.mat))
00052     except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00053     except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00054 
00055   def deserialize(self, str):
00056     """
00057     unpack serialized message in str into this message instance
00058     :param str: byte array of serialized message, ``str``
00059     """
00060     try:
00061       end = 0
00062       start = end
00063       end += 72
00064       self.mat = _struct_9d.unpack(str[start:end])
00065       return self
00066     except struct.error as e:
00067       raise genpy.DeserializationError(e) #most likely buffer underfill
00068 
00069 
00070   def serialize_numpy(self, buff, numpy):
00071     """
00072     serialize message with numpy array types into buffer
00073     :param buff: buffer, ``StringIO``
00074     :param numpy: numpy python module
00075     """
00076     try:
00077       buff.write(self.mat.tostring())
00078     except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00079     except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00080 
00081   def deserialize_numpy(self, str, numpy):
00082     """
00083     unpack serialized message in str into this message instance using numpy for array types
00084     :param str: byte array of serialized message, ``str``
00085     :param numpy: numpy python module
00086     """
00087     try:
00088       end = 0
00089       start = end
00090       end += 72
00091       self.mat = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=9)
00092       return self
00093     except struct.error as e:
00094       raise genpy.DeserializationError(e) #most likely buffer underfill
00095 
00096 _struct_I = genpy.struct_I
00097 _struct_9d = struct.Struct("<9d")


projector_calibration
Author(s): Daniel Lazewatsky
autogenerated on Mon Oct 6 2014 10:10:01