00001 """autogenerated by genmsg_py from FieldNameChange2.msg. Do not edit."""
00002 import roslib.message
00003 import struct
00004
00005 import test_roslib_comm.msg
00006
00007 class FieldNameChange2(roslib.message.Message):
00008 _md5sum = "dde34a89b93706fc183fd13c24ae090a"
00009 _type = "test_roslib_comm/FieldNameChange2"
00010 _has_header = False
00011 _full_text = """SameSubMsg1 b
00012 ================================================================================
00013 MSG: test_roslib_comm/SameSubMsg1
00014 int32 a
00015 float32 b
00016 string c
00017 uint64[10] d
00018 float64[] e
00019 """
00020 __slots__ = ['b']
00021 _slot_types = ['test_roslib_comm/SameSubMsg1']
00022
00023 def __init__(self, *args, **kwds):
00024 """
00025 Constructor. Any message fields that are implicitly/explicitly
00026 set to None will be assigned a default value. The recommend
00027 use is keyword arguments as this is more robust to future message
00028 changes. You cannot mix in-order arguments and keyword arguments.
00029
00030 The available fields are:
00031 b
00032
00033 @param args: complete set of field values, in .msg order
00034 @param kwds: use keyword arguments corresponding to message field names
00035 to set specific fields.
00036 """
00037 if args or kwds:
00038 super(FieldNameChange2, self).__init__(*args, **kwds)
00039
00040 if self.b is None:
00041 self.b = test_roslib_comm.msg.SameSubMsg1()
00042 else:
00043 self.b = test_roslib_comm.msg.SameSubMsg1()
00044
00045 def _get_types(self):
00046 """
00047 internal API method
00048 """
00049 return self._slot_types
00050
00051 def serialize(self, buff):
00052 """
00053 serialize message into buffer
00054 @param buff: buffer
00055 @type buff: StringIO
00056 """
00057 try:
00058 _x = self
00059 buff.write(_struct_if.pack(_x.b.a, _x.b.b))
00060 _x = self.b.c
00061 length = len(_x)
00062 buff.write(struct.pack('<I%ss'%length, length, _x))
00063 buff.write(_struct_10Q.pack(*self.b.d))
00064 length = len(self.b.e)
00065 buff.write(_struct_I.pack(length))
00066 pattern = '<%sd'%length
00067 buff.write(struct.pack(pattern, *self.b.e))
00068 except struct.error, se: self._check_types(se)
00069 except TypeError, te: self._check_types(te)
00070
00071 def deserialize(self, str):
00072 """
00073 unpack serialized message in str into this message instance
00074 @param str: byte array of serialized message
00075 @type str: str
00076 """
00077 try:
00078 if self.b is None:
00079 self.b = test_roslib_comm.msg.SameSubMsg1()
00080 end = 0
00081 _x = self
00082 start = end
00083 end += 8
00084 (_x.b.a, _x.b.b,) = _struct_if.unpack(str[start:end])
00085 start = end
00086 end += 4
00087 (length,) = _struct_I.unpack(str[start:end])
00088 start = end
00089 end += length
00090 self.b.c = str[start:end]
00091 start = end
00092 end += 80
00093 self.b.d = _struct_10Q.unpack(str[start:end])
00094 start = end
00095 end += 4
00096 (length,) = _struct_I.unpack(str[start:end])
00097 pattern = '<%sd'%length
00098 start = end
00099 end += struct.calcsize(pattern)
00100 self.b.e = struct.unpack(pattern, str[start:end])
00101 return self
00102 except struct.error, e:
00103 raise roslib.message.DeserializationError(e)
00104
00105
00106 def serialize_numpy(self, buff, numpy):
00107 """
00108 serialize message with numpy array types into buffer
00109 @param buff: buffer
00110 @type buff: StringIO
00111 @param numpy: numpy python module
00112 @type numpy module
00113 """
00114 try:
00115 _x = self
00116 buff.write(_struct_if.pack(_x.b.a, _x.b.b))
00117 _x = self.b.c
00118 length = len(_x)
00119 buff.write(struct.pack('<I%ss'%length, length, _x))
00120 buff.write(self.b.d.tostring())
00121 length = len(self.b.e)
00122 buff.write(_struct_I.pack(length))
00123 pattern = '<%sd'%length
00124 buff.write(self.b.e.tostring())
00125 except struct.error, se: self._check_types(se)
00126 except TypeError, te: self._check_types(te)
00127
00128 def deserialize_numpy(self, str, numpy):
00129 """
00130 unpack serialized message in str into this message instance using numpy for array types
00131 @param str: byte array of serialized message
00132 @type str: str
00133 @param numpy: numpy python module
00134 @type numpy: module
00135 """
00136 try:
00137 if self.b is None:
00138 self.b = test_roslib_comm.msg.SameSubMsg1()
00139 end = 0
00140 _x = self
00141 start = end
00142 end += 8
00143 (_x.b.a, _x.b.b,) = _struct_if.unpack(str[start:end])
00144 start = end
00145 end += 4
00146 (length,) = _struct_I.unpack(str[start:end])
00147 start = end
00148 end += length
00149 self.b.c = str[start:end]
00150 start = end
00151 end += 80
00152 self.b.d = numpy.frombuffer(str[start:end], dtype=numpy.uint64, count=10)
00153 start = end
00154 end += 4
00155 (length,) = _struct_I.unpack(str[start:end])
00156 pattern = '<%sd'%length
00157 start = end
00158 end += struct.calcsize(pattern)
00159 self.b.e = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
00160 return self
00161 except struct.error, e:
00162 raise roslib.message.DeserializationError(e)
00163
00164 _struct_I = roslib.message.struct_I
00165 _struct_10Q = struct.Struct("<10Q")
00166 _struct_if = struct.Struct("<if")