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