00001 """autogenerated by genmsg_py from cop_status.msg. Do not edit."""
00002 import roslib.message
00003 import struct
00004
00005 import vision_msgs.msg
00006
00007 class cop_status(roslib.message.Message):
00008 _md5sum = "e504873492775b055bbaa660522ec9d4"
00009 _type = "vision_msgs/cop_status"
00010 _has_header = False
00011 _full_text = """pp_status[] cop_status
00012 ================================================================================
00013 MSG: vision_msgs/pp_status
00014 uint64 STARTED = 0
00015 uint64 TERMINATED = 1
00016 uint64 EVALUATED = 2
00017 uint64 DELETABLE = 3
00018
00019 uint64 perception_primitive
00020 uint64 status
00021 """
00022 __slots__ = ['cop_status']
00023 _slot_types = ['vision_msgs/pp_status[]']
00024
00025 def __init__(self, *args, **kwds):
00026 """
00027 Constructor. Any message fields that are implicitly/explicitly
00028 set to None will be assigned a default value. The recommend
00029 use is keyword arguments as this is more robust to future message
00030 changes. You cannot mix in-order arguments and keyword arguments.
00031
00032 The available fields are:
00033 cop_status
00034
00035 @param args: complete set of field values, in .msg order
00036 @param kwds: use keyword arguments corresponding to message field names
00037 to set specific fields.
00038 """
00039 if args or kwds:
00040 super(cop_status, self).__init__(*args, **kwds)
00041
00042 if self.cop_status is None:
00043 self.cop_status = []
00044 else:
00045 self.cop_status = []
00046
00047 def _get_types(self):
00048 """
00049 internal API method
00050 """
00051 return self._slot_types
00052
00053 def serialize(self, buff):
00054 """
00055 serialize message into buffer
00056 @param buff: buffer
00057 @type buff: StringIO
00058 """
00059 try:
00060 length = len(self.cop_status)
00061 buff.write(_struct_I.pack(length))
00062 for val1 in self.cop_status:
00063 _x = val1
00064 buff.write(_struct_2Q.pack(_x.perception_primitive, _x.status))
00065 except struct.error, se: self._check_types(se)
00066 except TypeError, 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
00072 @type str: str
00073 """
00074 try:
00075 end = 0
00076 start = end
00077 end += 4
00078 (length,) = _struct_I.unpack(str[start:end])
00079 self.cop_status = []
00080 for i in xrange(0, length):
00081 val1 = vision_msgs.msg.pp_status()
00082 _x = val1
00083 start = end
00084 end += 16
00085 (_x.perception_primitive, _x.status,) = _struct_2Q.unpack(str[start:end])
00086 self.cop_status.append(val1)
00087 return self
00088 except struct.error, e:
00089 raise roslib.message.DeserializationError(e)
00090
00091
00092 def serialize_numpy(self, buff, numpy):
00093 """
00094 serialize message with numpy array types into buffer
00095 @param buff: buffer
00096 @type buff: StringIO
00097 @param numpy: numpy python module
00098 @type numpy 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, se: self._check_types(se)
00107 except TypeError, te: self._check_types(te)
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
00113 @type str: str
00114 @param numpy: numpy python module
00115 @type numpy: module
00116 """
00117 try:
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 xrange(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, e:
00132 raise roslib.message.DeserializationError(e)
00133
00134 _struct_I = roslib.message.struct_I
00135 _struct_2Q = struct.Struct("<2Q")