00001 """autogenerated by genmsg_py from Composite.msg. Do not edit."""
00002 import roslib.message
00003 import struct
00004
00005 import test_ros.msg
00006
00007 class Composite(roslib.message.Message):
00008 _md5sum = "d8fb6eb869ad3956b50e8737d96dc9fa"
00009 _type = "test_ros/Composite"
00010 _has_header = False
00011 _full_text = """# composite message. required for testing import calculation in generators
00012 CompositeA a
00013 CompositeB b
00014
00015 ================================================================================
00016 MSG: test_ros/CompositeA
00017 # This represents an orientation in free space in quaternion form.
00018
00019 float64 x
00020 float64 y
00021 float64 z
00022 float64 w
00023
00024 ================================================================================
00025 MSG: test_ros/CompositeB
00026 # copy of geometry_msgs/Point for testing
00027 float64 x
00028 float64 y
00029 float64 z
00030
00031 """
00032 __slots__ = ['a','b']
00033 _slot_types = ['test_ros/CompositeA','test_ros/CompositeB']
00034
00035 def __init__(self, *args, **kwds):
00036 """
00037 Constructor. Any message fields that are implicitly/explicitly
00038 set to None will be assigned a default value. The recommend
00039 use is keyword arguments as this is more robust to future message
00040 changes. You cannot mix in-order arguments and keyword arguments.
00041
00042 The available fields are:
00043 a,b
00044
00045 @param args: complete set of field values, in .msg order
00046 @param kwds: use keyword arguments corresponding to message field names
00047 to set specific fields.
00048 """
00049 if args or kwds:
00050 super(Composite, self).__init__(*args, **kwds)
00051
00052 if self.a is None:
00053 self.a = test_ros.msg.CompositeA()
00054 if self.b is None:
00055 self.b = test_ros.msg.CompositeB()
00056 else:
00057 self.a = test_ros.msg.CompositeA()
00058 self.b = test_ros.msg.CompositeB()
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
00074 buff.write(_struct_7d.pack(_x.a.x, _x.a.y, _x.a.z, _x.a.w, _x.b.x, _x.b.y, _x.b.z))
00075 except struct.error, se: self._check_types(se)
00076 except TypeError, te: self._check_types(te)
00077
00078 def deserialize(self, str):
00079 """
00080 unpack serialized message in str into this message instance
00081 @param str: byte array of serialized message
00082 @type str: str
00083 """
00084 try:
00085 if self.a is None:
00086 self.a = test_ros.msg.CompositeA()
00087 if self.b is None:
00088 self.b = test_ros.msg.CompositeB()
00089 end = 0
00090 _x = self
00091 start = end
00092 end += 56
00093 (_x.a.x, _x.a.y, _x.a.z, _x.a.w, _x.b.x, _x.b.y, _x.b.z,) = _struct_7d.unpack(str[start:end])
00094 return self
00095 except struct.error, e:
00096 raise roslib.message.DeserializationError(e)
00097
00098
00099 def serialize_numpy(self, buff, numpy):
00100 """
00101 serialize message with numpy array types into buffer
00102 @param buff: buffer
00103 @type buff: StringIO
00104 @param numpy: numpy python module
00105 @type numpy module
00106 """
00107 try:
00108 _x = self
00109 buff.write(_struct_7d.pack(_x.a.x, _x.a.y, _x.a.z, _x.a.w, _x.b.x, _x.b.y, _x.b.z))
00110 except struct.error, se: self._check_types(se)
00111 except TypeError, te: self._check_types(te)
00112
00113 def deserialize_numpy(self, str, numpy):
00114 """
00115 unpack serialized message in str into this message instance using numpy for array types
00116 @param str: byte array of serialized message
00117 @type str: str
00118 @param numpy: numpy python module
00119 @type numpy: module
00120 """
00121 try:
00122 if self.a is None:
00123 self.a = test_ros.msg.CompositeA()
00124 if self.b is None:
00125 self.b = test_ros.msg.CompositeB()
00126 end = 0
00127 _x = self
00128 start = end
00129 end += 56
00130 (_x.a.x, _x.a.y, _x.a.z, _x.a.w, _x.b.x, _x.b.y, _x.b.z,) = _struct_7d.unpack(str[start:end])
00131 return self
00132 except struct.error, e:
00133 raise roslib.message.DeserializationError(e)
00134
00135 _struct_I = roslib.message.struct_I
00136 _struct_7d = struct.Struct("<7d")