00001 """autogenerated by genmsg_py from FibonacciResult.msg. Do not edit."""
00002 import roslib.message
00003 import struct
00004
00005
00006 class FibonacciResult(roslib.message.Message):
00007 _md5sum = "b81e37d2a31925a0e8ae261a8699cb79"
00008 _type = "actionlib_tutorials/FibonacciResult"
00009 _has_header = False
00010 _full_text = """# ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ======
00011 #result definition
00012 int32[] sequence
00013
00014 """
00015 __slots__ = ['sequence']
00016 _slot_types = ['int32[]']
00017
00018 def __init__(self, *args, **kwds):
00019 """
00020 Constructor. Any message fields that are implicitly/explicitly
00021 set to None will be assigned a default value. The recommend
00022 use is keyword arguments as this is more robust to future message
00023 changes. You cannot mix in-order arguments and keyword arguments.
00024
00025 The available fields are:
00026 sequence
00027
00028 @param args: complete set of field values, in .msg order
00029 @param kwds: use keyword arguments corresponding to message field names
00030 to set specific fields.
00031 """
00032 if args or kwds:
00033 super(FibonacciResult, self).__init__(*args, **kwds)
00034
00035 if self.sequence is None:
00036 self.sequence = []
00037 else:
00038 self.sequence = []
00039
00040 def _get_types(self):
00041 """
00042 internal API method
00043 """
00044 return self._slot_types
00045
00046 def serialize(self, buff):
00047 """
00048 serialize message into buffer
00049 @param buff: buffer
00050 @type buff: StringIO
00051 """
00052 try:
00053 length = len(self.sequence)
00054 buff.write(_struct_I.pack(length))
00055 pattern = '<%si'%length
00056 buff.write(struct.pack(pattern, *self.sequence))
00057 except struct.error, se: self._check_types(se)
00058 except TypeError, te: self._check_types(te)
00059
00060 def deserialize(self, str):
00061 """
00062 unpack serialized message in str into this message instance
00063 @param str: byte array of serialized message
00064 @type str: str
00065 """
00066 try:
00067 end = 0
00068 start = end
00069 end += 4
00070 (length,) = _struct_I.unpack(str[start:end])
00071 pattern = '<%si'%length
00072 start = end
00073 end += struct.calcsize(pattern)
00074 self.sequence = struct.unpack(pattern, 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 length = len(self.sequence)
00090 buff.write(_struct_I.pack(length))
00091 pattern = '<%si'%length
00092 buff.write(self.sequence.tostring())
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 start = end
00107 end += 4
00108 (length,) = _struct_I.unpack(str[start:end])
00109 pattern = '<%si'%length
00110 start = end
00111 end += struct.calcsize(pattern)
00112 self.sequence = numpy.frombuffer(str[start:end], dtype=numpy.int32, count=length)
00113 return self
00114 except struct.error, e:
00115 raise roslib.message.DeserializationError(e)
00116
00117 _struct_I = roslib.message.struct_I