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


vision_msgs
Author(s): Ulrich F Klank
autogenerated on Mon Oct 6 2014 00:47:36