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


iri_bow_object_detector
Author(s): dmartinez
autogenerated on Fri Dec 6 2013 22:45:45