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


motld
Author(s): Jost Tobias Springenberg, Jan Wuelfing
autogenerated on Wed Dec 26 2012 16:24:48