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