00001 """autogenerated by genmsg_py from ShapeResult.msg. Do not edit."""
00002 import roslib.message
00003 import struct
00004
00005
00006 class ShapeResult(roslib.message.Message):
00007 _md5sum = "b06c6e2225f820dbc644270387cd1a7c"
00008 _type = "turtle_actionlib/ShapeResult"
00009 _has_header = False
00010 _full_text = """# ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ======
00011 #result definition
00012 float32 interior_angle
00013 float32 apothem
00014
00015 """
00016 __slots__ = ['interior_angle','apothem']
00017 _slot_types = ['float32','float32']
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 interior_angle,apothem
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(ShapeResult, self).__init__(*args, **kwds)
00035
00036 if self.interior_angle is None:
00037 self.interior_angle = 0.
00038 if self.apothem is None:
00039 self.apothem = 0.
00040 else:
00041 self.interior_angle = 0.
00042 self.apothem = 0.
00043
00044 def _get_types(self):
00045 """
00046 internal API method
00047 """
00048 return self._slot_types
00049
00050 def serialize(self, buff):
00051 """
00052 serialize message into buffer
00053 @param buff: buffer
00054 @type buff: StringIO
00055 """
00056 try:
00057 _x = self
00058 buff.write(_struct_2f.pack(_x.interior_angle, _x.apothem))
00059 except struct.error, se: self._check_types(se)
00060 except TypeError, te: self._check_types(te)
00061
00062 def deserialize(self, str):
00063 """
00064 unpack serialized message in str into this message instance
00065 @param str: byte array of serialized message
00066 @type str: str
00067 """
00068 try:
00069 end = 0
00070 _x = self
00071 start = end
00072 end += 8
00073 (_x.interior_angle, _x.apothem,) = _struct_2f.unpack(str[start:end])
00074 return self
00075 except struct.error, e:
00076 raise roslib.message.DeserializationError(e)
00077
00078
00079 def serialize_numpy(self, buff, numpy):
00080 """
00081 serialize message with numpy array types into buffer
00082 @param buff: buffer
00083 @type buff: StringIO
00084 @param numpy: numpy python module
00085 @type numpy module
00086 """
00087 try:
00088 _x = self
00089 buff.write(_struct_2f.pack(_x.interior_angle, _x.apothem))
00090 except struct.error, se: self._check_types(se)
00091 except TypeError, te: self._check_types(te)
00092
00093 def deserialize_numpy(self, str, numpy):
00094 """
00095 unpack serialized message in str into this message instance using numpy for array types
00096 @param str: byte array of serialized message
00097 @type str: str
00098 @param numpy: numpy python module
00099 @type numpy: module
00100 """
00101 try:
00102 end = 0
00103 _x = self
00104 start = end
00105 end += 8
00106 (_x.interior_angle, _x.apothem,) = _struct_2f.unpack(str[start:end])
00107 return self
00108 except struct.error, e:
00109 raise roslib.message.DeserializationError(e)
00110
00111 _struct_I = roslib.message.struct_I
00112 _struct_2f = struct.Struct("<2f")