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