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