$search
00001 """autogenerated by genmsg_py from ABoxObject.msg. Do not edit.""" 00002 import roslib.message 00003 import struct 00004 00005 00006 class ABoxObject(roslib.message.Message): 00007 _md5sum = "d55193ed27b763984b5aabe03fef4448" 00008 _type = "srs_knowledge/ABoxObject" 00009 _has_header = False #flag to mark the presence of a Header object 00010 _full_text = """int32 object_id 00011 string name 00012 string description 00013 00014 """ 00015 __slots__ = ['object_id','name','description'] 00016 _slot_types = ['int32','string','string'] 00017 00018 def __init__(self, *args, **kwds): 00019 """ 00020 Constructor. Any message fields that are implicitly/explicitly 00021 set to None will be assigned a default value. The recommend 00022 use is keyword arguments as this is more robust to future message 00023 changes. You cannot mix in-order arguments and keyword arguments. 00024 00025 The available fields are: 00026 object_id,name,description 00027 00028 @param args: complete set of field values, in .msg order 00029 @param kwds: use keyword arguments corresponding to message field names 00030 to set specific fields. 00031 """ 00032 if args or kwds: 00033 super(ABoxObject, self).__init__(*args, **kwds) 00034 #message fields cannot be None, assign default values for those that are 00035 if self.object_id is None: 00036 self.object_id = 0 00037 if self.name is None: 00038 self.name = '' 00039 if self.description is None: 00040 self.description = '' 00041 else: 00042 self.object_id = 0 00043 self.name = '' 00044 self.description = '' 00045 00046 def _get_types(self): 00047 """ 00048 internal API method 00049 """ 00050 return self._slot_types 00051 00052 def serialize(self, buff): 00053 """ 00054 serialize message into buffer 00055 @param buff: buffer 00056 @type buff: StringIO 00057 """ 00058 try: 00059 buff.write(_struct_i.pack(self.object_id)) 00060 _x = self.name 00061 length = len(_x) 00062 buff.write(struct.pack('<I%ss'%length, length, _x)) 00063 _x = self.description 00064 length = len(_x) 00065 buff.write(struct.pack('<I%ss'%length, length, _x)) 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 00073 @type str: str 00074 """ 00075 try: 00076 end = 0 00077 start = end 00078 end += 4 00079 (self.object_id,) = _struct_i.unpack(str[start:end]) 00080 start = end 00081 end += 4 00082 (length,) = _struct_I.unpack(str[start:end]) 00083 start = end 00084 end += length 00085 self.name = str[start:end] 00086 start = end 00087 end += 4 00088 (length,) = _struct_I.unpack(str[start:end]) 00089 start = end 00090 end += length 00091 self.description = str[start:end] 00092 return self 00093 except struct.error as e: 00094 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00095 00096 00097 def serialize_numpy(self, buff, numpy): 00098 """ 00099 serialize message with numpy array types into buffer 00100 @param buff: buffer 00101 @type buff: StringIO 00102 @param numpy: numpy python module 00103 @type numpy module 00104 """ 00105 try: 00106 buff.write(_struct_i.pack(self.object_id)) 00107 _x = self.name 00108 length = len(_x) 00109 buff.write(struct.pack('<I%ss'%length, length, _x)) 00110 _x = self.description 00111 length = len(_x) 00112 buff.write(struct.pack('<I%ss'%length, length, _x)) 00113 except struct.error as se: self._check_types(se) 00114 except TypeError as te: self._check_types(te) 00115 00116 def deserialize_numpy(self, str, numpy): 00117 """ 00118 unpack serialized message in str into this message instance using numpy for array types 00119 @param str: byte array of serialized message 00120 @type str: str 00121 @param numpy: numpy python module 00122 @type numpy: module 00123 """ 00124 try: 00125 end = 0 00126 start = end 00127 end += 4 00128 (self.object_id,) = _struct_i.unpack(str[start:end]) 00129 start = end 00130 end += 4 00131 (length,) = _struct_I.unpack(str[start:end]) 00132 start = end 00133 end += length 00134 self.name = str[start:end] 00135 start = end 00136 end += 4 00137 (length,) = _struct_I.unpack(str[start:end]) 00138 start = end 00139 end += length 00140 self.description = str[start:end] 00141 return self 00142 except struct.error as e: 00143 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00144 00145 _struct_I = roslib.message.struct_I 00146 _struct_i = struct.Struct("<i")