00001 """autogenerated by genmsg_py from Point32.msg. Do not edit."""
00002 import roslib.message
00003 import struct
00004
00005
00006 class Point32(roslib.message.Message):
00007 _md5sum = "cc153912f1453b708d221682bc23d9ac"
00008 _type = "test_roscpp_serialization_perf/Point32"
00009 _has_header = False
00010 _full_text = """float32 x
00011 float32 y
00012 float32 z
00013 """
00014 __slots__ = ['x','y','z']
00015 _slot_types = ['float32','float32','float32']
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 x,y,z
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(Point32, self).__init__(*args, **kwds)
00033
00034 if self.x is None:
00035 self.x = 0.
00036 if self.y is None:
00037 self.y = 0.
00038 if self.z is None:
00039 self.z = 0.
00040 else:
00041 self.x = 0.
00042 self.y = 0.
00043 self.z = 0.
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_3f.pack(_x.x, _x.y, _x.z))
00060 except struct.error, se: self._check_types(se)
00061 except TypeError, te: self._check_types(te)
00062
00063 def deserialize(self, str):
00064 """
00065 unpack serialized message in str into this message instance
00066 @param str: byte array of serialized message
00067 @type str: str
00068 """
00069 try:
00070 end = 0
00071 _x = self
00072 start = end
00073 end += 12
00074 (_x.x, _x.y, _x.z,) = _struct_3f.unpack(str[start:end])
00075 return self
00076 except struct.error, e:
00077 raise roslib.message.DeserializationError(e)
00078
00079
00080 def serialize_numpy(self, buff, numpy):
00081 """
00082 serialize message with numpy array types into buffer
00083 @param buff: buffer
00084 @type buff: StringIO
00085 @param numpy: numpy python module
00086 @type numpy module
00087 """
00088 try:
00089 _x = self
00090 buff.write(_struct_3f.pack(_x.x, _x.y, _x.z))
00091 except struct.error, se: self._check_types(se)
00092 except TypeError, te: self._check_types(te)
00093
00094 def deserialize_numpy(self, str, numpy):
00095 """
00096 unpack serialized message in str into this message instance using numpy for array types
00097 @param str: byte array of serialized message
00098 @type str: str
00099 @param numpy: numpy python module
00100 @type numpy: module
00101 """
00102 try:
00103 end = 0
00104 _x = self
00105 start = end
00106 end += 12
00107 (_x.x, _x.y, _x.z,) = _struct_3f.unpack(str[start:end])
00108 return self
00109 except struct.error, e:
00110 raise roslib.message.DeserializationError(e)
00111
00112 _struct_I = roslib.message.struct_I
00113 _struct_3f = struct.Struct("<3f")