$search
00001 """autogenerated by genmsg_py from ObjectInfo.msg. Do not edit.""" 00002 import roslib.message 00003 import struct 00004 00005 00006 class ObjectInfo(roslib.message.Message): 00007 _md5sum = "d394469df540d3963132564bb1e1b6c6" 00008 _type = "worldmodel_msgs/ObjectInfo" 00009 _has_header = False #flag to mark the presence of a Header object 00010 _full_text = """# This message contains information about the estimated class affiliation, object id and corresponding support 00011 00012 # A string identifying the object's class (all objects of a class look the same) 00013 string class_id 00014 00015 # A string identifying the specific object 00016 string object_id 00017 00018 # A string that contains the name or a description of the specific object 00019 string name 00020 00021 # The support (degree of belief) of the object's presence given as log odd ratio 00022 float32 support 00023 00024 00025 """ 00026 __slots__ = ['class_id','object_id','name','support'] 00027 _slot_types = ['string','string','string','float32'] 00028 00029 def __init__(self, *args, **kwds): 00030 """ 00031 Constructor. Any message fields that are implicitly/explicitly 00032 set to None will be assigned a default value. The recommend 00033 use is keyword arguments as this is more robust to future message 00034 changes. You cannot mix in-order arguments and keyword arguments. 00035 00036 The available fields are: 00037 class_id,object_id,name,support 00038 00039 @param args: complete set of field values, in .msg order 00040 @param kwds: use keyword arguments corresponding to message field names 00041 to set specific fields. 00042 """ 00043 if args or kwds: 00044 super(ObjectInfo, self).__init__(*args, **kwds) 00045 #message fields cannot be None, assign default values for those that are 00046 if self.class_id is None: 00047 self.class_id = '' 00048 if self.object_id is None: 00049 self.object_id = '' 00050 if self.name is None: 00051 self.name = '' 00052 if self.support is None: 00053 self.support = 0. 00054 else: 00055 self.class_id = '' 00056 self.object_id = '' 00057 self.name = '' 00058 self.support = 0. 00059 00060 def _get_types(self): 00061 """ 00062 internal API method 00063 """ 00064 return self._slot_types 00065 00066 def serialize(self, buff): 00067 """ 00068 serialize message into buffer 00069 @param buff: buffer 00070 @type buff: StringIO 00071 """ 00072 try: 00073 _x = self.class_id 00074 length = len(_x) 00075 buff.write(struct.pack('<I%ss'%length, length, _x)) 00076 _x = self.object_id 00077 length = len(_x) 00078 buff.write(struct.pack('<I%ss'%length, length, _x)) 00079 _x = self.name 00080 length = len(_x) 00081 buff.write(struct.pack('<I%ss'%length, length, _x)) 00082 buff.write(_struct_f.pack(self.support)) 00083 except struct.error as se: self._check_types(se) 00084 except TypeError as te: self._check_types(te) 00085 00086 def deserialize(self, str): 00087 """ 00088 unpack serialized message in str into this message instance 00089 @param str: byte array of serialized message 00090 @type str: str 00091 """ 00092 try: 00093 end = 0 00094 start = end 00095 end += 4 00096 (length,) = _struct_I.unpack(str[start:end]) 00097 start = end 00098 end += length 00099 self.class_id = str[start:end] 00100 start = end 00101 end += 4 00102 (length,) = _struct_I.unpack(str[start:end]) 00103 start = end 00104 end += length 00105 self.object_id = str[start:end] 00106 start = end 00107 end += 4 00108 (length,) = _struct_I.unpack(str[start:end]) 00109 start = end 00110 end += length 00111 self.name = str[start:end] 00112 start = end 00113 end += 4 00114 (self.support,) = _struct_f.unpack(str[start:end]) 00115 return self 00116 except struct.error as e: 00117 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00118 00119 00120 def serialize_numpy(self, buff, numpy): 00121 """ 00122 serialize message with numpy array types into buffer 00123 @param buff: buffer 00124 @type buff: StringIO 00125 @param numpy: numpy python module 00126 @type numpy module 00127 """ 00128 try: 00129 _x = self.class_id 00130 length = len(_x) 00131 buff.write(struct.pack('<I%ss'%length, length, _x)) 00132 _x = self.object_id 00133 length = len(_x) 00134 buff.write(struct.pack('<I%ss'%length, length, _x)) 00135 _x = self.name 00136 length = len(_x) 00137 buff.write(struct.pack('<I%ss'%length, length, _x)) 00138 buff.write(_struct_f.pack(self.support)) 00139 except struct.error as se: self._check_types(se) 00140 except TypeError as te: self._check_types(te) 00141 00142 def deserialize_numpy(self, str, numpy): 00143 """ 00144 unpack serialized message in str into this message instance using numpy for array types 00145 @param str: byte array of serialized message 00146 @type str: str 00147 @param numpy: numpy python module 00148 @type numpy: module 00149 """ 00150 try: 00151 end = 0 00152 start = end 00153 end += 4 00154 (length,) = _struct_I.unpack(str[start:end]) 00155 start = end 00156 end += length 00157 self.class_id = str[start:end] 00158 start = end 00159 end += 4 00160 (length,) = _struct_I.unpack(str[start:end]) 00161 start = end 00162 end += length 00163 self.object_id = str[start:end] 00164 start = end 00165 end += 4 00166 (length,) = _struct_I.unpack(str[start:end]) 00167 start = end 00168 end += length 00169 self.name = str[start:end] 00170 start = end 00171 end += 4 00172 (self.support,) = _struct_f.unpack(str[start:end]) 00173 return self 00174 except struct.error as e: 00175 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00176 00177 _struct_I = roslib.message.struct_I 00178 _struct_f = struct.Struct("<f")