$search
00001 """autogenerated by genmsg_py from ObjectRecognitionGuiResult.msg. Do not edit.""" 00002 import roslib.message 00003 import struct 00004 00005 00006 class ObjectRecognitionGuiResult(roslib.message.Message): 00007 _md5sum = "1df476ea7f04bb3d25dd52feebbc33c0" 00008 _type = "object_recognition_gui/ObjectRecognitionGuiResult" 00009 _has_header = False #flag to mark the presence of a Header object 00010 _full_text = """# ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ====== 00011 00012 #the index of the model hypothesis that the user has selected for each cluster 00013 #values below 0 mean 'reject all hypotheses' 00014 int32[] selected_hypothesis_indices 00015 00016 """ 00017 __slots__ = ['selected_hypothesis_indices'] 00018 _slot_types = ['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 selected_hypothesis_indices 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(ObjectRecognitionGuiResult, self).__init__(*args, **kwds) 00036 #message fields cannot be None, assign default values for those that are 00037 if self.selected_hypothesis_indices is None: 00038 self.selected_hypothesis_indices = [] 00039 else: 00040 self.selected_hypothesis_indices = [] 00041 00042 def _get_types(self): 00043 """ 00044 internal API method 00045 """ 00046 return self._slot_types 00047 00048 def serialize(self, buff): 00049 """ 00050 serialize message into buffer 00051 @param buff: buffer 00052 @type buff: StringIO 00053 """ 00054 try: 00055 length = len(self.selected_hypothesis_indices) 00056 buff.write(_struct_I.pack(length)) 00057 pattern = '<%si'%length 00058 buff.write(struct.pack(pattern, *self.selected_hypothesis_indices)) 00059 except struct.error as se: self._check_types(se) 00060 except TypeError as te: self._check_types(te) 00061 00062 def deserialize(self, str): 00063 """ 00064 unpack serialized message in str into this message instance 00065 @param str: byte array of serialized message 00066 @type str: str 00067 """ 00068 try: 00069 end = 0 00070 start = end 00071 end += 4 00072 (length,) = _struct_I.unpack(str[start:end]) 00073 pattern = '<%si'%length 00074 start = end 00075 end += struct.calcsize(pattern) 00076 self.selected_hypothesis_indices = struct.unpack(pattern, str[start:end]) 00077 return self 00078 except struct.error as e: 00079 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00080 00081 00082 def serialize_numpy(self, buff, numpy): 00083 """ 00084 serialize message with numpy array types into buffer 00085 @param buff: buffer 00086 @type buff: StringIO 00087 @param numpy: numpy python module 00088 @type numpy module 00089 """ 00090 try: 00091 length = len(self.selected_hypothesis_indices) 00092 buff.write(_struct_I.pack(length)) 00093 pattern = '<%si'%length 00094 buff.write(self.selected_hypothesis_indices.tostring()) 00095 except struct.error as se: self._check_types(se) 00096 except TypeError as te: self._check_types(te) 00097 00098 def deserialize_numpy(self, str, numpy): 00099 """ 00100 unpack serialized message in str into this message instance using numpy for array types 00101 @param str: byte array of serialized message 00102 @type str: str 00103 @param numpy: numpy python module 00104 @type numpy: module 00105 """ 00106 try: 00107 end = 0 00108 start = end 00109 end += 4 00110 (length,) = _struct_I.unpack(str[start:end]) 00111 pattern = '<%si'%length 00112 start = end 00113 end += struct.calcsize(pattern) 00114 self.selected_hypothesis_indices = numpy.frombuffer(str[start:end], dtype=numpy.int32, count=length) 00115 return self 00116 except struct.error as e: 00117 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00118 00119 _struct_I = roslib.message.struct_I