00001 """autogenerated by genmsg_py from TypeNameChangeComplex1.msg. Do not edit."""
00002 import roslib.message
00003 import struct
00004
00005 import test_roslib_comm.msg
00006
00007 class TypeNameChangeComplex1(roslib.message.Message):
00008 _md5sum = "a01688a0991b9d7d9facf6d94b993e93"
00009 _type = "test_roslib_comm/TypeNameChangeComplex1"
00010 _has_header = False
00011 _full_text = """SameSubMsg1[] a
00012 SameSubMsg2[10] b
00013
00014 ================================================================================
00015 MSG: test_roslib_comm/SameSubMsg1
00016 int32 a
00017 float32 b
00018 string c
00019 uint64[10] d
00020 float64[] e
00021 ================================================================================
00022 MSG: test_roslib_comm/SameSubMsg2
00023 int32 a
00024 float32 b
00025 string c
00026 uint64[10] d
00027 float64[] e
00028 """
00029 __slots__ = ['a','b']
00030 _slot_types = ['test_roslib_comm/SameSubMsg1[]','test_roslib_comm/SameSubMsg2[10]']
00031
00032 def __init__(self, *args, **kwds):
00033 """
00034 Constructor. Any message fields that are implicitly/explicitly
00035 set to None will be assigned a default value. The recommend
00036 use is keyword arguments as this is more robust to future message
00037 changes. You cannot mix in-order arguments and keyword arguments.
00038
00039 The available fields are:
00040 a,b
00041
00042 @param args: complete set of field values, in .msg order
00043 @param kwds: use keyword arguments corresponding to message field names
00044 to set specific fields.
00045 """
00046 if args or kwds:
00047 super(TypeNameChangeComplex1, self).__init__(*args, **kwds)
00048
00049 if self.a is None:
00050 self.a = []
00051 if self.b is None:
00052 self.b = [test_roslib_comm.msg.SameSubMsg2(),test_roslib_comm.msg.SameSubMsg2(),test_roslib_comm.msg.SameSubMsg2(),test_roslib_comm.msg.SameSubMsg2(),test_roslib_comm.msg.SameSubMsg2(),test_roslib_comm.msg.SameSubMsg2(),test_roslib_comm.msg.SameSubMsg2(),test_roslib_comm.msg.SameSubMsg2(),test_roslib_comm.msg.SameSubMsg2(),test_roslib_comm.msg.SameSubMsg2()]
00053 else:
00054 self.a = []
00055 self.b = [test_roslib_comm.msg.SameSubMsg2(),test_roslib_comm.msg.SameSubMsg2(),test_roslib_comm.msg.SameSubMsg2(),test_roslib_comm.msg.SameSubMsg2(),test_roslib_comm.msg.SameSubMsg2(),test_roslib_comm.msg.SameSubMsg2(),test_roslib_comm.msg.SameSubMsg2(),test_roslib_comm.msg.SameSubMsg2(),test_roslib_comm.msg.SameSubMsg2(),test_roslib_comm.msg.SameSubMsg2()]
00056
00057 def _get_types(self):
00058 """
00059 internal API method
00060 """
00061 return self._slot_types
00062
00063 def serialize(self, buff):
00064 """
00065 serialize message into buffer
00066 @param buff: buffer
00067 @type buff: StringIO
00068 """
00069 try:
00070 length = len(self.a)
00071 buff.write(_struct_I.pack(length))
00072 for val1 in self.a:
00073 _x = val1
00074 buff.write(_struct_if.pack(_x.a, _x.b))
00075 _x = val1.c
00076 length = len(_x)
00077 buff.write(struct.pack('<I%ss'%length, length, _x))
00078 buff.write(_struct_10Q.pack(*val1.d))
00079 length = len(val1.e)
00080 buff.write(_struct_I.pack(length))
00081 pattern = '<%sd'%length
00082 buff.write(struct.pack(pattern, *val1.e))
00083 for val1 in self.b:
00084 _x = val1
00085 buff.write(_struct_if.pack(_x.a, _x.b))
00086 _x = val1.c
00087 length = len(_x)
00088 buff.write(struct.pack('<I%ss'%length, length, _x))
00089 buff.write(_struct_10Q.pack(*val1.d))
00090 length = len(val1.e)
00091 buff.write(_struct_I.pack(length))
00092 pattern = '<%sd'%length
00093 buff.write(struct.pack(pattern, *val1.e))
00094 except struct.error, se: self._check_types(se)
00095 except TypeError, te: self._check_types(te)
00096
00097 def deserialize(self, str):
00098 """
00099 unpack serialized message in str into this message instance
00100 @param str: byte array of serialized message
00101 @type str: str
00102 """
00103 try:
00104 end = 0
00105 start = end
00106 end += 4
00107 (length,) = _struct_I.unpack(str[start:end])
00108 self.a = []
00109 for i in xrange(0, length):
00110 val1 = test_roslib_comm.msg.SameSubMsg1()
00111 _x = val1
00112 start = end
00113 end += 8
00114 (_x.a, _x.b,) = _struct_if.unpack(str[start:end])
00115 start = end
00116 end += 4
00117 (length,) = _struct_I.unpack(str[start:end])
00118 start = end
00119 end += length
00120 val1.c = str[start:end]
00121 start = end
00122 end += 80
00123 val1.d = _struct_10Q.unpack(str[start:end])
00124 start = end
00125 end += 4
00126 (length,) = _struct_I.unpack(str[start:end])
00127 pattern = '<%sd'%length
00128 start = end
00129 end += struct.calcsize(pattern)
00130 val1.e = struct.unpack(pattern, str[start:end])
00131 self.a.append(val1)
00132 self.b = []
00133 for i in xrange(0, 10):
00134 val1 = test_roslib_comm.msg.SameSubMsg2()
00135 _x = val1
00136 start = end
00137 end += 8
00138 (_x.a, _x.b,) = _struct_if.unpack(str[start:end])
00139 start = end
00140 end += 4
00141 (length,) = _struct_I.unpack(str[start:end])
00142 start = end
00143 end += length
00144 val1.c = str[start:end]
00145 start = end
00146 end += 80
00147 val1.d = _struct_10Q.unpack(str[start:end])
00148 start = end
00149 end += 4
00150 (length,) = _struct_I.unpack(str[start:end])
00151 pattern = '<%sd'%length
00152 start = end
00153 end += struct.calcsize(pattern)
00154 val1.e = struct.unpack(pattern, str[start:end])
00155 self.b.append(val1)
00156 return self
00157 except struct.error, e:
00158 raise roslib.message.DeserializationError(e)
00159
00160
00161 def serialize_numpy(self, buff, numpy):
00162 """
00163 serialize message with numpy array types into buffer
00164 @param buff: buffer
00165 @type buff: StringIO
00166 @param numpy: numpy python module
00167 @type numpy module
00168 """
00169 try:
00170 length = len(self.a)
00171 buff.write(_struct_I.pack(length))
00172 for val1 in self.a:
00173 _x = val1
00174 buff.write(_struct_if.pack(_x.a, _x.b))
00175 _x = val1.c
00176 length = len(_x)
00177 buff.write(struct.pack('<I%ss'%length, length, _x))
00178 buff.write(val1.d.tostring())
00179 length = len(val1.e)
00180 buff.write(_struct_I.pack(length))
00181 pattern = '<%sd'%length
00182 buff.write(val1.e.tostring())
00183 for val1 in self.b:
00184 _x = val1
00185 buff.write(_struct_if.pack(_x.a, _x.b))
00186 _x = val1.c
00187 length = len(_x)
00188 buff.write(struct.pack('<I%ss'%length, length, _x))
00189 buff.write(val1.d.tostring())
00190 length = len(val1.e)
00191 buff.write(_struct_I.pack(length))
00192 pattern = '<%sd'%length
00193 buff.write(val1.e.tostring())
00194 except struct.error, se: self._check_types(se)
00195 except TypeError, te: self._check_types(te)
00196
00197 def deserialize_numpy(self, str, numpy):
00198 """
00199 unpack serialized message in str into this message instance using numpy for array types
00200 @param str: byte array of serialized message
00201 @type str: str
00202 @param numpy: numpy python module
00203 @type numpy: module
00204 """
00205 try:
00206 end = 0
00207 start = end
00208 end += 4
00209 (length,) = _struct_I.unpack(str[start:end])
00210 self.a = []
00211 for i in xrange(0, length):
00212 val1 = test_roslib_comm.msg.SameSubMsg1()
00213 _x = val1
00214 start = end
00215 end += 8
00216 (_x.a, _x.b,) = _struct_if.unpack(str[start:end])
00217 start = end
00218 end += 4
00219 (length,) = _struct_I.unpack(str[start:end])
00220 start = end
00221 end += length
00222 val1.c = str[start:end]
00223 start = end
00224 end += 80
00225 val1.d = numpy.frombuffer(str[start:end], dtype=numpy.uint64, count=10)
00226 start = end
00227 end += 4
00228 (length,) = _struct_I.unpack(str[start:end])
00229 pattern = '<%sd'%length
00230 start = end
00231 end += struct.calcsize(pattern)
00232 val1.e = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
00233 self.a.append(val1)
00234 self.b = []
00235 for i in xrange(0, 10):
00236 val1 = test_roslib_comm.msg.SameSubMsg2()
00237 _x = val1
00238 start = end
00239 end += 8
00240 (_x.a, _x.b,) = _struct_if.unpack(str[start:end])
00241 start = end
00242 end += 4
00243 (length,) = _struct_I.unpack(str[start:end])
00244 start = end
00245 end += length
00246 val1.c = str[start:end]
00247 start = end
00248 end += 80
00249 val1.d = numpy.frombuffer(str[start:end], dtype=numpy.uint64, count=10)
00250 start = end
00251 end += 4
00252 (length,) = _struct_I.unpack(str[start:end])
00253 pattern = '<%sd'%length
00254 start = end
00255 end += struct.calcsize(pattern)
00256 val1.e = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
00257 self.b.append(val1)
00258 return self
00259 except struct.error, e:
00260 raise roslib.message.DeserializationError(e)
00261
00262 _struct_I = roslib.message.struct_I
00263 _struct_10Q = struct.Struct("<10Q")
00264 _struct_if = struct.Struct("<if")